|
1 | 1 | {include file='header' pageTitle='wcf.acp.menu.link.faq.questions.list'} |
2 | 2 |
|
3 | | -<script data-relocate="true"> |
4 | | - require(['WoltLabSuite/Core/Ui/Sortable/List'], function (UiSortableList) { |
5 | | - new UiSortableList({ |
6 | | - containerId: 'questionList', |
7 | | - className: 'wcf\\data\\faq\\QuestionAction', |
8 | | - offset: {$startIndex} |
9 | | - }); |
10 | | - }); |
11 | | -</script> |
12 | | - |
13 | 3 | <header class="contentHeader"> |
14 | 4 | <div class="contentHeaderTitle"> |
15 | 5 | <h1 class="contentTitle">{lang}wcf.acp.menu.link.faq.questions.list{/lang}</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='FaqQuestionAdd'}{/link}" class="button">{icon name='plus' size=16} <span>{lang}wcf.acp.menu.link.faq.questions.add{/lang}</span></a></li> |
21 | 16 |
|
22 | 17 | {event name='contentHeaderNavigation'} |
23 | 18 | </ul> |
24 | 19 | </nav> |
25 | 20 | </header> |
26 | 21 |
|
27 | | -<form method="post" action="{link controller='FaqQuestionList'}{/link}"> |
28 | | - <section class="section"> |
29 | | - <h2 class="sectionTitle">{lang}wcf.global.filter{/lang}</h2> |
30 | | - |
31 | | - <div class="row rowColGap formGrid"> |
32 | | - <dl class="col-xs-12 col-md-4"> |
33 | | - <dt></dt> |
34 | | - <dd> |
35 | | - <select name="categoryID" id="categoryID"> |
36 | | - <option value="0">{lang}wcf.acp.faq.category{/lang}</option> |
37 | | - |
38 | | - {foreach from=$categoryNodeList item=category} |
39 | | - <option value="{$category->categoryID}"{if $category->categoryID == $categoryID} selected{/if}>{if $category->getDepth() > 1}{unsafe:" "|str_repeat:($category->getDepth() - 1)}{/if}{$category->getTitle()}</option> |
40 | | - {/foreach} |
41 | | - </select> |
42 | | - </dd> |
43 | | - </dl> |
44 | | - |
45 | | - <dl class="col-xs-12 col-md-4"> |
46 | | - <dt></dt> |
47 | | - <dd> |
48 | | - <input type="text" id="question" name="question" value="{$question}" placeholder="{lang}wcf.faq.question.question.title{/lang}" class="long"> |
49 | | - </dd> |
50 | | - </dl> |
51 | | - |
52 | | - <dl class="col-xs-12 col-md-4"> |
53 | | - <dt></dt> |
54 | | - <dd> |
55 | | - <input type="text" id="answer" name="answer" value="{$answer}" placeholder="{lang}wcf.faq.question.answer.title{/lang}" class="long"> |
56 | | - </dd> |
57 | | - </dl> |
58 | | - |
59 | | - {event name='filterFields'} |
60 | | - </div> |
61 | | - |
62 | | - <div class="formSubmit"> |
63 | | - <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s"> |
64 | | - {csrfToken} |
65 | | - </div> |
66 | | - </section> |
67 | | -</form> |
68 | | - |
69 | | -{hascontent} |
70 | | - <div class="paginationTop"> |
71 | | - {content} |
72 | | - {assign var='linkParameters' value=''} |
73 | | - {if $categoryID}{capture append=linkParameters}&categoryID={$categoryID}{/capture}{/if} |
74 | | - {if $question}{capture append=linkParameters}&question={unsafe:$question|rawurlencode}{/capture}{/if} |
75 | | - {if $answer}{capture append=linkParameters}&answer={unsafe:$answer|rawurlencode}{/capture}{/if} |
76 | | - |
77 | | - {pages print=true assign=pagesLinks controller="FaqQuestionList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$linkParameters"} |
78 | | - {/content} |
79 | | - </div> |
80 | | -{/hascontent} |
81 | | - |
82 | | -{if $objects|count} |
83 | | - <div class="section sortableListContainer" id="questionList"> |
84 | | - <ol class="sortableList jsObjectActionContainer jsReloadPageWhenEmpty" data-object-id="0" start="{($pageNo - 1) * $itemsPerPage + 1}" data-object-action-class-name="wcf\data\faq\QuestionAction"> |
85 | | - {foreach from=$objects item=question} |
86 | | - <li class="sortableNode sortableNoNesting jsQuestion jsObjectActionObject" data-object-id="{$question->questionID}"> |
87 | | - <span class="sortableNodeLabel"> |
88 | | - ({$question->getCategory()->getTitle()}) |
89 | | - <a href="{link controller='FaqQuestionEdit' object=$question}{/link}">{$question->getTitle()}</a> |
| 22 | +<div class="section"> |
| 23 | + {unsafe:$gridView->render()} |
| 24 | +</div> |
90 | 25 |
|
91 | | - <span class="statusDisplay sortableButtonContainer"> |
92 | | - {objectAction action="toggle" isDisabled=$question->isDisabled} |
93 | | - <a href="{link controller='FaqQuestionAdd' duplicateID=$question->questionID isMultilingual=$question->isMultilingual}{/link}" title="{lang}wcf.acp.faqQuestion.copy{/lang}" class="jsTooltip">{icon name='copy' size=16}</a> |
94 | | - <a href="{link controller='FaqQuestionEdit' object=$question}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip">{icon name='pencil' size=16}</a> |
95 | | - {objectAction action="delete" objectTitle=$question->getTitle()} |
96 | | - |
97 | | - {event name='itemButtons'} |
98 | | - </span> |
99 | | - </span> |
100 | | - </li> |
101 | | - {/foreach} |
102 | | - </ol> |
103 | | - </div> |
104 | | - |
105 | | - <div class="formSubmit"> |
106 | | - <button class="button buttonPrimary" data-type="submit">{lang}wcf.global.button.saveSorting{/lang}</button> |
107 | | - </div> |
| 26 | +<script data-relocate="true"> |
| 27 | + require(["WoltLabSuite/Core/Component/ChangeShowOrder"], ({ setup }) => { |
| 28 | + {jsphrase name='wcf.global.changeShowOrder'} |
108 | 29 |
|
109 | | - <footer class="contentFooter"> |
110 | | - {hascontent} |
111 | | - <div class="paginationBottom"> |
112 | | - {content}{unsafe:$pagesLinks}{/content} |
113 | | - </div> |
114 | | - {/hascontent} |
115 | | - |
116 | | - <nav class="contentFooterNavigation"> |
117 | | - <ul> |
118 | | - <li><a href="{link controller='FaqQuestionAdd'}{/link}" class="button">{icon name='plus' size=16} <span>{lang}wcf.acp.menu.link.faq.questions.add{/lang}</span></a></li> |
119 | | - |
120 | | - {event name='contentFooterNavigation'} |
121 | | - </ul> |
122 | | - </nav> |
123 | | - </footer> |
124 | | -{else} |
125 | | - <p class="info">{lang}wcf.global.noItems{/lang}</p> |
126 | | -{/if} |
| 30 | + setup( |
| 31 | + document.querySelector('.jsChangeShowOrder'), |
| 32 | + 'hanashi/questions/show-order', |
| 33 | + ); |
| 34 | + }); |
| 35 | +</script> |
127 | 36 |
|
128 | 37 | {include file='faqQuestionAddDialog'} |
129 | 38 |
|
|
0 commit comments