source: trunk/admin/themes/default/template/cat_list.tpl @ 5193

Revision 5193, 4.7 KB checked in by nikrou, 10 years ago (diff)

remove picture delete displayed twice
redirect after delete to avoid errors

  • Property svn:eol-style set to LF
Line 
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" }
4
5<script type="text/javascript">
6  jQuery().ready(function(){ldelim}
7    jQuery(".catPos").hide();
8    jQuery(".drag_button").show();
9    jQuery(".categoryLi").css("cursor","move");
10    jQuery(".categoryUl").sortable({ldelim}
11      axis: "y",
12      opacity: 0.8
13    });
14    jQuery("#categoryOrdering").submit(function(){ldelim}
15      ar = jQuery('.categoryUl').sortable('toArray');
16      for(i=0;i<ar.length;i++) {ldelim}
17        cat = ar[i].split('cat_');
18        document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i;
19      }
20    });
21  });
22</script>
23
24<h2>{'Categories management'|@translate}</h2>
25
26<h3>{$CATEGORIES_NAV}</h3>
27
28<form id="addVirtual" action="{$F_ACTION}" method="post">
29  <p>
30    {'Add a virtual category'|@translate} : <input type="text" name="virtual_name">
31    <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitAdd" {$TAG_INPUT_ENABLED}>
32    {if count($categories)>9 }
33    <a href="#EoP" class="button" style="border:0;">
34                <img src="{$themeconf.admin_icon_dir}/page_end.png" title="{'Page end'|@translate}" class="button" alt="page_end" style="margin-bottom:-0.6em;"></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        <input class="submit" name="submitOrderAlphaNumReverse" type="submit" value="{'Order alphanumerically reverse'|@translate}" {$TAG_INPUT_ENABLED}>
45  </p>
46  <ul class="categoryUl">
47
48    {foreach from=$categories item=category}
49    <li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}" id="cat_{$category.ID}">
50      <!-- category {$category.ID} -->
51      <ul class="categoryActions">
52        {if cat_admin_access($category.ID)}
53        <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>
54        {/if}
55        <li><a href="{$category.U_EDIT}" title="{'edit'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"></a></li>
56        {if isset($category.U_MANAGE_ELEMENTS) }
57        <li><a href="{$category.U_MANAGE_ELEMENTS}" title="{'elements'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'elements'|@translate}"></a></li>
58        {/if}
59        <li><a href="{$category.U_CHILDREN}" title="{'sub-categories'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_children.png" class="button" alt="{'sub-categories'|@translate}"></a></li>
60        {if isset($category.U_MANAGE_PERMISSIONS) }
61        <li><a href="{$category.U_MANAGE_PERMISSIONS}" title="{'Permissions'|@translate}" ><img src="{$themeconf.admin_icon_dir}/category_Permissions.png" class="button" alt="{'Permissions'|@translate}"></a></li>
62        {/if}
63        {if isset($category.U_DELETE) }
64        <li><a href="{$category.U_DELETE}" 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>
65        {/if}
66      </ul>
67
68      <p>
69      <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}">
70      <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-categories'|@translate}">{$category.NAME}</a></strong>
71      {if $category.IS_VIRTUAL}
72      <img src="{$themeconf.admin_icon_dir}/virt_category.png" class="button" alt="{'Virtual category'|@translate}">
73      {/if}
74      </p>
75
76      <p class="catPos">
77        <label>
78          {'Position'|@translate} :
79          <input type="text" size="4" name="catOrd[{$category.ID}]" maxlength="4" value="{$category.RANK}">
80        </label>
81      </p>
82
83    </li>
84    {/foreach}
85  </ul>
86  <p>
87    <input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED}>
88    <input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED}>
89        <input class="submit" name="submitOrderAlphaNumReverse" type="submit" value="{'Order alphanumerically reverse'|@translate}" {$TAG_INPUT_ENABLED}>
90  </p>
91
92</form>
93{/if}
Note: See TracBrowser for help on using the repository browser.