|
3 | 3 | {% import _self as helper %}
|
4 | 4 |
|
5 | 5 | {% block toolbar %}
|
6 |
| - {% set unavailable_migrations = collector.data.unavailable_migrations_count %} |
7 |
| - {% set new_migrations = collector.data.new_migrations|length %} |
8 |
| - {% if unavailable_migrations > 0 or new_migrations > 0 %} |
9 |
| - {% set executed_migrations = collector.data.executed_migrations|length %} |
10 |
| - {% set available_migrations = collector.data.available_migrations_count %} |
11 |
| - {% set status_color = unavailable_migrations > 0 ? 'yellow' : '' %} |
12 |
| - {% set status_color = new_migrations > 0 ? 'red' : status_color %} |
| 6 | + {% if collector.data.unavailable_migrations is defined %} |
| 7 | + {% set unavailable_migrations = collector.data.unavailable_migrations_count %} |
| 8 | + {% set new_migrations = collector.data.new_migrations|length %} |
| 9 | + {% if unavailable_migrations > 0 or new_migrations > 0 %} |
| 10 | + {% set executed_migrations = collector.data.executed_migrations|length %} |
| 11 | + {% set available_migrations = collector.data.available_migrations_count %} |
| 12 | + {% set status_color = unavailable_migrations > 0 ? 'yellow' : '' %} |
| 13 | + {% set status_color = new_migrations > 0 ? 'red' : status_color %} |
13 | 14 |
|
14 |
| - {% set icon %} |
15 |
| - {{ include('@DoctrineMigrations/Collector/icon.svg') }} |
16 |
| - <span class="sf-toolbar-value">{{ new_migrations + unavailable_migrations }}</span> |
17 |
| - {% endset %} |
| 15 | + {% set icon %} |
| 16 | + {{ include('@DoctrineMigrations/Collector/icon.svg') }} |
| 17 | + <span class="sf-toolbar-value">{{ new_migrations + unavailable_migrations }}</span> |
| 18 | + {% endset %} |
18 | 19 |
|
19 |
| - {% set text %} |
20 |
| - <div class="sf-toolbar-info-piece"> |
21 |
| - <b>Current</b> |
22 |
| - <span>{{ executed_migrations > 0 ? collector.data.executed_migrations|last.version|split('\\')|last : 'n/a' }}</span> |
23 |
| - </div> |
24 |
| - <div class="sf-toolbar-info-piece"> |
25 |
| - <b>Executed</b> |
26 |
| - <span class="sf-toolbar-status">{{ executed_migrations }}</span> |
27 |
| - </div> |
28 |
| - <div class="sf-toolbar-info-piece"> |
29 |
| - <b>Executed Unavailable</b> |
30 |
| - <span class="sf-toolbar-status {{ unavailable_migrations > 0 ? 'sf-toolbar-status-yellow' }}">{{ unavailable_migrations }}</span> |
31 |
| - </div> |
32 |
| - <div class="sf-toolbar-info-piece"> |
33 |
| - <b>Available</b> |
34 |
| - <span class="sf-toolbar-status">{{ available_migrations }}</span> |
35 |
| - </div> |
36 |
| - <div class="sf-toolbar-info-piece"> |
37 |
| - <b>New</b> |
38 |
| - <span class="sf-toolbar-status {{ new_migrations > 0 ? 'sf-toolbar-status-red' }}">{{ new_migrations }}</span> |
39 |
| - </div> |
40 |
| - {% endset %} |
| 20 | + {% set text %} |
| 21 | + <div class="sf-toolbar-info-piece"> |
| 22 | + <b>Current</b> |
| 23 | + <span>{{ executed_migrations > 0 ? collector.data.executed_migrations|last.version|split('\\')|last : 'n/a' }}</span> |
| 24 | + </div> |
| 25 | + <div class="sf-toolbar-info-piece"> |
| 26 | + <b>Executed</b> |
| 27 | + <span class="sf-toolbar-status">{{ executed_migrations }}</span> |
| 28 | + </div> |
| 29 | + <div class="sf-toolbar-info-piece"> |
| 30 | + <b>Executed Unavailable</b> |
| 31 | + <span class="sf-toolbar-status {{ unavailable_migrations > 0 ? 'sf-toolbar-status-yellow' }}">{{ unavailable_migrations }}</span> |
| 32 | + </div> |
| 33 | + <div class="sf-toolbar-info-piece"> |
| 34 | + <b>Available</b> |
| 35 | + <span class="sf-toolbar-status">{{ available_migrations }}</span> |
| 36 | + </div> |
| 37 | + <div class="sf-toolbar-info-piece"> |
| 38 | + <b>New</b> |
| 39 | + <span class="sf-toolbar-status {{ new_migrations > 0 ? 'sf-toolbar-status-red' }}">{{ new_migrations }}</span> |
| 40 | + </div> |
| 41 | + {% endset %} |
41 | 42 |
|
42 |
| - {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} |
| 43 | + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} |
| 44 | + {% endif %} |
43 | 45 | {% endif %}
|
44 | 46 | {% endblock %}
|
45 | 47 |
|
46 | 48 |
|
47 | 49 | {% block menu %}
|
48 |
| - {% set unavailable_migrations = collector.data.unavailable_migrations_count %} |
49 |
| - {% set new_migrations = collector.data.new_migrations|length %} |
50 |
| - {% set label = unavailable_migrations > 0 ? 'label-status-warning' : '' %} |
51 |
| - {% set label = new_migrations > 0 ? 'label-status-error' : label %} |
52 |
| - <span class="label {{ label }}"> |
53 |
| - <span class="icon">{{ include('@DoctrineMigrations/Collector/icon.svg') }}</span> |
54 |
| - <strong>Migrations</strong> |
55 |
| - {% if unavailable_migrations > 0 or new_migrations > 0 %} |
56 |
| - <span class="count"> |
57 |
| - <span>{{ new_migrations + unavailable_migrations }}</span> |
58 |
| - </span> |
59 |
| - {% endif %} |
60 |
| - </span> |
| 50 | + {% if collector.data.unavailable_migrations is defined %} |
| 51 | + {% set unavailable_migrations = collector.data.unavailable_migrations_count %} |
| 52 | + {% set new_migrations = collector.data.new_migrations|length %} |
| 53 | + {% set label = unavailable_migrations > 0 ? 'label-status-warning' : '' %} |
| 54 | + {% set label = new_migrations > 0 ? 'label-status-error' : label %} |
| 55 | + <span class="label {{ label }}"> |
| 56 | + <span class="icon">{{ include('@DoctrineMigrations/Collector/icon.svg') }}</span> |
| 57 | + <strong>Migrations</strong> |
| 58 | + {% if unavailable_migrations > 0 or new_migrations > 0 %} |
| 59 | + <span class="count"> |
| 60 | + <span>{{ new_migrations + unavailable_migrations }}</span> |
| 61 | + </span> |
| 62 | + {% endif %} |
| 63 | + </span> |
| 64 | + {% endif %} |
61 | 65 | {% endblock %}
|
62 | 66 |
|
63 | 67 | {% block panel %}
|
|
0 commit comments