|
1 | 1 | {include file='header' pageTitle='wcf.acp.menu.link.trophy.list'} |
2 | 2 |
|
3 | | -<script data-relocate="true"> |
4 | | - require(['WoltLabSuite/Core/Ui/Sortable/List'], function (UiSortableList) { |
5 | | - new UiSortableList({ |
6 | | - containerId: 'trophyList', |
7 | | - className: 'wcf\\data\\trophy\\TrophyAction', |
8 | | - offset: {@$startIndex} |
9 | | - }); |
10 | | - }); |
11 | | -</script> |
12 | | - |
13 | 3 | <header class="contentHeader"> |
14 | 4 | <div class="contentHeaderTitle"> |
15 | | - <h1 class="contentTitle">{lang}wcf.acp.menu.link.trophy.list{/lang}{if $items} <span class="badge badgeInverse">{#$items}</span>{/if}</h1> |
| 5 | + <h1 class="contentTitle">{lang}wcf.acp.menu.link.trophy.list{/lang} <span class="badge badgeInverse">{#$gridView->countRows()}</span></h1> |
16 | 6 | </div> |
17 | 7 |
|
18 | 8 | <nav class="contentHeaderNavigation"> |
19 | 9 | <ul> |
| 10 | + {if $gridView->countRows() > 1} |
| 11 | + <li> |
| 12 | + <button type="button" class="button jsChangeShowOrder">{icon name='up-down'} <span>{lang}wcf.global.changeShowOrder{/lang}</span></button> |
| 13 | + </li> |
| 14 | + {/if} |
20 | 15 | <li><a href="{link controller='TrophyAdd'}{/link}" class="button">{icon name='plus'} <span>{lang}wcf.acp.menu.link.trophy.add{/lang}</span></a></li> |
21 | 16 |
|
22 | 17 | {event name='contentHeaderNavigation'} |
23 | 18 | </ul> |
24 | 19 | </nav> |
25 | 20 | </header> |
26 | | -{hascontent} |
27 | | - <div class="paginationTop"> |
28 | | - {content} |
29 | | - {pages print=true assign=pagesLinks controller='TrophyList' link="pageNo=%d"} |
30 | | - {/content} |
31 | | - </div> |
32 | | -{/hascontent} |
33 | 21 |
|
34 | | -{if $objects|count} |
35 | | - <div class="section sortableListContainer" id="trophyList"> |
36 | | - <ol class="sortableList jsReloadPageWhenEmpty jsObjectActionContainer" data-object-action-class-name="wcf\data\trophy\TrophyAction" data-object-id="0" start="{@($pageNo - 1) * $itemsPerPage + 1}"> |
37 | | - {foreach from=$objects item='trophy'} |
38 | | - <li class="sortableNode sortableNoNesting trophyRow jsObjectActionObject" data-object-id="{@$trophy->getObjectID()}"> |
39 | | - <span class="sortableNodeLabel"> |
40 | | - {@$trophy->renderTrophy(32)} |
41 | | - <a href="{link controller='TrophyEdit' object=$trophy}{/link}">{$trophy->getTitle()}</a> |
42 | | - |
43 | | - <span class="statusDisplay sortableButtonContainer"> |
44 | | - <span class="sortableNodeHandle"> |
45 | | - {icon name='arrows-up-down-left-right'} |
46 | | - </span> |
47 | | - {objectAction action="toggle" isDisabled=$trophy->isDisabled} |
48 | | - <a href="{link controller='TrophyEdit' object=$trophy}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip">{icon name='pencil'}</a> |
49 | | - {objectAction action="delete" objectTitle=$trophy->getTitle()} |
50 | | - |
51 | | - {event name='itemButtons'} |
52 | | - </span> |
53 | | - </span> |
54 | | - </li> |
55 | | - {/foreach} |
56 | | - </ol> |
57 | | - </div> |
58 | | - |
59 | | - <div class="formSubmit"> |
60 | | - <button type="button" class="button buttonPrimary" data-type="submit">{lang}wcf.global.button.saveSorting{/lang}</button> |
61 | | - </div> |
62 | | - |
63 | | - <footer class="contentFooter"> |
64 | | - {hascontent} |
65 | | - <div class="paginationBottom"> |
66 | | - {content}{@$pagesLinks}{/content} |
67 | | - </div> |
68 | | - {/hascontent} |
| 22 | +<div class="section"> |
| 23 | + {unsafe:$gridView->render()} |
| 24 | +</div> |
69 | 25 |
|
70 | | - <nav class="contentFooterNavigation"> |
71 | | - <ul> |
72 | | - <li><a href="{link controller='TrophyAdd'}{/link}" class="button">{icon name='plus'} <span>{lang}wcf.acp.menu.link.trophy.add{/lang}</span></a></li> |
| 26 | +{if $gridView->countRows() > 1} |
| 27 | + <script data-relocate="true"> |
| 28 | + require(["WoltLabSuite/Core/Component/ChangeShowOrder"], ({ setup }) => { |
| 29 | + {jsphrase name='wcf.global.changeShowOrder'} |
73 | 30 |
|
74 | | - {event name='contentHeaderNavigation'} |
75 | | - </ul> |
76 | | - </nav> |
77 | | - </footer> |
78 | | -{else} |
79 | | - <woltlab-core-notice type="info">{lang}wcf.global.noItems{/lang}</woltlab-core-notice> |
| 31 | + setup( |
| 32 | + document.querySelector('.jsChangeShowOrder'), |
| 33 | + 'core/trophies/show-order', |
| 34 | + ); |
| 35 | + }); |
| 36 | + </script> |
80 | 37 | {/if} |
81 | 38 |
|
82 | 39 | {include file='footer'} |
0 commit comments