|
| 1 | +<div class="gridView"> |
| 2 | + {if $view->isFilterable()} |
| 3 | + <div class="gridView__filterBar"> |
| 4 | + <div class="gridView__filters" id="{$view->getID()}_filters"> |
| 5 | + {foreach from=$view->getActiveFilters() item='value' key='key'} |
| 6 | + <button type="button" class="button small" data-filter="{$key}" data-filter-value="{$value}"> |
| 7 | + {icon name='circle-xmark'} |
| 8 | + {$view->getFilterLabel($key)} |
| 9 | + </button> |
| 10 | + {/foreach} |
| 11 | + </div> |
| 12 | + <div class="gridView__filterButton"> |
| 13 | + <button type="button" class="button small" id="{$view->getID()}_filterButton" data-endpoint="{$view->getFilterActionEndpoint()}"> |
| 14 | + {icon name='filter'} |
| 15 | + {lang}wcf.global.filter{/lang} |
| 16 | + </button> |
| 17 | + </div> |
| 18 | + </div> |
| 19 | + {/if} |
| 20 | + |
| 21 | + <div class="gridView__tableContainer"> |
| 22 | + <table class="gridView__table" id="{$view->getID()}_table"{if !$view->countRows()} hidden{/if}> |
| 23 | + <thead> |
| 24 | + <tr class="gridView__headerRow"> |
| 25 | + {if $view->hasBulkInteractions()} |
| 26 | + <th class="gridView__headerColumn gridView__selectColumn"> |
| 27 | + <input type="checkbox" class="gridView__selectAllRows" aria-label="{lang}wcf.clipboard.item.markAll{/lang}"> |
| 28 | + </th> |
| 29 | + {/if} |
| 30 | + {foreach from=$view->getVisibleColumns() item='column'} |
| 31 | + <th |
| 32 | + class="gridView__headerColumn {$column->getClasses()}" |
| 33 | + data-id="{$column->getID()}" |
| 34 | + data-sortable="{$column->isSortable()}" |
| 35 | + > |
| 36 | + {if $column->isSortable()} |
| 37 | + <button type="button" class="gridView__headerColumn__button"> |
| 38 | + {unsafe:$column->getLabel()} |
| 39 | + </button> |
| 40 | + {else} |
| 41 | + {unsafe:$column->getLabel()} |
| 42 | + {/if} |
| 43 | + </th> |
| 44 | + {/foreach} |
| 45 | + {if $view->hasInteractions()} |
| 46 | + <th class="gridView__headerColumn gridView__actionColumn"></th> |
| 47 | + {/if} |
| 48 | + </td> |
| 49 | + </thead> |
| 50 | + <tbody> |
| 51 | + {unsafe:$view->renderRows()} |
| 52 | + </tbody> |
| 53 | + </table> |
| 54 | + </div> |
| 55 | + |
| 56 | + <div class="gridView__pagination"> |
| 57 | + <woltlab-core-pagination id="{$view->getID()}_pagination" page="{$view->getPageNo()}" count="{$view->countPages()}"></woltlab-core-pagination> |
| 58 | + </div> |
| 59 | + |
| 60 | + {if $view->hasBulkInteractions()} |
| 61 | + <div id="{$view->getID()}_selectionBar" class="gridView__selectionBar dropdown" hidden> |
| 62 | + <button type="button" id="{$view->getID()}_bulkInteractionButton" class="button gridView__bulkInteractionButton dropdownToggle"></button> |
| 63 | + <ul class="dropdownMenu"> |
| 64 | + <li class="disabled"><span>{lang}wcf.global.loading{/lang}</span></li> |
| 65 | + <li class="dropdownDivider"></li> |
| 66 | + <li> |
| 67 | + <button type="button" id="{$view->getID()}_resetSelectionButton">{lang}wcf.clipboard.item.unmarkAll{/lang}</button> |
| 68 | + </li> |
| 69 | + </ul> |
| 70 | + </div> |
| 71 | + {/if} |
| 72 | + |
| 73 | + <woltlab-core-notice type="info" id="{$view->getID()}_noItemsNotice"{if $view->countRows()} hidden{/if}>{lang}wcf.global.noItems{/lang}</woltlab-core-notice> |
| 74 | +</div> |
| 75 | + |
| 76 | +<script data-relocate="true"> |
| 77 | + require(['WoltLabSuite/Core/Component/GridView'], ({ GridView }) => { |
| 78 | + WoltLabLanguage.registerPhrase("wcf.clipboard.button.numberOfSelectedItems", '{jslang __literal=true}wcf.clipboard.button.numberOfSelectedItems{/jslang}'); |
| 79 | + |
| 80 | + new GridView( |
| 81 | + '{unsafe:$view->getID()|encodeJs}', |
| 82 | + '{unsafe:$view->getClassName()|encodeJS}', |
| 83 | + {$view->getPageNo()}, |
| 84 | + '{unsafe:$view->getBaseUrl()|encodeJS}', |
| 85 | + '{unsafe:$view->getSortField()|encodeJS}', |
| 86 | + '{unsafe:$view->getSortOrder()|encodeJS}', |
| 87 | + '{unsafe:$view->getBulkInteractionProviderClassName()|encodeJS}', |
| 88 | + new Map([ |
| 89 | + {foreach from=$view->getParameters() key='name' item='value'} |
| 90 | + ['{unsafe:$name|encodeJs}', '{unsafe:$value|encodeJs}'], |
| 91 | + {/foreach} |
| 92 | + ]), |
| 93 | + ); |
| 94 | + }); |
| 95 | +</script> |
| 96 | +{if $view->hasInteractions()} |
| 97 | + {unsafe:$view->renderInteractionInitialization()} |
| 98 | +{/if} |
| 99 | +{if $view->hasBulkInteractions()} |
| 100 | + {unsafe:$view->renderBulkInteractionInitialization()} |
| 101 | +{/if} |
0 commit comments