aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-09-20 01:04:01 +0000
committerpatdenice <patdenice@piwigo.org>2008-09-20 01:04:01 +0000
commitc9cb39aadcaaf118b74d9c33d53373dc4cf9f4a4 (patch)
tree9981538da594fafe4f46f0ca15e9f041f3c3ab09 /admin
parentd55107e3e3511e4b2c52b56aaa1d6f7c6fd46b27 (diff)
- Add drag&drop to cat_list.
git-svn-id: http://piwigo.org/svn/trunk@2554 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/template/goto/cat_list.tpl26
-rw-r--r--admin/template/goto/default-layout.css1
-rw-r--r--admin/template/goto/theme/roma/theme.css3
3 files changed, 27 insertions, 3 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}" />
diff --git a/admin/template/goto/default-layout.css b/admin/template/goto/default-layout.css
index 585614382..1bd58aa5d 100644
--- a/admin/template/goto/default-layout.css
+++ b/admin/template/goto/default-layout.css
@@ -60,6 +60,7 @@ UL.categoryUl {
}
LI.categoryLi {
+ width: 100%;
border: 1px solid gray;
padding: 0px 5px;
margin-bottom: 5px;
diff --git a/admin/template/goto/theme/roma/theme.css b/admin/template/goto/theme/roma/theme.css
index 4fb0b20c6..46c1378d1 100644
--- a/admin/template/goto/theme/roma/theme.css
+++ b/admin/template/goto/theme/roma/theme.css
@@ -67,7 +67,8 @@ INPUT[type="submit"]:hover , INPUT[type="reset"]:hover { color:#f33; cursor: po
INPUT.bigbutton:hover { background-color: #222; color:#f33; border: 0; }
.throw { font-size: 120%; line-height: 26px; padding-top: 10px; font-weight: bold; }
label { cursor:pointer }
-.virtual_cat { background: #222 !important; }
+.categoryLi { background: #222 }
+.virtual_cat { background: #333 !important; }
a.Piwigo {
font-family: verdana, arial, helvetica, sans-serif !important;
font-size: 11px; font-weight: normal; letter-spacing: 0;