-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevbar.html.twig
More file actions
94 lines (91 loc) · 5.44 KB
/
devbar.html.twig
File metadata and controls
94 lines (91 loc) · 5.44 KB
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
86
87
88
89
90
91
92
93
94
{# DiscoDevBar Template #}
{# This template displays DiscoDevBar with links to various tools and information #}
{# Show with `{% if app.environment == 'dev' %}` condition #}
{% set banner_data = debug_banner_data() %}
<link rel="stylesheet" href="{{ asset('bundles/discodevbar/devbar.css') }}">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/{{ banner_data.fontAwesomeVersion|default('6.7.2') }}/css/all.min.css"
crossorigin="anonymous"
referrerpolicy="no-referrer" />
<div class="disco-devbar{% if banner_data.hasError %} disco-devbar-error{% endif %}" style="--bg-color-light: {{ banner_data.bgColorLight }}; --bg-color-dark: {{ banner_data.bgColorDark }}">
<div class="disco-devbar-content">
{% if banner_data.hasError %}
<div class="disco-devbar-container-left">
<span class="disco-devbar-widget">
<a href="https://github.com/MarcinOrlowski/php-symfony-discodevbar" class="disco-devbar-link" target="_blank" title="Visit DiscoDevBar on GitHub">
<span class="disco-devbar-link-content">Disco DevBar</span>
</a>
</span>
<span class="disco-devbar-separator">·</span>
<span class="disco-devbar-widget">
<span class="disco-devbar-text">v{{ banner_data.version ?? 'N/A' }} * {{ banner_data.errorMessage }}</span>
</span>
</div>
{% else %}
<div class="disco-devbar-container-left {% if banner_data.leftExpand %}disco-devbar-container-expand{% endif %}">
{% for widget in banner_data.left %}
{% if not loop.first %}
<span class="disco-devbar-separator">·</span>
{% endif %}
{% if widget.type == 'close' %}
<span class="disco-devbar-widget">
<a href="#" class="disco-devbar-link" onclick="document.querySelector('.disco-devbar').remove(); return false;" title="Close DevBar">
<span class="disco-devbar-link-content">✕</span>
</a>
</span>
{% else %}
<span class="disco-devbar-widget {% if widget.expand %}disco-devbar-widget-expand{% endif %}">
<a href="{{ widget.url }}"
class="disco-devbar-link"
{% if widget.target %}target="{{ widget.target }}"{% endif %}
{% if widget.title %}title="{{ widget.title }}"{% endif %}>
<span class="disco-devbar-link-content">
{% if widget.icon %}
{% if widget.iconType.value == 'fa' %}
<i class="fa-solid {{ widget.icon }}"></i>
{% else %}
{{ widget.icon }}
{% endif %}
{% endif %}
{% if widget.text %}{{ widget.text }}{% endif %}
</span>
</a>
</span>
{% endif %}
{% endfor %}
</div>
<div class="disco-devbar-container-right {% if banner_data.rightExpand %}disco-devbar-container-expand{% endif %}">
{% for widget in banner_data.right %}
{% if not loop.first %}
<span class="disco-devbar-separator">·</span>
{% endif %}
{% if widget.type == 'close' %}
<span class="disco-devbar-widget">
<a href="#" class="disco-devbar-link" onclick="document.querySelector('.disco-devbar').remove(); return false;" title="Close DevBar">
<span class="disco-devbar-link-content">✕</span>
</a>
</span>
{% else %}
<span class="disco-devbar-widget {% if widget.expand %}disco-devbar-widget-expand{% endif %}">
<a href="{{ widget.url }}"
class="disco-devbar-link"
{% if widget.target %}target="{{ widget.target }}"{% endif %}
{% if widget.title %}title="{{ widget.title }}"{% endif %}>
<span class="disco-devbar-link-content">
{% if widget.icon %}
{% if widget.iconType.value == 'fa' %}
<i class="fa-solid {{ widget.icon }}"></i>
{% else %}
{{ widget.icon }}
{% endif %}
{% endif %}
{% if widget.text %}{{ widget.text }}{% endif %}
</span>
</a>
</span>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</div>