| 1 |
<?php if (empty($data['segments'])) { ?> |
| 2 |
<h1 class="cell acym__listing__empty__search__title text-center"><?php echo acym_translation('ACYM_NO_RESULTS_FOUND'); ?></h1> |
| 3 |
<?php } else { ?> |
| 4 |
<div class="cell grid-x margin-top-1"> |
| 5 |
<div class="grid-x acym__listing__actions cell margin-bottom-1"> |
| 6 |
<?php |
| 7 |
$actions = [ |
| 8 |
'setActive' => acym_translation('ACYM_ENABLE'), |
| 9 |
'setInactive' => acym_translation('ACYM_DISABLE'), |
| 10 |
'duplicate' => acym_translation('ACYM_DUPLICATE'), |
| 11 |
'delete' => acym_translation('ACYM_DELETE'), |
| 12 |
]; |
| 13 |
echo acym_listingActions($actions); |
| 14 |
?> |
| 15 |
</div> |
| 16 |
<div class="cell grid-x align-justify"> |
| 17 |
<div class="cell grid-x large-shrink acym_vcenter"> |
| 18 |
<?php |
| 19 |
$options = [ |
| 20 |
'' => ['ACYM_ALL', $data['segmentsNumberPerStatus']['all']], |
| 21 |
'active' => ['ACYM_ACTIVE', $data['segmentsNumberPerStatus']['active']], |
| 22 |
'inactive' => ['ACYM_INACTIVE', $data['segmentsNumberPerStatus']['inactive']], |
| 23 |
]; |
| 24 |
echo acym_filterStatus($options, $data['status'], 'segments_status'); |
| 25 |
?> |
| 26 |
</div> |
| 27 |
<div class="cell large-shrink acym_listing_sort-by"> |
| 28 |
<?php echo acym_sortBy( |
| 29 |
[ |
| 30 |
'id' => acym_strtolower(acym_translation('ACYM_ID')), |
| 31 |
'name' => acym_translation('ACYM_NAME'), |
| 32 |
'active' => acym_translation('ACYM_ACTIVE'), |
| 33 |
], |
| 34 |
'segments', |
| 35 |
$data['ordering'], |
| 36 |
'asc' |
| 37 |
); ?> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
<div class="grid-x acym__listing"> |
| 42 |
<div class="grid-x cell acym__listing__header"> |
| 43 |
<div class="medium-shrink small-1 cell"> |
| 44 |
<input id="checkbox_all" type="checkbox" name="checkbox_all"> |
| 45 |
</div> |
| 46 |
<div class="grid-x medium-auto small-11 cell acym__listing__header__title__container"> |
| 47 |
<div class="large-4 medium-4 cell acym__listing__header__title"> |
| 48 |
<?php echo acym_translation('ACYM_NAME'); ?> |
| 49 |
</div> |
| 50 |
<div class="auto hide-for-small-only cell acym__listing__header__title"> |
| 51 |
<?php echo acym_translation('ACYM_DATE_CREATED'); ?> |
| 52 |
</div> |
| 53 |
<div class="large-1 medium-1 text-center hide-for-small-only cell acym__listing__header__title"> |
| 54 |
<?php echo acym_translation('ACYM_ACTIVE'); ?> |
| 55 |
</div> |
| 56 |
<div class="large-1 medium-1 text-center hide-for-small-only cell acym__listing__header__title"> |
| 57 |
<?php echo acym_translation('ACYM_ID'); ?> |
| 58 |
</div> |
| 59 |
</div> |
| 60 |
</div> |
| 61 |
<?php foreach ($data['segments'] as $segment) { ?> |
| 62 |
<div data-acy-elementid="<?php echo acym_escape($segment->id); ?>" class="grid-x cell align-middle acym__listing__row"> |
| 63 |
<div class="medium-shrink small-1 cell"> |
| 64 |
<input id="checkbox_<?php echo acym_escape($segment->id); ?>" type="checkbox" name="elements_checked[]" value="<?php echo acym_escape($segment->id); ?>"> |
| 65 |
</div> |
| 66 |
<div class="grid-x medium-auto small-11 cell acym__listing__title__container"> |
| 67 |
<div class="grid-x large-4 medium-4 small-11 cell acym__listing__title"> |
| 68 |
<a class="cell" href="<?php echo acym_completeLink('segments&task=edit&segmentId='.intval($segment->id)); ?>"> |
| 69 |
<h6 class="acym__listing__title__important"><?php echo acym_escape($segment->name); ?></h6> |
| 70 |
</a> |
| 71 |
</div> |
| 72 |
<div class="cell auto hide-for-small-only"> |
| 73 |
<?php |
| 74 |
echo acym_tooltip( |
| 75 |
[ |
| 76 |
'hoveredText' => acym_date( |
| 77 |
$segment->creation_date, |
| 78 |
acym_getDateTimeFormat('ACYM_DATE_FORMAT_LC5'), |
| 79 |
false |
| 80 |
), |
| 81 |
'textShownInTooltip' => $segment->creation_date, |
| 82 |
] |
| 83 |
); |
| 84 |
?> |
| 85 |
</div> |
| 86 |
<div class="cell small-1 acym__listing__controls text-center"> |
| 87 |
<?php |
| 88 |
$class = $segment->active == 1 ? 'acymicon-check-circle acym__color__green" data-acy-newvalue="0' |
| 89 |
: 'acymicon-times-circle acym__color__red" data-acy-newvalue="1'; |
| 90 |
echo '<i data-acy-table="segment" data-acy-field="active" data-acy-elementid="'.acym_escape($segment->id).'" class="acym_toggleable '.$class.'"></i>'; |
| 91 |
?> |
| 92 |
</div> |
| 93 |
<div class="cell medium-1 hide-for-small-only text-center"> |
| 94 |
<?php echo acym_escape($segment->id); ?> |
| 95 |
</div> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
<?php } ?> |
| 99 |
<?php echo $data['pagination']->display('segments'); ?> |
| 100 |
</div> |
| 101 |
<?php } ?> |
| 102 |
|