From aae9a5a1b6c75095817c0914ef7b92e63903fc2e Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Thu, 7 Feb 2013 14:52:18 +0100 Subject: Fix the tags search view (#35) And factor some views/templates while I'm at it. And remove unused/obsolete stuff in the same move. --- hyperkitty/static/css/hyperkitty.css | 12 +- hyperkitty/static/js/hyperkitty.js | 25 +++- hyperkitty/templates/base.html | 6 +- hyperkitty/templates/message.html | 2 +- hyperkitty/templates/messages/like_form.html | 2 +- hyperkitty/templates/messages/message.html | 8 +- hyperkitty/templates/month_view.html | 135 ------------------ hyperkitty/templates/paginator.html | 24 +--- hyperkitty/templates/recent_activities.html | 2 +- hyperkitty/templates/search.html | 102 -------------- hyperkitty/templates/thread.html | 6 +- hyperkitty/templates/thread_list.html | 55 ++++++++ hyperkitty/templates/threads/month_list.html | 6 +- hyperkitty/templates/threads/right_col.html | 4 +- hyperkitty/templates/threads/summary_thread.html | 6 +- .../templates/threads/summary_thread_large.html | 67 +++++++++ hyperkitty/templates/threads/tags.html | 2 +- hyperkitty/urls.py | 4 - hyperkitty/views/list.py | 151 ++++++--------------- hyperkitty/views/message.py | 6 +- hyperkitty/views/thread.py | 4 +- 21 files changed, 225 insertions(+), 404 deletions(-) delete mode 100644 hyperkitty/templates/month_view.html delete mode 100644 hyperkitty/templates/search.html create mode 100644 hyperkitty/templates/thread_list.html create mode 100644 hyperkitty/templates/threads/summary_thread_large.html diff --git a/hyperkitty/static/css/hyperkitty.css b/hyperkitty/static/css/hyperkitty.css index b8f56b4..5381e86 100644 --- a/hyperkitty/static/css/hyperkitty.css +++ b/hyperkitty/static/css/hyperkitty.css @@ -373,29 +373,29 @@ form.likeform { } -/* Month view header */ +/* Threads view header */ -#month-view .month-header { +#thread-list .thread-list-header { margin-bottom: 4em; } -#month-view .month-header .month-info { +#thread-list .thread-list-header .thread-list-info { display: inline; list-style-type: none; margin: 0; padding: 0; } -#month-view .month-header .month-info li { +#thread-list .thread-list-header .thread-list-info li { display: inline; margin-right: 2em; } -#month-view .month-header .month-info li.list-address { +#thread-list .thread-list-header .thread-list-info li.list-address { font-size: 120%; margin-right: 4em; } -/* Thread list */ +/* Thread view */ .thread { margin: 2em 0 2em 0; diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js index 6fb7ef8..d5898dc 100644 --- a/hyperkitty/static/js/hyperkitty.js +++ b/hyperkitty/static/js/hyperkitty.js @@ -296,8 +296,28 @@ function setup_quotes() { function setup_months_list() { var current = $("#months-list li.current").parent().prev(); - if (!current.length) { current = 0; } // overview - $("#months-list").accordion({ active: current }); + if (!current.length) { + current = false; // overview or search + } else { + current = current.prevAll("h3").length; + } + $("#months-list").accordion({ collapsible: true, active: current }); +} + +function setup_expander() { + $('span.expander').expander({ + slicePoint: 500, + userCollapseText : '\n[-]', + expandText : '\n[+]', + beforeExpand: function() { + $(this).removeClass("collapsed"); + $(this).addClass("expanded"); + }, + onCollapse: function() { + $(this).removeClass("expanded"); + $(this).addClass("collapsed"); + } + }); } @@ -313,4 +333,5 @@ $(document).ready(function() { setup_months_list(); setup_favorites(); setup_replies(); + setup_expander(); }); diff --git a/hyperkitty/templates/base.html b/hyperkitty/templates/base.html index f8eb95e..d645dbe 100644 --- a/hyperkitty/templates/base.html +++ b/hyperkitty/templates/base.html @@ -36,13 +36,13 @@