-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patherrors.html.twig
85 lines (80 loc) · 4.05 KB
/
errors.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{% extends 'layout.html.twig' %}
{% block title %}
{{ parent() }} » Compilation errors
{% endblock %}
{% block content %}
<div class="row-fluid">
<aside class="span5">
<ul class="side-nav nav nav-list">
<li class="nav-header">Filter type</li>
<li>
<div class="btn-group type-filter" data-toggle="buttons-checkbox">
<button class="btn critical">Critical</button>
<button class="btn error">Error</button>
<button class="btn notice">Notice</button>
</div>
</li>
<li class="nav-header">Navigation</li>
{% set errorCount = 0 %}
{% set fileCounts = [] %}
{% for file in project.files|sort_asc %}
{% if file.allerrors|length > 0 %}
{% set fileCount = 0 %}
{% for error in file.allerrors %}
{% if error.code != 'PPC:ERR-50000' %}
{% set fileCount = fileCount + 1 %}
{% endif %}
{% endfor %}
{% if fileCount > 0 %}
{% set fileCounts = fileCounts|merge({(file.path): fileCount}) %}
<li><a href="#{{ file.path }}"><i class="icon-file"></i> {{ file.path }}</a></li>
{% endif %}
{% set errorCount = errorCount + fileCount %}
{% endif %}
{% endfor %}
</ul>
</aside>
<main class="span7">
<h1>Compilation Errors</h1>
{% if errorCount <= 0 %}
<div class="alert alert-info">No errors have been found in this project.</div>
{% else %}
<div class="errors">
{% for file in project.files|sort_asc %}
{% if file.allerrors|length > 0 and fileCounts[file.path] is defined %}
<div class="errors__file">
<h2 class="errors__file--header" id="{{ file.path }}">
{{ file.path }} <span class="pull-right badge badge-info">{{ fileCounts[file.path] }}</span>
</h2>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th scope="col">Type</th>
<th scope="col">Line</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
{% for error in file.allerrors %}
{% if error.code != 'PPC:ERR-50000' %}
<tr class="{{ error.severity }}">
<td>{{ error.severity }}</td>
<td>{{ error.line }}</td>
<td>{{ error.code|trans(error.context) }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}
<ul class="breadcrumb">
<li><a href="{% if path('/') == '' %}?{% else %}{{ path('/') }}{% endif %}"><i class="icon-flag"></i></a> <span class="divider">/</span></li>
<li class="active">Compilation Errors</li>
</ul>
</main>
</div>
{% endblock %}