|
2 | 2 | {# This template displays DiscoDevBar with links to various tools and information #} |
3 | 3 | {# Show with `{% if app.environment == 'dev' %}` condition #} |
4 | 4 |
|
5 | | -<div class="disco-devbar"> |
| 5 | +{% set banner_data = debug_banner_data() %} |
| 6 | + |
| 7 | +{# Auto-include Font Awesome if enabled in configuration #} |
| 8 | +{% if banner_data.fontAwesomeEnabled %} |
| 9 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/{{ banner_data.fontAwesomeVersion }}/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" /> |
| 10 | +{% endif %} |
| 11 | + |
| 12 | +<div class="disco-devbar{% if banner_data.hasError %} disco-devbar-error{% endif %}"> |
6 | 13 | <div class="disco-devbar-content"> |
7 | | - {% set banner_data = debug_banner_data() %} |
8 | | - <div class="disco-devbar-container-left {% if banner_data.leftExpand %}disco-devbar-container-expand{% endif %}"> |
9 | | - {% for widget in banner_data.left %} |
10 | | - {% if not loop.first %} |
11 | | - <span class="disco-devbar-separator">·</span> |
12 | | - {% endif %} |
13 | | - <span class="disco-devbar-widget {% if widget.expand %}disco-devbar-widget-expand{% endif %}"> |
14 | | - <a href="{{ widget.url }}" |
15 | | - class="disco-devbar-link" |
16 | | - {% if widget.target %}target="{{ widget.target }}"{% endif %} |
17 | | - {% if widget.title %}title="{{ widget.title }}"{% endif %}> |
18 | | - <span class="disco-devbar-link-content"> |
19 | | - {% if widget.icon %} |
20 | | - {% if widget.iconType.value == 'fa' %} |
21 | | - <i class="fa-solid {{ widget.icon }}"></i> |
22 | | - {% else %} |
23 | | - {{ widget.icon }} |
24 | | - {% endif %} |
25 | | - {% endif %} |
26 | | - {% if widget.text %}{{ widget.text }}{% endif %} |
27 | | - </span> |
| 14 | + {% if banner_data.hasError %} |
| 15 | + <div class="disco-devbar-container-left"> |
| 16 | + <span class="disco-devbar-widget"> |
| 17 | + <a href="https://github.com/MarcinOrlowski/php-symfony-discodevbar" class="disco-devbar-link" target="_blank" title="Visit DiscoDevBar on GitHub"> |
| 18 | + <span class="disco-devbar-link-content">Disco DevBar</span> |
28 | 19 | </a> |
29 | 20 | </span> |
30 | | - {% endfor %} |
31 | | - </div> |
32 | | - <div class="disco-devbar-container-right {% if banner_data.rightExpand %}disco-devbar-container-expand{% endif %}"> |
33 | | - {% for widget in banner_data.right %} |
34 | | - {% if not loop.first %} |
35 | | - <span class="disco-devbar-separator">·</span> |
36 | | - {% endif %} |
37 | | - <span class="disco-devbar-widget {% if widget.expand %}disco-devbar-widget-expand{% endif %}"> |
38 | | - <a href="{{ widget.url }}" |
39 | | - class="disco-devbar-link" |
40 | | - {% if widget.target %}target="{{ widget.target }}"{% endif %} |
41 | | - {% if widget.title %}title="{{ widget.title }}"{% endif %}> |
42 | | - <span class="disco-devbar-link-content"> |
43 | | - {% if widget.icon %} |
44 | | - {% if widget.iconType.value == 'fa' %} |
45 | | - <i class="fa-solid {{ widget.icon }}"></i> |
46 | | - {% else %} |
47 | | - {{ widget.icon }} |
48 | | - {% endif %} |
49 | | - {% endif %} |
50 | | - {% if widget.text %}{{ widget.text }}{% endif %} |
51 | | - </span> |
52 | | - </a> |
| 21 | + <span class="disco-devbar-separator">·</span> |
| 22 | + <span class="disco-devbar-widget"> |
| 23 | + <span class="disco-devbar-text">v{{ banner_data.version ?? 'N/A' }} * {{ banner_data.errorMessage }}</span> |
53 | 24 | </span> |
54 | | - {% endfor %} |
55 | | - </div> |
| 25 | + </div> |
| 26 | + {% else %} |
| 27 | + <div class="disco-devbar-container-left {% if banner_data.leftExpand %}disco-devbar-container-expand{% endif %}"> |
| 28 | + {% for widget in banner_data.left %} |
| 29 | + {% if not loop.first %} |
| 30 | + <span class="disco-devbar-separator">·</span> |
| 31 | + {% endif %} |
| 32 | + <span class="disco-devbar-widget {% if widget.expand %}disco-devbar-widget-expand{% endif %}"> |
| 33 | + <a href="{{ widget.url }}" |
| 34 | + class="disco-devbar-link" |
| 35 | + {% if widget.target %}target="{{ widget.target }}"{% endif %} |
| 36 | + {% if widget.title %}title="{{ widget.title }}"{% endif %}> |
| 37 | + <span class="disco-devbar-link-content"> |
| 38 | + {% if widget.icon %} |
| 39 | + {% if widget.iconType.value == 'fa' %} |
| 40 | + <i class="fa-solid {{ widget.icon }}"></i> |
| 41 | + {% else %} |
| 42 | + {{ widget.icon }} |
| 43 | + {% endif %} |
| 44 | + {% endif %} |
| 45 | + {% if widget.text %}{{ widget.text }}{% endif %} |
| 46 | + </span> |
| 47 | + </a> |
| 48 | + </span> |
| 49 | + {% endfor %} |
| 50 | + </div> |
| 51 | + <div class="disco-devbar-container-right {% if banner_data.rightExpand %}disco-devbar-container-expand{% endif %}"> |
| 52 | + {% for widget in banner_data.right %} |
| 53 | + {% if not loop.first %} |
| 54 | + <span class="disco-devbar-separator">·</span> |
| 55 | + {% endif %} |
| 56 | + <span class="disco-devbar-widget {% if widget.expand %}disco-devbar-widget-expand{% endif %}"> |
| 57 | + <a href="{{ widget.url }}" |
| 58 | + class="disco-devbar-link" |
| 59 | + {% if widget.target %}target="{{ widget.target }}"{% endif %} |
| 60 | + {% if widget.title %}title="{{ widget.title }}"{% endif %}> |
| 61 | + <span class="disco-devbar-link-content"> |
| 62 | + {% if widget.icon %} |
| 63 | + {% if widget.iconType.value == 'fa' %} |
| 64 | + <i class="fa-solid {{ widget.icon }}"></i> |
| 65 | + {% else %} |
| 66 | + {{ widget.icon }} |
| 67 | + {% endif %} |
| 68 | + {% endif %} |
| 69 | + {% if widget.text %}{{ widget.text }}{% endif %} |
| 70 | + </span> |
| 71 | + </a> |
| 72 | + </span> |
| 73 | + {% endfor %} |
| 74 | + </div> |
| 75 | + {% endif %} |
56 | 76 | </div> |
57 | 77 | </div> |
0 commit comments