File tree Expand file tree Collapse file tree
templates/dashboard/packages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,10 +43,8 @@ public function list(Request $request): Response
4343 }
4444
4545 $ paginator = PackagePaginator::fromRequest ($ request , $ queryBuilder , $ this ->container ->get ('router ' ));
46- $ packages = $ paginator ->getResults ();
4746
4847 return $ this ->render ('dashboard/packages/list.html.twig ' , [
49- 'packages ' => $ packages ,
5048 'paginator ' => $ paginator ,
5149 ]);
5250 }
Original file line number Diff line number Diff line change 1+ {% set packages = packages ?? paginator .results %}
2+
3+ <div class =" d-grid gap-3" >
4+ {% for package in packages %}
5+ <div class =" card" >
6+ <div class =" card-body py-2" >
7+ {% set packageInfoUrl = path(' dashboard_packages_info' , {packageName : package .name }) %}
8+ <a href =" {{ packageInfoUrl }}" ><h5 class =" card-title" >{{ package .name }}</h5 ></a >
9+ {% if package .mirrorRegistry %}
10+ <p class =" card-text mb-1 text-body-secondary" >Mirrored from {{ package .mirrorRegistry .name }}</p >
11+ {% endif %}
12+ <p class =" card-text" >{{ package .description ?? ' <em>No description provided.</em>' }}</p >
13+ </div >
14+ </div >
15+ {% else %}
16+ <table class =" table datagrid datagrid-empty" >
17+ <tbody >
18+ {% for i in 1 .. 14 %}
19+ <tr class =" empty-row" >
20+ <td ><span ></span ></td >
21+ <td ><span ></span ></td >
22+ <td ><span ></span ></td >
23+ <td ><span ></span ></td >
24+ <td ><span ></span ></td >
25+ <td ><span ></span ></td >
26+ </tr >
27+
28+ {% if 3 == loop .index %}
29+ <tr class =" no-results" >
30+ <td colspan =" 100" >
31+ {{ t(' datagrid.no_results' , ea .i18n .translationParameters , ' EasyAdminBundle' )| trans }}
32+ </td >
33+ </tr >
34+ {% endif %}
35+ {% endfor %}
36+ </tbody >
37+ </table >
38+ {% endfor %}
39+ </div >
40+
41+ {% if packages | length or paginator .currentPage > 1 %}
42+ <div class =" content-panel-footer without-padding without-border" >
43+ {% block paginator %}
44+ {{ include (ea.templatePath (' crud/paginator' )) }}
45+ {% endblock paginator %}
46+ </div >
47+ {% endif %}
Original file line number Diff line number Diff line change 2525{% endblock %}
2626
2727{% block page_content %}
28- <div class =" d-grid gap-3" >
29- {% for package in packages %}
30- <div class =" card" >
31- <div class =" card-body py-2" >
32- {% set packageInfoUrl = path(' dashboard_packages_info' , {packageName : package .name }) %}
33- <a href =" {{ packageInfoUrl }}" ><h5 class =" card-title" >{{ package .name }}</h5 ></a >
34- {% if package .mirrorRegistry %}
35- <p class =" card-text mb-1 text-body-secondary" >Mirrored from {{ package .mirrorRegistry .name }}</p >
36- {% endif %}
37- <p class =" card-text" >{{ package .description ?? ' <em>No description provided.</em>' }}</p >
38- </div >
39- </div >
40- {% else %}
41- <table class =" table datagrid datagrid-empty" >
42- <tbody >
43- {% for i in 1 .. 14 %}
44- <tr class =" empty-row" >
45- <td ><span ></span ></td >
46- <td ><span ></span ></td >
47- <td ><span ></span ></td >
48- <td ><span ></span ></td >
49- <td ><span ></span ></td >
50- <td ><span ></span ></td >
51- </tr >
52-
53- {% if 3 == loop .index %}
54- <tr class =" no-results" >
55- <td colspan =" 100" >
56- {{ t(' datagrid.no_results' , ea .i18n .translationParameters , ' EasyAdminBundle' )| trans }}
57- </td >
58- </tr >
59- {% endif %}
60- {% endfor %}
61- </tbody >
62- </table >
63- {% endfor %}
64- </div >
65-
66- {% if packages | length %}
67- <div class =" content-panel-footer without-padding without-border" >
68- {% block paginator %}
69- {{ include (ea.templatePath (' crud/paginator' )) }}
70- {% endblock paginator %}
71- </div >
72- {% endif %}
28+ {{ include (' dashboard/packages/_package_list.html.twig' , {paginator : paginator }, with_context : false ) }}
7329{% endblock %}
You can’t perform that action at this time.
0 commit comments