Skip to content

Commit 746a34c

Browse files
committed
Fix the actions not being hidden in the Triggers, Routines, Events pages
Fixes #17392 Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 53b4011 commit 746a34c

8 files changed

Lines changed: 895 additions & 14 deletions

File tree

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ phpMyAdmin - ChangeLog
4040
- issue Fix list of users of an user group not showing up
4141
- issue Fix duplicate query params in the SQL message card
4242
- issue #18314 Fix dragged row in index form
43+
- issue #17392 Fix the actions not being hidden in the Triggers, Routines, Events pages
4344

4445
5.2.1 (2023-02-07)
4546
- issue #17522 Fix case where the routes cache file is invalid

templates/database/events/index.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
</h2>
66

77
<div class="d-flex flex-wrap my-3">
8+
{%- if items is not empty %}
89
<div>
910
<div class="input-group">
1011
<div class="input-group-text">
@@ -21,8 +22,9 @@
2122
</button>
2223
</div>
2324
</div>
25+
{%- endif %}
2426

25-
<div class="ms-auto">
27+
<div{{ items is not empty ? ' class="ms-auto"' }}>
2628
<a class="ajax add_anchor btn btn-primary{{ not has_privilege ? ' disabled' }}" href="{{ url('/database/events', {'db': db, 'add_item': true}) }}" role="button"{{ not has_privilege ? ' tabindex="-1" aria-disabled="true"' }}>
2729
{{ get_icon('b_event_add', 'Create new event'|trans) }}
2830
</a>
@@ -33,7 +35,7 @@
3335
{{ get_hidden_inputs(db) }}
3436

3537
<div id="nothing2display"{{ items is not empty ? ' class="hide"' }}>
36-
{% trans 'There are no events to display.' %}
38+
{{ 'There are no events to display.'|trans|notice }}
3739
</div>
3840

3941
<table id="eventsTable" class="table table-striped table-hover{{ items is empty ? ' hide' }} w-auto data">

templates/database/routines/index.twig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
</h2>
66

77
<div class="d-flex flex-wrap my-3">
8+
{%- if items is not empty %}
89
<div>
910
<div class="input-group">
1011
<div class="input-group-text">
@@ -28,7 +29,9 @@
2829
<input class="form-control" name="filterText" type="text" id="filterText" value="" placeholder="{% trans 'Search' %}" aria-label="{% trans 'Search' %}">
2930
</div>
3031
</div>
31-
<div class="ms-2">
32+
{%- endif %}
33+
34+
<div{{ items is not empty ? ' class="ms-2"' }}>
3235
<a class="ajax add_anchor btn btn-primary{{ not has_privilege ? ' disabled' }}" href="{{ url('/database/routines', {'db': db, 'table': table, 'add_item': true}) }}" role="button"{{ not has_privilege ? ' tabindex="-1" aria-disabled="true"' }}>
3336
{{ get_icon('b_routine_add', 'Create new routine'|trans) }}
3437
</a>
@@ -39,7 +42,7 @@
3942
{{ get_hidden_inputs(db, table) }}
4043

4144
<div id="nothing2display"{{ items is not empty ? ' class="hide"' }}>
42-
{% trans 'There are no routines to display.' %}
45+
{{ 'There are no routines to display.'|trans|notice }}
4346
</div>
4447

4548
<table id="routinesTable" class="table table-striped table-hover{{ items is empty ? ' hide' }} data w-auto">
@@ -55,7 +58,7 @@
5558
<tbody>
5659
<tr class="hide">{% for i in 0..7 %}<td></td>{% endfor %}</tr>
5760

58-
{{ rows|raw }}
61+
{{- rows|raw }}
5962
</tbody>
6063
</table>
6164
</form>

templates/database/routines/row.twig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
<span class="drop_sql hide">{{ sql_drop }}</span>
77
<strong>{{ routine.name }}</strong>
88
</td>
9-
<td>
10-
{{ routine.type }}
11-
</td>
12-
<td dir="ltr">
13-
{{ routine.returns }}
14-
</td>
9+
<td>{{ routine.type }}</td>
10+
<td dir="ltr">{{ routine.returns }}</td>
1511
<td>
1612
{% if has_edit_privilege %}
1713
<a class="ajax edit_anchor" href="{{ url('/database/routines', {

templates/database/triggers/list.twig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
</h2>
66

77
<div class="d-flex flex-wrap my-3">
8+
{%- if items is not empty %}
89
<div>
910
<div class="input-group">
1011
<div class="input-group-text">
@@ -21,8 +22,9 @@
2122
</button>
2223
</div>
2324
</div>
25+
{%- endif %}
2426

25-
<div class="ms-auto">
27+
<div{{ items is not empty ? ' class="ms-auto"' }}>
2628
<a class="ajax add_anchor btn btn-primary{{ not has_privilege ? ' disabled' }}" href="{{ url('/database/triggers', {'db': db, 'table': table, 'add_item': true}) }}" role="button"{{ not has_privilege ? ' tabindex="-1" aria-disabled="true"' }}>
2729
{{ get_icon('b_trigger_add', 'Create new trigger'|trans) }}
2830
</a>
@@ -33,7 +35,7 @@
3335
{{ get_hidden_inputs(db, table) }}
3436

3537
<div id="nothing2display"{{ items is not empty ? ' class="hide"' }}>
36-
{% trans 'There are no triggers to display.' %}
38+
{{ 'There are no triggers to display.'|trans|notice }}
3739
</div>
3840

3941
<table id="triggersTable" class="table table-striped table-hover{{ items is empty ? ' hide' }} w-auto data">
@@ -52,7 +54,7 @@
5254
<tbody>
5355
<tr class="hide">{% for i in 0..(table is empty ? 7 : 6) %}<td></td>{% endfor %}</tr>
5456

55-
{{ rows|raw }}
57+
{{- rows|raw }}
5658
</tbody>
5759
</table>
5860
</form>

0 commit comments

Comments
 (0)