| | |
| | | <?php |
| | | |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\Form; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; // Exit if accessed directly |
| | | } |
| | | if (!isOurPeople()) { |
| | | wp_redirect(get_home_url(2, '/dash')); |
| | | wp_redirect(get_home_url(null, '/dash')); |
| | | exit; |
| | | } |
| | | $cache = new JVBase\managers\CacheManager('news', 3600); |
| | | $cache = Cache::for('news', 3600); |
| | | $check = $cache->get('type-options'); |
| | | |
| | | if ($check) { |
| | |
| | | foreach ($terms as $term) { |
| | | $typeOptions[] = [ |
| | | 'id' => $term->term_id, |
| | | 'name' => $term->name, |
| | | 'name' => html_entity_decode($term->name), |
| | | 'count' => $term->count, |
| | | ]; |
| | | } |
| | |
| | | <!-- Tab navigation --> |
| | | <div class="tabs" role="tablist"> |
| | | <button type="button" class="tab active" data-tab="news" role="tab" aria-selected="true"> |
| | | <h2><?= jvbIcon('news')?>News</h2> |
| | | <h2><?= jvbIcon('newspaper')?>News</h2> |
| | | </button> |
| | | <button type="button" class="tab" data-tab="mine" role="tab" aria-selected="false"> |
| | | <h2>Yours</h2> |
| | |
| | | </button> |
| | | |
| | | <button type="button" class="add-item-btn"> |
| | | <?= jvbIcon('add', ['title' =>'Add News']) ?> |
| | | <?= jvbIcon('plus-square', ['title' =>'Add News']) ?> |
| | | <span>Post</span> |
| | | </button> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <details class="type-filters"> |
| | | <summary class="row btw">Filters: |
| | | <summary class="row x-btw">Filters: |
| | | <button class="clear-filters row"> |
| | | <?= jvbIcon('close', ['title' => 'Clear Filters'])?> |
| | | <?= jvbIcon('x', ['title' => 'Clear Filters'])?> |
| | | <span>Clear Filters</span> |
| | | </span> |
| | | </button> |
| | |
| | | |
| | | <input type="radio" id="order-karma" class="btn" name="orderby" value="karma"> |
| | | <label for="order-karma" title="Order by Standing" class="row"> |
| | | <?= jvbIcon('karma') ?> |
| | | <?= jvbIcon('scales') ?> |
| | | <span class="label">Standing</span> |
| | | </label> |
| | | |
| | | <input type="radio" id="order-random" class="btn" name="orderby" value="random"> |
| | | <label for="order-random" title="Random Order" class="row"> |
| | | <?= jvbIcon('random') ?> |
| | | <?= jvbIcon('shuffle') ?> |
| | | <span class="label">Random</span> |
| | | </label> |
| | | </div> |
| | |
| | | <div class="order-direction radio-group-label" data-for-order="date,title,karma"> |
| | | <input type="radio" id="order-desc" class="btn" name="order" value="DESC" checked> |
| | | <label for="order-desc" title="Newest First" class="row"> |
| | | <?= jvbIcon('desc') ?> |
| | | <?= jvbIcon('sort-descending') ?> |
| | | </label> |
| | | |
| | | <input type="radio" id="order-asc" class="btn" name="order" value="ASC"> |
| | | <label for="order-asc" title="Oldest First" class="row"> |
| | | <?= jvbIcon('asc') ?> |
| | | <?= jvbIcon('sort-ascending') ?> |
| | | </label> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <?php |
| | | $handler = JVB()->getContent('news'); |
| | | $meta = new JVBase\meta\MetaManager(); |
| | | |
| | | foreach ($handler->getFields() as $field_name => $field_config) { |
| | | $meta->render('form', $field_name, $field_config); |
| | | echo Form::render($field_name, null, $field_config); |
| | | } |
| | | ?> |
| | | |
| | |
| | | </dialog> |
| | | <template class="template-own"> |
| | | <details class="news item" data-keyboard-nav="true" tabindex="0"> |
| | | <summary class="row btw"> |
| | | <summary class="row x-btw"> |
| | | <div class="item-select"> |
| | | <input type="checkbox" class="select-checkbox"> |
| | | <label> |
| | |
| | | </div> |
| | | <div class="item-actions"> |
| | | <button type="button" class="action" data-action="edit" title="Edit tattoo"> |
| | | <?= jvbIcon('edit') ?> |
| | | <?= jvbIcon('pencil-simple') ?> |
| | | <span class="screen-reader-text">Edit news item</span> |
| | | </button> |
| | | <button type="button" class="action" data-action="trash" title="Scrap tattoo"> |
| | | <?= jvbIcon('delete') ?> |
| | | <?= jvbIcon('trash') ?> |
| | | <span class="screen-reader-text">Scrap news item</span> |
| | | </button> |
| | | <button type="button" class="action" data-action="toggle-status"> |
| | |
| | | </template> |
| | | <template class="template-all template-watching"> |
| | | <details class="news item" data-keyboard-nav="true" tabindex="0"> |
| | | <summary class="row btw"> |
| | | <summary class="row x-btw"> |
| | | <button class="favourite-button" data-type="news" title="Add to watch list" onclick="toggleFavourite(this)"> |
| | | |
| | | </button> |