Last change
on this file since 5618 was
5187,
checked in by nikrou, 14 years ago
|
Feature 940 : improve ordering by rank by clip thumbnail to a square
|
-
Property svn:eol-style set to
LF
|
File size:
1.8 KB
|
Rev | Line | |
---|
[5123] | 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" } |
---|
[3201] | 4 | |
---|
| 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) { |
---|
[5169] | 15 | $(this).find("input[name^=rank_of_image]") |
---|
[3201] | 16 | .each(function() { $(this).attr('value', (i+1)*10)}); |
---|
| 17 | }); |
---|
| 18 | } |
---|
| 19 | }); |
---|
| 20 | }); |
---|
| 21 | |
---|
| 22 | </script> |
---|
| 23 | {/literal} |
---|
| 24 | |
---|
[2531] | 25 | <h2>{'Manage image ranks'|@translate}</h2> |
---|
| 26 | |
---|
| 27 | <h3>{$CATEGORIES_NAV}</h3> |
---|
| 28 | |
---|
| 29 | {if !empty($thumbnails)} |
---|
[3201] | 30 | <form action="{$F_ACTION}" method="post"> |
---|
| 31 | <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></p> |
---|
[2531] | 32 | <fieldset> |
---|
| 33 | <legend>{'Edit ranks'|@translate}</legend> |
---|
[3201] | 34 | {if !empty($thumbnails)} |
---|
[2531] | 35 | <ul class="thumbnails"> |
---|
| 36 | {foreach from=$thumbnails item=thumbnail} |
---|
[5187] | 37 | <li class="rank-of-image"> |
---|
| 38 | <div class="clipwrapper"> |
---|
| 39 | <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"> |
---|
| 40 | <img src="{$thumbnail.TN_SRC}" class="thumbnail" alt=""> |
---|
| 41 | </div> |
---|
| 42 | </div> |
---|
[3201] | 43 | <input type="text" name="rank_of_image[{$thumbnail.ID}]" value="{$thumbnail.RANK}"> |
---|
[2531] | 44 | </li> |
---|
| 45 | {/foreach} |
---|
| 46 | </ul> |
---|
[3201] | 47 | {/if} |
---|
[2531] | 48 | </fieldset> |
---|
[3201] | 49 | <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></p> |
---|
| 50 | </form> |
---|
[2531] | 51 | |
---|
| 52 | {else} |
---|
[3201] | 53 | <div class="infos"><p>{'No element in this category'|@translate}</p></div> |
---|
[2531] | 54 | {/if} |
---|
Note: See
TracBrowser
for help on using the repository browser.