diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2012-12-13 15:45:39 +0100 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2012-12-13 15:45:39 +0100 |
commit | 90d3f91df7851b97f07b903f353497742f80d325 (patch) | |
tree | 19c69be5514940878f65799c814e9b44a1384676 | |
parent | eab3d767b65982e1e04c5538c0d2827f26230fca (diff) | |
download | hyperkitty-90d3f91df7851b97f07b903f353497742f80d325.tar.gz hyperkitty-90d3f91df7851b97f07b903f353497742f80d325.tar.xz hyperkitty-90d3f91df7851b97f07b903f353497742f80d325.zip |
Fix quoting in the message view
Refs: #24
-rw-r--r-- | hyperkitty/static/css/style.css | 2 | ||||
-rw-r--r-- | hyperkitty/static/js/hyperkitty.js | 9 | ||||
-rw-r--r-- | hyperkitty/templates/thread.html | 6 | ||||
-rw-r--r-- | hyperkitty/templatetags/hk_generic.py | 2 | ||||
-rw-r--r-- | hyperkitty/tests/test_templatetags.py | 2 |
5 files changed, 14 insertions, 7 deletions
diff --git a/hyperkitty/static/css/style.css b/hyperkitty/static/css/style.css index 57b8fcf..9ac592a 100644 --- a/hyperkitty/static/css/style.css +++ b/hyperkitty/static/css/style.css @@ -709,8 +709,8 @@ ul.attachments-list li { margin-top: 5px; } +.first_email_body .quoted-text, .email_body .quoted-text { - display: none; border-left: 2px solid rgb(55, 113, 200); padding-left: 0.2em; } diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js index c709bce..c4a1bbe 100644 --- a/hyperkitty/static/js/hyperkitty.js +++ b/hyperkitty/static/js/hyperkitty.js @@ -153,6 +153,14 @@ function setup_attachments() { }); } +function setup_quotes() { + $('div.email_body .quoted-switch a') + .add('div.first_email_body .quoted-switch a') + .click(function() { + $(this).parent().next(".quoted-text").slideToggle('fast'); + return false; + }); +} /* @@ -163,4 +171,5 @@ $(document).ready(function() { setup_vote(); setup_attachments(); setup_add_tag(); + setup_quotes(); }); diff --git a/hyperkitty/templates/thread.html b/hyperkitty/templates/thread.html index 295da84..8ea45d2 100644 --- a/hyperkitty/templates/thread.html +++ b/hyperkitty/templates/thread.html @@ -44,10 +44,8 @@ <script src="{{ STATIC_URL }}js/libs/jquery.expander.js"></script> <script type="text/javascript"> $(document).ready(function() { - $('div.email_body .quoted-switch a').click(function() { - $(this).parent().next(".quoted-text").slideToggle('fast'); - return false; - }); + // hide quotes by default in the thread view + $('div.email_body .quoted-text').hide(); }); </script> diff --git a/hyperkitty/templatetags/hk_generic.py b/hyperkitty/templatetags/hk_generic.py index b219eba..555246f 100644 --- a/hyperkitty/templatetags/hk_generic.py +++ b/hyperkitty/templatetags/hk_generic.py @@ -165,7 +165,7 @@ def snip_quoted(content, quotemsg="[...]", autoescape=None): current_quote_orig = [] lastline = line for quote_orig, quote in quoted: - replaced = (' <div class="quoted-switch"><a href="#">%s</a></div>' % quotemsg + replaced = ('<div class="quoted-switch"><a href="#">%s</a></div>' % quotemsg +'<div class="quoted-text">' +"\n".join(quote) +' </div>') diff --git a/hyperkitty/tests/test_templatetags.py b/hyperkitty/tests/test_templatetags.py index eab0187..f4d9d4d 100644 --- a/hyperkitty/tests/test_templatetags.py +++ b/hyperkitty/tests/test_templatetags.py @@ -36,7 +36,7 @@ This is the response. """ expected = """ On Fri, 09.11.12 11:27, Someone wrote: - <div class="quoted-switch"><a href="#">%s</a></div><div class="quoted-text"> This is the first quoted line +<div class="quoted-switch"><a href="#">%s</a></div><div class="quoted-text"> This is the first quoted line This is the second quoted line </div>This is the response. """ % self.quotemsg result = snip_quoted(contents, self.quotemsg) |