1 | {combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js' } |
---|
2 | {combine_script id='jquery.ui.sortable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.sortable.packed.js' } |
---|
3 | {footer_script require='jquery.ui.sortable'}{literal} |
---|
4 | jQuery(document).ready(function() { |
---|
5 | jQuery('ul.thumbnails').sortable( { |
---|
6 | revert: true, opacity: 0.7, |
---|
7 | handle: $('.rank-of-image').add('.rank-of-image img'), |
---|
8 | update: function() { |
---|
9 | $(this).find('li').each(function(i) { |
---|
10 | $(this).find("input[name^=rank_of_image]") |
---|
11 | .each(function() { $(this).attr('value', (i+1)*10)}); |
---|
12 | }); |
---|
13 | $('#image_order_rank').attr('checked', true); |
---|
14 | } |
---|
15 | }); |
---|
16 | }); |
---|
17 | {/literal}{/footer_script} |
---|
18 | |
---|
19 | <h2>{'Manage image ranks'|@translate}</h2> |
---|
20 | |
---|
21 | <h3>{$CATEGORIES_NAV}</h3> |
---|
22 | |
---|
23 | {if !empty($thumbnails)} |
---|
24 | <form action="{$F_ACTION}" method="post"> |
---|
25 | <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></p> |
---|
26 | <fieldset> |
---|
27 | <legend>{'Edit ranks'|@translate}</legend> |
---|
28 | {if !empty($thumbnails)} |
---|
29 | <ul class="thumbnails"> |
---|
30 | {foreach from=$thumbnails item=thumbnail} |
---|
31 | <li class="rank-of-image"> |
---|
32 | <div class="clipwrapper"> |
---|
33 | <div class="clip" style="clip:rect({$thumbnail.CLIP_TOP}px {$thumbnail.CLIP_RIGHT}px {$thumbnail.CLIP_BOTTOM}px {$thumbnail.CLIP_LEFT}px);top:-{$thumbnail.CLIP_TOP}px;left:-{$thumbnail.CLIP_LEFT}px"> |
---|
34 | <img src="{$thumbnail.TN_SRC}" class="thumbnail" alt=""> |
---|
35 | </div> |
---|
36 | </div> |
---|
37 | <input type="text" name="rank_of_image[{$thumbnail.ID}]" value="{$thumbnail.RANK}"> |
---|
38 | </li> |
---|
39 | {/foreach} |
---|
40 | </ul> |
---|
41 | {/if} |
---|
42 | </fieldset> |
---|
43 | |
---|
44 | <fieldset> |
---|
45 | <legend>{'Sort order'|@translate}</legend> |
---|
46 | <p class="field"> |
---|
47 | <input type="radio" name="image_order_choice" id="image_order_default" value="default"{if $image_order_choice=='default'} checked="checked"{/if}> |
---|
48 | <label for="image_order_default">{'Use the default image sort order (defined in the configuration file)'|@translate}</label> |
---|
49 | </p> |
---|
50 | <p class="field"> |
---|
51 | <input type="radio" name="image_order_choice" id="image_order_rank" value="rank"{if $image_order_choice=='rank'} checked="checked"{/if}> |
---|
52 | <label for="image_order_rank">{'By rank'|@translate}</label> |
---|
53 | </p> |
---|
54 | <p class="field"> |
---|
55 | <input type="radio" name="image_order_choice" id="image_order_user_define" value="user_define"{if $image_order_choice=='user_define'} checked="checked"{/if}> |
---|
56 | <label for="image_order_user_define">{'Manual order'|@translate}</label> |
---|
57 | {foreach from=$image_orders item=order} |
---|
58 | <p class="field"> |
---|
59 | <select name="order_field_{$order.ID}"> |
---|
60 | {html_options options=$image_order_field_options selected=$order.FIELD } |
---|
61 | </select> |
---|
62 | <select name="order_direction_{$order.ID}"> |
---|
63 | {html_options options=$image_order_direction_options selected=$order.DIRECTION } |
---|
64 | </select> |
---|
65 | </p> |
---|
66 | {/foreach} |
---|
67 | </fieldset> |
---|
68 | <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></p> |
---|
69 | </form> |
---|
70 | |
---|
71 | |
---|
72 | {else} |
---|
73 | <div class="infos"><p>{'No element in this album'|@translate}</p></div> |
---|
74 | {/if} |
---|