Skip to content

Commit

Permalink
Issue #654: Copy assets to underscored directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Melissa Bent authored and sebastianbergmann committed Nov 21, 2018
1 parent 55d376e commit 5d11c2c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/Report/Html/Facade.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ public function process(CodeCoverage $coverage, string $target): void
*/
private function copyFiles(string $target): void
{
$dir = $this->getDirectory($target . '.css');
$dir = $this->getDirectory($target . '_css');

\copy($this->templatePath . 'css/bootstrap.min.css', $dir . 'bootstrap.min.css');
\copy($this->templatePath . 'css/nv.d3.min.css', $dir . 'nv.d3.min.css');
\copy($this->templatePath . 'css/style.css', $dir . 'style.css');
\copy($this->templatePath . 'css/custom.css', $dir . 'custom.css');
\copy($this->templatePath . 'css/octicons.css', $dir . 'octicons.css');

$dir = $this->getDirectory($target . '.icons');
$dir = $this->getDirectory($target . '_icons');
\copy($this->templatePath . 'icons/file-code.svg', $dir . 'file-code.svg');
\copy($this->templatePath . 'icons/file-directory.svg', $dir . 'file-directory.svg');

$dir = $this->getDirectory($target . '.js');
$dir = $this->getDirectory($target . '_js');
\copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js');
\copy($this->templatePath . 'js/popper.min.js', $dir . 'popper.min.js');
\copy($this->templatePath . 'js/d3.min.js', $dir . 'd3.min.js');
Expand Down
4 changes: 2 additions & 2 deletions src/Report/Html/Renderer/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function renderItem(Node $node, bool $total = false): string

$up = \str_repeat('../', \count($node->getPathAsArray()) - 2);

$data['icon'] = \sprintf('<img src="%s.icons/file-directory.svg" class="octicon" />', $up);
$data['icon'] = \sprintf('<img src="%s_icons/file-directory.svg" class="octicon" />', $up);
} else {
$data['name'] = \sprintf(
'<a href="%s.html">%s</a>',
Expand All @@ -86,7 +86,7 @@ protected function renderItem(Node $node, bool $total = false): string

$up = \str_repeat('../', \count($node->getPathAsArray()) - 2);

$data['icon'] = \sprintf('<img src="%s.icons/file-code.svg" class="octicon" />', $up);
$data['icon'] = \sprintf('<img src="%s_icons/file-code.svg" class="octicon" />', $up);
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/Report/Html/Renderer/Template/dashboard.html.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="UTF-8">
<title>Dashboard for {{full_path}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{{path_to_root}}.css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/nv.d3.min.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/style.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/custom.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/nv.d3.min.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
Expand Down Expand Up @@ -137,9 +137,9 @@
</p>
</footer>
</div>
<script src="{{path_to_root}}.js/jquery.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}.js/d3.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}.js/nv.d3.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}_js/jquery.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}_js/d3.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}_js/nv.d3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
nv.addGraph(function() {
Expand Down
8 changes: 4 additions & 4 deletions src/Report/Html/Renderer/Template/directory.html.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="UTF-8">
<title>Code Coverage for {{full_path}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{{path_to_root}}.css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/octicons.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/style.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/custom.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/octicons.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
Expand Down
16 changes: 8 additions & 8 deletions src/Report/Html/Renderer/Template/file.html.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="UTF-8">
<title>Code Coverage for {{full_path}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{{path_to_root}}.css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/octicons.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/style.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}.css/custom.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/octicons.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/style.css" rel="stylesheet" type="text/css">
<link href="{{path_to_root}}_css/custom.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
Expand Down Expand Up @@ -64,9 +64,9 @@
</a>
</footer>
</div>
<script src="{{path_to_root}}.js/jquery.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}.js/popper.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}.js/bootstrap.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}.js/file.js" type="text/javascript"></script>
<script src="{{path_to_root}}_js/jquery.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}_js/popper.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}_js/bootstrap.min.js" type="text/javascript"></script>
<script src="{{path_to_root}}_js/file.js" type="text/javascript"></script>
</body>
</html>

0 comments on commit 5d11c2c

Please sign in to comment.