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