| 1 | {footer_script require='jquery.ui.sortable'}{literal} |
|---|
| 2 | jQuery(document).ready(function() { |
|---|
| 3 | function checkOrderOptions() { |
|---|
| 4 | jQuery("#image_order_user_define_options").hide(); |
|---|
| 5 | if (jQuery("input[name=image_order_choice]:checked").val() == "user_define") { |
|---|
| 6 | jQuery("#image_order_user_define_options").show(); |
|---|
| 7 | } |
|---|
| 8 | } |
|---|
| 9 | |
|---|
| 10 | jQuery('ul.thumbnails').sortable( { |
|---|
| 11 | revert: true, opacity: 0.7, |
|---|
| 12 | handle: jQuery('.rank-of-image').add('.rank-of-image img'), |
|---|
| 13 | update: function() { |
|---|
| 14 | jQuery(this).find('li').each(function(i) { |
|---|
| 15 | jQuery(this).find("input[name^=rank_of_image]").each(function() { |
|---|
| 16 | jQuery(this).attr('value', (i+1)*10) |
|---|
| 17 | }); |
|---|
| 18 | }); |
|---|
| 19 | |
|---|
| 20 | jQuery('#image_order_rank').attr('checked', true); |
|---|
| 21 | checkOrderOptions(); |
|---|
| 22 | } |
|---|
| 23 | }); |
|---|
| 24 | |
|---|
| 25 | jQuery("input[name=image_order_choice]").click(function () { |
|---|
| 26 | checkOrderOptions(); |
|---|
| 27 | }); |
|---|
| 28 | |
|---|
| 29 | checkOrderOptions(); |
|---|
| 30 | }); |
|---|
| 31 | {/literal}{/footer_script} |
|---|
| 32 | |
|---|
| 33 | <h2>{'Manage photo ranks'|@translate}</h2> |
|---|
| 34 | |
|---|
| 35 | <h3>{$CATEGORIES_NAV}</h3> |
|---|
| 36 | |
|---|
| 37 | <form action="{$F_ACTION}" method="post"> |
|---|
| 38 | {if !empty($thumbnails)} |
|---|
| 39 | <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit"></p> |
|---|
| 40 | <fieldset> |
|---|
| 41 | <legend>{'Manual order'|@translate}</legend> |
|---|
| 42 | {if !empty($thumbnails)} |
|---|
| 43 | <p>{'Drag to re-order'|@translate}</p> |
|---|
| 44 | <ul class="thumbnails"> |
|---|
| 45 | {foreach from=$thumbnails item=thumbnail} |
|---|
| 46 | <li class="rank-of-image" style="width:{$thumbnail.CLIPING_li}px; height:{$thumbnail.CLIPING_li}px; "> |
|---|
| 47 | <div class="clipwrapper" style="width:{$thumbnail.CLIPING}px; height:{$thumbnail.CLIPING}px; "> |
|---|
| 48 | <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"> |
|---|
| 49 | <img src="{$thumbnail.TN_SRC}" class="thumbnail" alt=""> |
|---|
| 50 | </div> |
|---|
| 51 | </div> |
|---|
| 52 | <input type="text" name="rank_of_image[{$thumbnail.ID}]" value="{$thumbnail.RANK}" style="display:none"> |
|---|
| 53 | </li> |
|---|
| 54 | {/foreach} |
|---|
| 55 | </ul> |
|---|
| 56 | {/if} |
|---|
| 57 | </fieldset> |
|---|
| 58 | {/if} |
|---|
| 59 | |
|---|
| 60 | <fieldset> |
|---|
| 61 | <legend>{'Sort order'|@translate}</legend> |
|---|
| 62 | <p class="field"> |
|---|
| 63 | <input type="radio" name="image_order_choice" id="image_order_default" value="default"{if $image_order_choice=='default'} checked="checked"{/if}> |
|---|
| 64 | <label for="image_order_default">{'Use the default photo sort order (defined in the configuration file)'|@translate}</label> |
|---|
| 65 | </p> |
|---|
| 66 | <p class="field"> |
|---|
| 67 | <input type="radio" name="image_order_choice" id="image_order_rank" value="rank"{if $image_order_choice=='rank'} checked="checked"{/if}> |
|---|
| 68 | <label for="image_order_rank">{'manual order'|@translate}</label> |
|---|
| 69 | </p> |
|---|
| 70 | <p class="field"> |
|---|
| 71 | <input type="radio" name="image_order_choice" id="image_order_user_define" value="user_define"{if $image_order_choice=='user_define'} checked="checked"{/if}> |
|---|
| 72 | <label for="image_order_user_define">{'automatic order'|@translate}</label> |
|---|
| 73 | <div id="image_order_user_define_options"> |
|---|
| 74 | {foreach from=$image_orders item=order} |
|---|
| 75 | <p class="field"> |
|---|
| 76 | <select name="order_field_{$order.ID}"> |
|---|
| 77 | {html_options options=$image_order_field_options selected=$order.FIELD } |
|---|
| 78 | </select> |
|---|
| 79 | <select name="order_direction_{$order.ID}"> |
|---|
| 80 | {html_options options=$image_order_direction_options selected=$order.DIRECTION } |
|---|
| 81 | </select> |
|---|
| 82 | </p> |
|---|
| 83 | {/foreach} |
|---|
| 84 | </div> |
|---|
| 85 | </fieldset> |
|---|
| 86 | <p> |
|---|
| 87 | <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit"> |
|---|
| 88 | |
|---|
| 89 | <label> |
|---|
| 90 | <input type="checkbox" name="image_order_subcats" id="image_order_subcats"> |
|---|
| 91 | {'Apply to sub-albums'|@translate} |
|---|
| 92 | </label> |
|---|
| 93 | </p> |
|---|
| 94 | </form> |
|---|