source: trunk/admin/template/goto/cat_list.tpl @ 2598

Last change on this file since 2598 was 2573, checked in by patdenice, 16 years ago

Change cursor when moving on categories

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1{* $Id: cat_list.tpl 2573 2008-09-23 10:10:43Z patdenice $ *}
2{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
3{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js" }
4{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.sortable.packed.js" }
5
6<script type="text/javascript">
7  jQuery().ready(function(){ldelim}
8    jQuery(".catPos").hide();
9    jQuery(".drag_button").show();
10    jQuery(".categoryLi").css("cursor","move");
11    jQuery(".categoryUl").sortable({ldelim}
12      axis: "y",
13      opacity: 0.8
14    });
15    jQuery("#categoryOrdering").submit(function(){ldelim}
16      ar = jQuery('.categoryUl').sortable('toArray');
17      for(i=0;i<ar.length;i++) {ldelim}
18        cat = ar[i].split('cat_');
19        document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i;
20      }
21    });
22  });
23</script>
24
25<h2>{'title_categories'|@translate}</h2>
26
27<h3>{$CATEGORIES_NAV}</h3>
28
29<form id="addVirtual" action="{$F_ACTION}" method="post">
30  <p>
31    {'cat_add'|@translate} : <input type="text" name="virtual_name" />
32    <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitAdd" {$TAG_INPUT_ENABLED} />
33    {if count($categories)>9 }
34    <a href="#EoP" class="button"><img src="{$themeconf.admin_icon_dir}/page_end.png" class="button" alt="page_end" /></a>
35    {/if}
36  </p>
37</form>
38
39{if count($categories) }
40<form id="categoryOrdering" action="{$F_ACTION}" method="post">
41  <p>
42    <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED} />
43    <input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED} />
44  </p>
45  <ul class="categoryUl">
46
47    {foreach from=$categories item=category}
48    <li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}" id="cat_{$category.ID}">
49      <!-- category {$category.ID} -->
50      <ul class="categoryActions">
51        <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>
52        <li><a href="{$category.U_EDIT}" title="{'edit category informations'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"/></a></li>
53        {if isset($category.U_MANAGE_ELEMENTS) }
54        <li><a href="{$category.U_MANAGE_ELEMENTS}" title="{'manage category elements'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'elements'|@translate}" /></a></li>
55        {/if}
56        <li><a href="{$category.U_CHILDREN}" title="{'manage sub-categories'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_children.png" class="button" alt="{'sub-categories'|@translate}" /></a></li>
57        {if isset($category.U_MANAGE_PERMISSIONS) }
58        <li><a href="{$category.U_MANAGE_PERMISSIONS}" title="{'edit category permissions'|@translate}" ><img src="{$themeconf.admin_icon_dir}/category_permissions.png" class="button" alt="{'permissions'|@translate}" /></a></li>
59        {/if}
60        {if isset($category.U_DELETE) }
61        <li><a href="{$category.U_DELETE}" title="{'delete category'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"><img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'delete'|@translate}" /></a></li>
62        {/if}
63      </ul>
64
65      <p>
66      <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}"/>
67      <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-categories'|@translate}">{$category.NAME}</a></strong>
68      {if $category.IS_VIRTUAL}
69      <img src="{$themeconf.admin_icon_dir}/virt_category.png" class="button" alt="{'virtual_category'|@translate}" />
70      {/if}
71      </p>
72
73      <p class="catPos">
74        <label>
75          {'Position'|@translate} :
76          <input type="text" size="4" name="catOrd[{$category.ID}]" maxlength="4" value="{$category.RANK}" />
77        </label>
78      </p>
79
80    </li>
81    {/foreach}
82  </ul>
83  <p>
84    <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED} />
85    <input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED} />
86  </p>
87
88</form>
89{/if}
Note: See TracBrowser for help on using the repository browser.