Skip to content

Commit 1032abf

Browse files
authored
Merge pull request #47 from gzumba/fix-request-get
Update app.request.get to use proper query/attribute refs
2 parents ba11423 + 2af9489 commit 1032abf

5 files changed

Lines changed: 23 additions & 23 deletions

File tree

templates/event/index.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<dl class="divide-y divide-gray-200 overflow-hidden rounded-lg bg-white shadow ring-1 ring-black ring-opacity-5 w-2/3 sticky top-4">
5353
<div class="text-sm text-gray-500">
5454
{% for event in events %}
55-
{% if event.name == app.request.get('name') %}
55+
{% if event.name == app.request.query.get('name') %}
5656

5757
<div class="px-4 py-6 bg-gray-50 text-gray-500 font-semibold">
5858
Details
@@ -92,7 +92,7 @@
9292
{% endif %}
9393
{% endfor %}
9494

95-
{% if not app.request.get('name') %}
95+
{% if not app.request.query.get('name') %}
9696

9797
<div class="py-24 text-xl text-gray-400 text-center">
9898
{{ heroicon('calendar', 'h-12 w-12 text-gray-400 mx-auto mb-2') }}

templates/inspection/index.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<label for="aggregate" class="block text-sm font-medium leading-6 text-gray-900">Aggregate</label>
1818
<select required id="aggregate" name="aggregate"
1919
class="mt-2 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6">
20-
<option {% if app.request.get('aggregate') == "" %}selected{% endif %}
20+
<option {% if app.request.query.get('aggregate') == "" %}selected{% endif %}
2121
value="">-- choose --
2222
</option>
2323
{% for aggregate in aggregates %}
24-
<option {% if app.request.get('aggregate') == aggregate %}selected{% endif %}
24+
<option {% if app.request.query.get('aggregate') == aggregate %}selected{% endif %}
2525
value="{{ aggregate }}">{{ aggregate }}</option>
2626
{% endfor %}
2727
</select>
@@ -34,7 +34,7 @@
3434
<input type="text" name="aggregateId" id="aggregateId" required
3535
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
3636
placeholder="018d233e-7906-73f1-8a0c-f76a4fdac34e"
37-
value="{{ app.request.get('aggregateId') }}">
37+
value="{{ app.request.query.get('aggregateId') }}">
3838
</div>
3939
</div>
4040

templates/pagination.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<nav class="flex items-center justify-between border-t border-gray-200 px-4 sm:px-0">
55
<div class="-mt-px flex w-0 flex-1">
6-
<a href="{{ path(app.request.get('_route'), app.request.query|merge({'page': page - 1})) }}" class="inline-flex items-center border-t-2 border-transparent p-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">
6+
<a href="{{ path(app.request.attributes.get('_route'), app.request.query|merge({'page': page - 1})) }}" class="inline-flex items-center border-t-2 border-transparent p-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">
77
<svg class="mr-3 h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
88
<path fill-rule="evenodd" d="M18 10a.75.75 0 01-.75.75H4.66l2.1 1.95a.75.75 0 11-1.02 1.1l-3.5-3.25a.75.75 0 010-1.1l3.5-3.25a.75.75 0 111.02 1.1l-2.1 1.95h12.59A.75.75 0 0118 10z" clip-rule="evenodd" />
99
</svg>
@@ -14,7 +14,7 @@
1414
{% for p in 1..total %}
1515
{% if loop.first or loop.last or (p >= page - between and p <= page + between) %}
1616
<a
17-
href="{{ path(app.request.get('_route'), app.request.query|merge({'page': p})) }}"
17+
href="{{ path(app.request.attributes.get('_route'), app.request.query|merge({'page': p})) }}"
1818
class="{% if p == page %}border-indigo-500 text-indigo-600{% else %}border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300{% endif %} inline-flex items-center border-t-2 p-4 text-sm font-medium"
1919
>{{ p }}</a>
2020
{% endif %}
@@ -26,7 +26,7 @@
2626
</div>
2727

2828
<div class="-mt-px flex w-0 flex-1 justify-end">
29-
<a href="{{ path(app.request.get('_route'), app.request.query|merge({'page': page + 1})) }}" class="inline-flex items-center border-t-2 border-transparent p-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">
29+
<a href="{{ path(app.request.attributes.get('_route'), app.request.query|merge({'page': page + 1})) }}" class="inline-flex items-center border-t-2 border-transparent p-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">
3030
Next
3131
<svg class="ml-3 h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
3232
<path fill-rule="evenodd" d="M2 10a.75.75 0 01.75-.75h12.59l-2.1-1.95a.75.75 0 111.02-1.1l3.5 3.25a.75.75 0 010 1.1l-3.5 3.25a.75.75 0 11-1.02-1.1l2.1-1.95H2.75A.75.75 0 012 10z" clip-rule="evenodd" />

