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