X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=templates%2Fadmin%2Fwiki.tpl;h=441ed0425b2c8cac8320380b1fee8354d19f618b;hb=5c6e38d70bb599598a0eadecf3606fe531a5ecf8;hp=9f10bed391dbe88abb2c889b7c2af99627327e58;hpb=e923a0cec71e7185f61da64fb7e9ec526d7b5f29;p=platal.git diff --git a/templates/admin/wiki.tpl b/templates/admin/wiki.tpl index 9f10bed..441ed04 100644 --- a/templates/admin/wiki.tpl +++ b/templates/admin/wiki.tpl @@ -35,25 +35,40 @@ } return false; } - function replie() { - var cat=$.trim($(this).parent().text().replace(/(.*)\([0-9]+\)/, "$1")); - $("tr[@id^=row/"+cat+"/]").hide(); - $(this).attr('src', 'images/k1.gif').unbind("click", replie).click(deplie); + var toggle = 0; + function replie(me, cat) { + if (toggle == 1) return; + toggle = 2; + $("tr[@id^=row_"+cat+"_]").hide(); + $(me).attr('src', 'images/k1.gif'); } - function deplie(image) { - var cat=$.trim($(this).parent().text().replace(/(.*)\([0-9]+\)/, "$1")); - $("tr[@id^=row/"+cat+"/]").show(); - $(this).attr('src', 'images/k2.gif').unbind("click", deplie).click(replie); + function deplie(me, cat) { + if (toggle == 2) return; + toggle = 1; + $("tr[@id^=row_"+cat+"_]").show(); + $(me).attr('src', 'images/k2.gif'); + } + function toggle_folder() { + me = this; + if ($(this).attr("class") == "wiki_category") + me = $("../img.wiki_root", me)[0]; + var cat=$.trim($(me).parent().text().replace(/(.*)\([0-9]+\)/, "$1")); + if ($(me).attr('src') == "images/k1.gif") { + deplie(me, cat); + } + replie(me, cat); + setTimeout("toggle = 0;", 10); } $(document).ready(function() { - $("tr.pair img[@alt=-]").css("cursor","pointer").each(replie); + $("tr.pair img[@alt=-]").css("cursor","pointer").click(toggle_folder).each(toggle_folder); + $(".wiki_category").css("cursor","pointer").click(toggle_folder); }); // --> {/literal}

- {icon name=magnifier"} Voir les changements récents + {icon name=magnifier"} Voir les changements récents

@@ -75,12 +90,12 @@ {foreach from=$wiki_pages key=cat item=pages} - - - {$cat} ({$pages|@count}) {icon name=magnifier title="Changements récents"} + - + {$cat} ({$pages|@count}) {icon name=magnifier title="Changements récents"} {foreach from=$pages item=perm key=page name=pages} - + {if $smarty.foreach.pages.last} L @@ -96,6 +111,8 @@ {$perm.edit} + {icon name=book_next title='déplacer'} + {icon name=bin_empty title='supprimer'}