# HG changeset patch # User veltr # Date 1346162198 -7200 # Node ID 568f351565732bc1397bf57fd729a0469b1178da # Parent 2542311400374f72b9e35b18a0e620eaf80eb15b Added discipline list to the left of categories view diff -r 254231140037 -r 568f35156573 web/hdalab/static/hdalab/css/cattree.css --- a/web/hdalab/static/hdalab/css/cattree.css Mon Aug 27 17:30:20 2012 +0200 +++ b/web/hdalab/static/hdalab/css/cattree.css Tue Aug 28 15:56:38 2012 +0200 @@ -11,6 +11,10 @@ font-size: 16px; font-weight: bold; margin-bottom: 5px; } +.leftzone h3 { + font-size: 13px; font-weight: bold; margin: 30px 0 5px; +} + .leftzone input { background: #ffffff; width: 260px; font-size: 14px; font-weight: bold; margin: 5px 0; } @@ -19,7 +23,7 @@ display: none; } -.results, .bloc-historique { +.results { margin-top: 30px; } @@ -27,6 +31,22 @@ color: #000060; } +ul.disciplist { + list-style: none; margin: 10px 5px; +} + +.disciplist li { + font-size: 12px; font-weight: bold; +} + +.disciplist a { + color: #000066; +} + +.disciplist .selected a { + color: #0000ff; +} + .ui-autocomplete strong { font-weight: bold; color: #990000; } @@ -72,7 +92,7 @@ } .cattree .img-container { - float: left; margin: 4px 0; width: 60px; height: 50px; background: #dddddd; + float: left; margin: 10px 0 0; width: 60px; height: 50px; background: #dddddd; } .cattree .img-container img { @@ -91,11 +111,11 @@ font-weight: bold; cursor: pointer; } -.cattree p.theme:after, .cattree .content p.title:after { +.cattree p.theme:after { content: " [-]" } -.cattree .folded p.theme:after, .cattree .content.folded p.title:after { +.cattree .folded p.theme:after { content: " [+]" } @@ -146,3 +166,7 @@ li.content { list-style: disc; } + +.loading { + height: 128px; background: url(../img/loader.gif) no-repeat center; +} diff -r 254231140037 -r 568f35156573 web/hdalab/static/hdalab/img/loader.gif Binary file web/hdalab/static/hdalab/img/loader.gif has changed diff -r 254231140037 -r 568f35156573 web/hdalab/static/hdalab/js/cattree.js --- a/web/hdalab/static/hdalab/js/cattree.js Mon Aug 27 17:30:20 2012 +0200 +++ b/web/hdalab/static/hdalab/js/cattree.js Tue Aug 28 15:56:38 2012 +0200 @@ -34,15 +34,18 @@ return _html; } -function histoclick(_el) { - gettree($(_el).text()); -} - function gettree(_label) { + $(".disciplist li").removeClass("selected"); + $("#tree").html('
'); $.getJSON( endpoints.cat_tree, { label: _label }, function(_data) { + $(".disciplist li").each(function() { + if ($(this).text().trim().toLowerCase() === _label.toLowerCase()) { + $(this).addClass("selected"); + } + }) $(".label-name").html(_label); if (_data) { $("#tree").html(render(_data, 0)); @@ -54,7 +57,7 @@ $(this).find(".foldedcontent") .dequeue() .animate({ - height: $(this).find("p.description").outerHeight() + height: 5 + $(this).find("p.description").outerHeight() }, 500); }).mouseleave(function() { @@ -81,17 +84,12 @@ $("#tree").html(""); $(".results").hide(); } - var _hist = $(".historique"), - _html = _hist.text().length ? ' » ' : ''; - _html += '' + _label + ''; - _hist.append(_html); - $('.bloc-historique').show(); } ); } $(function() { - $( "#catsearch" ).autocomplete({ + $("#catsearch").autocomplete({ source: endpoints.cat_search, minLength: 2, select: function( event, ui ) { @@ -111,5 +109,11 @@ + "" ) .appendTo( ul ) }; + $("#catform").submit(function() { + gettree($("#catsearch").val()); + }); gettree("peinture"); + $(".disciplist li").click(function() { + gettree($(this).text().trim()); + }) }); \ No newline at end of file diff -r 254231140037 -r 568f35156573 web/hdalab/templates/categories.html --- a/web/hdalab/templates/categories.html Mon Aug 27 17:30:20 2012 +0200 +++ b/web/hdalab/templates/categories.html Tue Aug 28 15:56:38 2012 +0200 @@ -26,9 +26,26 @@ {% block main_content %}
-

Rechercher une catégorie :

+

Explorer les domaines artistiques

- + Cette interface expérimentale présente les ressources d'Histoire des Arts, + ordonnées selon l'arborescence des catégories de Wikipédia. + Seules les ressources les plus pertinentes sont affichées. +

+ +

Recherche libre dans les catégories :

+

+

-
{% endblock %} \ No newline at end of file