templates/store/show.html.twig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<input type="text" name="streamName" id="streamName"
2020
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
2121
placeholder="hotel-018d233e-7906-73f1-8a0c-f76a4fdac34e"
22-
value="{{ app.request.get('streamName') }}">
22+
value="{{ app.request.query.get('streamName') }}">
2323
</div>
2424
</div>
2525
<div class="w-96">
@@ -29,11 +29,11 @@
2929
<div class="mt-1">
3030
<select id="event" name="event"
3131
class="mt-1 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6">
32-
<option {% if app.request.get('event') == "" %}selected{% endif %} value="">
32+
<option {% if app.request.query.get('event') == "" %}selected{% endif %} value="">
3333
-- choose --
3434
</option>
3535
{% for event in events %}
36-
<option {% if app.request.get('event') == event %}selected{% endif %} value="{{ event }}">
36+
<option {% if app.request.query.get('event') == event %}selected{% endif %} value="{{ event }}">
3737
{{ event }}
3838
</option>
3939
{% endfor %}
@@ -45,11 +45,11 @@
4545
<label for="aggregate" class="block text-xs font-medium leading-6 text-gray-900">Aggregate</label>
4646
<select id="aggregate" name="aggregate"
4747
class="mt-1 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6">
48-
<option {% if app.request.get('aggregate') == "" %}selected{% endif %}
48+
<option {% if app.request.query.get('aggregate') == "" %}selected{% endif %}
4949
value="">-- choose --
5050
</option>
5151
{% for aggregate in aggregates %}
52-
<option {% if app.request.get('aggregate') == aggregate %}selected{% endif %}
52+
<option {% if app.request.query.get('aggregate') == aggregate %}selected{% endif %}
5353
value="{{ aggregate }}">{{ aggregate }}</option>
5454
{% endfor %}
5555
</select>
@@ -63,7 +63,7 @@
6363
<input type="text" name="aggregateId" id="aggregateId"
6464
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
6565
placeholder="018d233e-7906-73f1-8a0c-f76a4fdac34e"
66-
value="{{ app.request.get('aggregateId') }}">
66+
value="{{ app.request.query.get('aggregateId') }}">
6767
</div>
6868
</div>
6969
{% endif %}
@@ -73,7 +73,7 @@
7373
{{ heroicon('funnel', 'h-6 w-6') }}
7474
</button>
7575

76-
{% if app.request.get('streamName') or app.request.get('aggregate') or app.request.get('aggregateId') %}
76+
{% if app.request.query.get('streamName') or app.request.query.get('aggregate') or app.request.query.get('aggregateId') %}
7777
<a class="rounded-md bg-red-600 px-2.5 py-1.5 font-semibold text-white shadow-sm hover:bg-red-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600"
7878
href="{{ path('patchlevel_event_sourcing_admin_store_show') }}">
7979
{{ heroicon('backspace', 'h-6 w-6') }}

templates/subscription/show.html.twig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
<input type="text" name="search" id="search"
1717
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
1818
placeholder="Search..."
19-
value="{{ app.request.get('search') }}">
19+
value="{{ app.request.query.get('search') }}">
2020
</div>
2121
</div>
2222

2323
<div class="w-48">
2424
<label for="group" class="block text-xs font-medium leading-6 text-gray-900">Group</label>
2525
<select id="group" name="group"
2626
class="mt-1 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6">
27-
<option {% if app.request.get('group') == "" %}selected{% endif %}
27+
<option {% if app.request.query.get('group') == "" %}selected{% endif %}
2828
value="">-- choose --
2929
</option>
3030
{% for group in groups|default([]) %}
31-
<option {% if app.request.get('group') == group %}selected{% endif %}
31+
<option {% if app.request.query.get('group') == group %}selected{% endif %}
3232
value="{{ group }}">{{ group }}</option>
3333
{% endfor %}
3434
</select>
@@ -39,11 +39,11 @@
3939
<label for="mode" class="block text-xs font-medium leading-6 text-gray-900">Run mode</label>
4040
<select id="mode" name="mode"
4141
class="mt-1 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6">
42-
<option {% if app.request.get('mode') == "" %}selected{% endif %}
42+
<option {% if app.request.query.get('mode') == "" %}selected{% endif %}
4343
value="">-- choose --
4444
</option>
4545
{% for mode in modes|default([]) %}
46-
<option {% if app.request.get('mode') == mode %}selected{% endif %}
46+
<option {% if app.request.query.get('mode') == mode %}selected{% endif %}
4747
value="{{ mode }}">{{ mode|replace({'_': ' '}) }}</option>
4848
{% endfor %}
4949
</select>
@@ -54,11 +54,11 @@
5454
<label for="status" class="block text-xs font-medium leading-6 text-gray-900">Status</label>
5555
<select id="status" name="status"
5656
class="mt-1 block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6">
57-
<option {% if app.request.get('status') == "" %}selected{% endif %}
57+
<option {% if app.request.query.get('status') == "" %}selected{% endif %}
5858
value="">-- choose --
5959
</option>
6060
{% for status in statuses|default([]) %}
61-
<option {% if app.request.get('status') == status %}selected{% endif %}
61+
<option {% if app.request.query.get('status') == status %}selected{% endif %}
6262
value="{{ status }}">{{ status }}</option>
6363
{% endfor %}
6464
</select>
@@ -69,7 +69,7 @@
6969
{{ heroicon('funnel', 'h-6 w-6') }}
7070
</button>
7171

72-
{% if app.request.get('search') or app.request.get('group') or app.request.get('mode') or app.request.get('status') %}
72+
{% if app.request.query.get('search') or app.request.query.get('group') or app.request.query.get('mode') or app.request.query.get('status') %}
7373
<a class="rounded-md bg-red-600 px-2.5 py-1.5 font-semibold text-white shadow-sm hover:bg-red-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600"
7474
href="{{ path('patchlevel_event_sourcing_admin_subscription_show') }}">
7575
{{ heroicon('backspace', 'h-6 w-6') }}

0 commit comments

Comments
 (0)