| | |
| | | protected function renderContent(): void { |
| | | $dataIgnore = $this->useCRUDjs ? '' : ' data-ignore'; |
| | | ?> |
| | | <section class="items-list <?= esc_attr($this->dataType) ?> crud" data-content="<?= esc_attr($this->dataType) ?>" data-view="<?= $this->defaultView?>"<?=$dataIgnore?>> |
| | | <?php |
| | | $this->renderControlsAndFilters(); |
| | | <section class="items-list <?= esc_attr($this->dataType) ?> crud" data-content="<?= esc_attr($this->dataType) ?>" data-singular="<?=$this->singular?>" data-plural="<?=$this->plural?>" data-view="<?= $this->defaultView?>"<?=$dataIgnore?>> |
| | | <div class="wrap"> |
| | | <?php |
| | | $this->renderControlsAndFilters(); |
| | | |
| | | if ($this->showBulkControls) { |
| | | $this->renderBulkActions(); |
| | | } |
| | | ?> |
| | | if ($this->showBulkControls) { |
| | | $this->renderBulkActions(); |
| | | } |
| | | ?> |
| | | |
| | | <div class="<?= esc_attr($this->dataType) ?> item-grid" role="grid"></div> |
| | | <div class="scroll-sentinel" aria-hidden="true"></div> |
| | | <div class="<?= esc_attr($this->dataType) ?> item-grid" role="grid"></div> |
| | | <div class="scroll-sentinel" aria-hidden="true"></div> |
| | | </div> |
| | | </section> |
| | | <?php |
| | | } |
| | |
| | | } |
| | | ?> |
| | | <details class="all-filters col start" data-ignore> |
| | | <summary>Filters</summary> |
| | | <summary>Filters <button hidden data-action="clear-filters" data-ignore><?=jvbIcon('x')?><span>Clear Filters</span></span></button></summary> |
| | | <?php |
| | | |
| | | $this->renderSearch(); |
| | |
| | | $this->renderColumnSelector(); |
| | | } |
| | | ?> |
| | | <button data-action="refresh" data-ignore><?=jvbIcon('arrows-clockwise')?><span>Hard Refresh</span></span></button> |
| | | </details> |
| | | <?php |
| | | } |
| | |
| | | $i = 0; |
| | | foreach ($option as $opt => $label) { |
| | | $icon = $opt === 'date' ? 'calendar' : $opt; |
| | | $value = $opt; |
| | | $value = ($value === 'sort-ascending') ? 'asc' : $value; |
| | | $value = ($value === 'sort-descending') ? 'desc' : $value; |
| | | ?> |
| | | <input id="<?=$opt?>" class="btn" type="radio" name="<?=$o?>" data-filter="<?=$o?>" value="<?=$opt?>"<?=$i===0 ? ' checked':''?>> |
| | | <input id="<?=$opt?>" class="btn" type="radio" name="<?=$o?>" data-filter="<?=$o?>" value="<?=$value?>"<?=$i===0 ? ' checked':''?>> |
| | | |
| | | <label for="<?=$opt?>" title="<?=$label?>"><?=jvbDashIcon($icon)?></label> |
| | | <?php |
| | |
| | | <label for="date-start" class="col"> |
| | | From |
| | | </label> |
| | | <input type="date" id="date-start" class="date-start"> |
| | | <input type="date" id="date-start" class="date-start" name="date-start"> |
| | | <label for="date-end" class="col"> |
| | | To |
| | | </label> |
| | | <input type="date" id="date-end" class="date-end"> |
| | | <input type="date" id="date-end" class="date-end" name="date-end"> |
| | | </div> |
| | | <div class="month-picker"> |
| | | <label> |
| | |
| | | $out = ''; |
| | | if (!empty($terms)) { |
| | | $out .= sprintf( |
| | | '<div class="row nowrap"><label for="filter-%s">%s<span class="screen-reader-text">Filter by %s</span></label> |
| | | '<div class="row nowrap"><label class="m-0" for="filter-%s">%s<span class="screen-reader-text">Filter by %s</span></label> |
| | | <select id="filter-%s" class="filter %s" name="%s" data-filter="taxonomies" data-taxonomy="%s"> |
| | | <option value="">by %s</option>', |
| | | $taxonomy, |
| | |
| | | } |
| | | foreach ($this->taxonomies as $taxonomy => $config) { |
| | | ?> |
| | | <option value="tax-<?=$taxonomy?>">Add to <?= JVB_TAXONOMY[$taxonomy]['singular']??$config['label'] ?></option> |
| | | <option value="tax-<?=$taxonomy?>" data-type="selector" data-single="<?=JVB_TAXONOMY[$taxonomy]['singular']?>" data-plural="<?=JVB_TAXONOMY[$taxonomy]['plural']?>" data-taxonomy="<?=$taxonomy?>">Add to <?= JVB_TAXONOMY[$taxonomy]['singular']??$config['label'] ?></option> |
| | | <?php |
| | | } |
| | | ?> |
| | |
| | | <?= $this->renderItemSelect()?> |
| | | <?=$this->renderImage() ?> |
| | | <div class="col start w-full"> |
| | | <?= $this->renderItemActions()?> |
| | | <h3 data-field="post_title"></h3> |
| | | <p data-attr="date"></p> |
| | | <p data-field="price"></p> |
| | | <div data-field="post_excerpt"></div> |
| | | <?= $this->renderItemActions()?> |
| | | </div> |
| | | </div> |
| | | </template> |