[7995] | 1 | {footer_script require='jquery.ui.sortable'}{literal} |
---|
| 2 | jQuery(document).ready(function() { |
---|
[9039] | 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, |
---|
[9586] | 12 | handle: jQuery('.rank-of-image').add('.rank-of-image img'), |
---|
[9039] | 13 | update: function() { |
---|
[9586] | 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) |
---|
[9039] | 17 | }); |
---|
| 18 | }); |
---|
| 19 | |
---|
[22579] | 20 | jQuery('#image_order_rank').prop('checked', true); |
---|
[9039] | 21 | checkOrderOptions(); |
---|
| 22 | } |
---|
| 23 | }); |
---|
| 24 | |
---|
| 25 | jQuery("input[name=image_order_choice]").click(function () { |
---|
| 26 | checkOrderOptions(); |
---|
| 27 | }); |
---|
| 28 | |
---|
| 29 | checkOrderOptions(); |
---|
[7995] | 30 | }); |
---|
[9868] | 31 | jQuery(document).ready(function() { |
---|
[17574] | 32 | jQuery('.thumbnail').tipTip({ |
---|
[9868] | 33 | 'delay' : 0, |
---|
| 34 | 'fadeIn' : 200, |
---|
| 35 | 'fadeOut' : 200 |
---|
| 36 | }); |
---|
| 37 | }); |
---|
[7995] | 38 | {/literal}{/footer_script} |
---|
[3201] | 39 | |
---|
[13013] | 40 | <div class="titrePage"> |
---|
| 41 | <h2><span style="letter-spacing:0">{$CATEGORIES_NAV}</span> › {'Edit album'|@translate} {$TABSHEET_TITLE}</h2> |
---|
| 42 | </div> |
---|
[2531] | 43 | |
---|
[9051] | 44 | <form action="{$F_ACTION}" method="post"> |
---|
[2531] | 45 | {if !empty($thumbnails)} |
---|
[22579] | 46 | <p><input type="submit" value="{'Submit'|@translate}" name="submit"></p> |
---|
[2531] | 47 | <fieldset> |
---|
[9051] | 48 | <legend>{'Manual order'|@translate}</legend> |
---|
[3201] | 49 | {if !empty($thumbnails)} |
---|
[9051] | 50 | <p>{'Drag to re-order'|@translate}</p> |
---|
[2531] | 51 | <ul class="thumbnails"> |
---|
| 52 | {foreach from=$thumbnails item=thumbnail} |
---|
[14205] | 53 | <li class="rank-of-image"> |
---|
[17574] | 54 | <img src="{$thumbnail.TN_SRC}" class="thumbnail" alt="{$thumbnail.NAME|@replace:'"':' '}" title="{$thumbnail.NAME|@replace:'"':' '}" style="width:{$thumbnail.SIZE[0]}px; height:{$thumbnail.SIZE[1]}px; "> |
---|
[9051] | 55 | <input type="text" name="rank_of_image[{$thumbnail.ID}]" value="{$thumbnail.RANK}" style="display:none"> |
---|
[2531] | 56 | </li> |
---|
| 57 | {/foreach} |
---|
| 58 | </ul> |
---|
[3201] | 59 | {/if} |
---|
[2531] | 60 | </fieldset> |
---|
[9051] | 61 | {/if} |
---|
[5759] | 62 | |
---|
| 63 | <fieldset> |
---|
| 64 | <legend>{'Sort order'|@translate}</legend> |
---|
| 65 | <p class="field"> |
---|
| 66 | <input type="radio" name="image_order_choice" id="image_order_default" value="default"{if $image_order_choice=='default'} checked="checked"{/if}> |
---|
[8723] | 67 | <label for="image_order_default">{'Use the default photo sort order (defined in the configuration file)'|@translate}</label> |
---|
[5759] | 68 | </p> |
---|
| 69 | <p class="field"> |
---|
| 70 | <input type="radio" name="image_order_choice" id="image_order_rank" value="rank"{if $image_order_choice=='rank'} checked="checked"{/if}> |
---|
[9051] | 71 | <label for="image_order_rank">{'manual order'|@translate}</label> |
---|
[5759] | 72 | </p> |
---|
| 73 | <p class="field"> |
---|
| 74 | <input type="radio" name="image_order_choice" id="image_order_user_define" value="user_define"{if $image_order_choice=='user_define'} checked="checked"{/if}> |
---|
[9051] | 75 | <label for="image_order_user_define">{'automatic order'|@translate}</label> |
---|
[9039] | 76 | <div id="image_order_user_define_options"> |
---|
[13087] | 77 | {foreach from=$image_order item=order} |
---|
[5759] | 78 | <p class="field"> |
---|
[13087] | 79 | <select name="image_order[]"> |
---|
| 80 | {html_options options=$image_order_options selected=$order} |
---|
[5759] | 81 | </select> |
---|
| 82 | </p> |
---|
| 83 | {/foreach} |
---|
[9039] | 84 | </div> |
---|
[5759] | 85 | </fieldset> |
---|
[9051] | 86 | <p> |
---|
[22579] | 87 | <input type="submit" value="{'Submit'|@translate}" name="submit"> |
---|
[9051] | 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> |
---|
[3201] | 94 | </form> |
---|