diff options
author | patdenice <patdenice@piwigo.org> | 2008-09-20 01:04:01 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2008-09-20 01:04:01 +0000 |
commit | c9cb39aadcaaf118b74d9c33d53373dc4cf9f4a4 (patch) | |
tree | 9981538da594fafe4f46f0ca15e9f041f3c3ab09 /admin/template/goto/cat_list.tpl | |
parent | d55107e3e3511e4b2c52b56aaa1d6f7c6fd46b27 (diff) |
- Add drag&drop to cat_list.
git-svn-id: http://piwigo.org/svn/trunk@2554 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/template/goto/cat_list.tpl')
-rw-r--r-- | admin/template/goto/cat_list.tpl | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/admin/template/goto/cat_list.tpl b/admin/template/goto/cat_list.tpl index 18368acb3..dd018a8dd 100644 --- a/admin/template/goto/cat_list.tpl +++ b/admin/template/goto/cat_list.tpl @@ -1,4 +1,26 @@ {* $Id$ *} +{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"} +{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js" } +{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.sortable.packed.js" } + +<script type="text/javascript"> + jQuery().ready(function(){ldelim} + jQuery(".catPos").hide(); + jQuery('.categoryUl').sortable({ldelim} + axis: "y", + cursor: "move", + opacity: 0.8 + }); + jQuery("#categoryOrdering").submit(function(){ldelim} + ar = jQuery('.categoryUl').sortable('toArray'); + for(i=0;i<ar.length;i++) {ldelim} + cat = ar[i].split('cat_'); + document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i; + } + }); + }); +</script> + <h2>{'title_categories'|@translate}</h2> <h3>{$CATEGORIES_NAV}</h3> @@ -22,7 +44,7 @@ <ul class="categoryUl"> {foreach from=$categories item=category} - <li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}"> + <li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}" id="cat_{$category.ID}"> <!-- category {$category.ID} --> <ul class="categoryActions"> <li><a href="{$category.U_JUMPTO}" title="{'jump to category'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to category'|@translate}" /></a></li> @@ -46,7 +68,7 @@ {/if} </p> - <p> + <p class="catPos"> <label> {'Position'|@translate} : <input type="text" size="4" name="catOrd[{$category.ID}]" maxlength="4" value="{$category.RANK}" /> |