diff options
-rw-r--r-- | hyperkitty.spec | 2 | ||||
-rw-r--r-- | hyperkitty/static/hyperkitty/css/hyperkitty-common.css | 1 | ||||
-rw-r--r-- | hyperkitty/static/hyperkitty/css/hyperkitty-message.css | 15 | ||||
-rw-r--r-- | hyperkitty/static/hyperkitty/img/participant.png | bin | 675 -> 676 bytes | |||
-rw-r--r-- | hyperkitty/templates/ajax/reattach_suggest.html | 3 | ||||
-rw-r--r-- | hyperkitty/templates/reattach.html | 66 | ||||
-rw-r--r-- | hyperkitty/templates/threads/right_col.html | 14 | ||||
-rw-r--r-- | hyperkitty/views/thread.py | 11 |
8 files changed, 65 insertions, 47 deletions
diff --git a/hyperkitty.spec b/hyperkitty.spec index d6e3da8..99ab7bf 100644 --- a/hyperkitty.spec +++ b/hyperkitty.spec @@ -32,6 +32,7 @@ BuildRequires: python-cssmin BuildRequires: python-mailman-client BuildRequires: python-robot-detection BuildRequires: pytz +BuildRequires: python-django-paintstore %if 0%{fedora} && 0%{fedora} < 18 BuildRequires: Django BuildRequires: Django-south @@ -52,6 +53,7 @@ Requires: python-cssmin Requires: python-mailman-client Requires: python-robot-detection Requires: pytz +Requires: python-django-paintstore %if 0%{fedora} && 0%{fedora} < 18 Requires: Django >= 1.4 Requires: Django-south diff --git a/hyperkitty/static/hyperkitty/css/hyperkitty-common.css b/hyperkitty/static/hyperkitty/css/hyperkitty-common.css index 91c4556..dab65bb 100644 --- a/hyperkitty/static/hyperkitty/css/hyperkitty-common.css +++ b/hyperkitty/static/hyperkitty/css/hyperkitty-common.css @@ -85,7 +85,6 @@ form .buttons .submit { } .participant { background-image: url("../img/participant.png"); - padding-left: 16px; margin-right: 1em; } .discussion { diff --git a/hyperkitty/static/hyperkitty/css/hyperkitty-message.css b/hyperkitty/static/hyperkitty/css/hyperkitty-message.css index 769dc02..2f76e4e 100644 --- a/hyperkitty/static/hyperkitty/css/hyperkitty-message.css +++ b/hyperkitty/static/hyperkitty/css/hyperkitty-message.css @@ -101,11 +101,11 @@ display: none; } -#thread-overview-info .unread { - margin: 0 2px 0 2px; +#thread-overview-info i { + margin-right: 1px; + margin-left: 1px; } - /* Tags */ #tags { @@ -322,9 +322,18 @@ /* * Re-attach threads */ +.reattach-thread h1 { + text-align: center; + font-size: 24px; + line-height: 26px; + margin-bottom: 2em; +} .reattach-thread form { margin-bottom: 0; } +.reattach-thread form.search { + margin-top: 2em; +} .reattach-thread form.search p { line-height: 22px; } diff --git a/hyperkitty/static/hyperkitty/img/participant.png b/hyperkitty/static/hyperkitty/img/participant.png Binary files differindex f2d700b..ed6b861 100644 --- a/hyperkitty/static/hyperkitty/img/participant.png +++ b/hyperkitty/static/hyperkitty/img/participant.png diff --git a/hyperkitty/templates/ajax/reattach_suggest.html b/hyperkitty/templates/ajax/reattach_suggest.html index 7b94075..0eaa6d5 100644 --- a/hyperkitty/templates/ajax/reattach_suggest.html +++ b/hyperkitty/templates/ajax/reattach_suggest.html @@ -3,7 +3,8 @@ {% for s_thread in suggested_threads %} <li><label class="radio"><input type="radio" name="parent" value="{{ s_thread.thread_id }}" /> {{ s_thread.subject }} - <br/>(started {{ s_thread.starting_email|get_date }}, last active: {{ s_thread|get_date }}) + <br/>(started {{ s_thread.starting_email|get_date }}, last active: {{ s_thread|get_date }}, + <a href="{% url 'thread' mlist_fqdn=mlist.name threadid=s_thread.thread_id %}">see this thread</a>) </label> </li> {% empty %} diff --git a/hyperkitty/templates/reattach.html b/hyperkitty/templates/reattach.html index b2419c9..1eeed3a 100644 --- a/hyperkitty/templates/reattach.html +++ b/hyperkitty/templates/reattach.html @@ -10,7 +10,7 @@ Reattach a thread - {{ mlist.display_name|default:mlist.name|escapeemail }} - {{ {% block content %} -<div class="row-fluid"> +<div class="row-fluid reattach-thread"> {% include 'threads/month_list.html' %} @@ -18,41 +18,39 @@ Reattach a thread - {{ mlist.display_name|default:mlist.name|escapeemail }} - {{ <h1>Re-attach a thread to another</h1> - <div class="reattach-thread"> - <p>Thread to re-attach: + <p>Thread to re-attach: + <a href="{% url 'thread' mlist_fqdn=mlist.name threadid=thread.thread_id %}" + >{{ thread.subject }}</a> + (started {{ thread.starting_email|get_date }}, last active: {{ thread|get_date }}) + </p> + <form action="{% url 'thread_reattach_suggest' mlist_fqdn=mlist.name threadid=thread.thread_id %}" + method="GET" class="search"> + <p>Re-attach it to: + <span class="input-append"> + <input type="text" name="q" placeholder="Search for the parent thread" + /><button type="submit" class="btn">Search</button> + </span> + </p> + </form> + <form action="" method="POST"> + {% csrf_token %} + <ul class="unstyled suggestions"> + <img alt="Loading..." class="ajaxloader" src="{{ STATIC_URL }}hyperkitty/img/ajax-loader.gif" /> + </ul> + <ul class="unstyled"> + <li class="manual"> + <input type="radio" name="parent" value="" /> + <label>this thread ID: + <input type="text" name="parent-manual" size="32" placeholder="{{ thread.thread_id }}" /> + </label> + </li> + </ul> + <p class="buttons"> + <button type="submit" class="btn btn-primary">Do it</button> (there's no undoing!), or <a href="{% url 'thread' mlist_fqdn=mlist.name threadid=thread.thread_id %}" - >{{ thread.subject }}</a> - (started {{ thread.starting_email|get_date }}, last active: {{ thread|get_date }}) + >go back to the thread</a>. </p> - <form action="{% url 'thread_reattach_suggest' mlist_fqdn=mlist.name threadid=thread.thread_id %}" - method="GET" class="search"> - <p>Re-attach it to: - <span class="input-append"> - <input type="text" name="q" placeholder="Search for the parent thread" - /><button type="submit" class="btn">Search</button> - </span> - </p> - </form> - <form action="" method="POST"> - {% csrf_token %} - <ul class="unstyled suggestions"> - <img alt="Loading..." class="ajaxloader" src="{{ STATIC_URL }}hyperkitty/img/ajax-loader.gif" /> - </ul> - <ul class="unstyled"> - <li class="manual"> - <input type="radio" name="parent" value="" /> - <label>this thread ID: - <input type="text" name="parent-manual" size="32" placeholder="{{ thread.thread_id }}" /> - </label> - </li> - </ul> - <p class="buttons"> - <button type="submit" class="btn btn-primary">Do it</button> (there's no undoing!), or - <a href="{% url 'thread' mlist_fqdn=mlist.name threadid=thread.thread_id %}" - >go back to the thread</a>. - </p> - </form> - </div> + </form> </div> diff --git a/hyperkitty/templates/threads/right_col.html b/hyperkitty/templates/threads/right_col.html index c6d6d30..a9b5b38 100644 --- a/hyperkitty/templates/threads/right_col.html +++ b/hyperkitty/templates/threads/right_col.html @@ -33,11 +33,19 @@ <a href="#RmFav" class="saved">Remove from favorite discussions</a> </p> </form> + <div class="discussion">{{ num_comments }} comments</div> + <div class="participant">{{ participants|length }} participants</div> <p class="unread"> {% if user.is_authenticated %} <i class="unread icon-eye-close"></i> {{ unread_count }} unread messages {% endif %} </p> + {% if user.is_staff %} + <p><i class="icon-resize-small"></i> + <a href="{% url 'thread_reattach' mlist_fqdn=mlist.name threadid=threadid %}" + >Reattach this thread</a> + </p> + {% endif %} <div id="tags"> {% include 'threads/tags.html' %} </div> @@ -50,12 +58,6 @@ {{ addtag_form.as_p }} </form> </div> - {% if user.is_staff %} - <p><i class="icon-resize-small"></i> - <a href="{% url 'thread_reattach' mlist_fqdn=mlist.name threadid=threadid %}" - >Reattach this thread</a> - </p> - {% endif %} <div id="participants"> <span id="participants_title">participants</span> ({{participants|length}}) <ul> diff --git a/hyperkitty/views/thread.py b/hyperkitty/views/thread.py index a067aab..76bfbc9 100644 --- a/hyperkitty/views/thread.py +++ b/hyperkitty/views/thread.py @@ -162,6 +162,7 @@ def thread_index(request, mlist_fqdn, threadid, month=None, year=None): 'fav_action': fav_action, 'reply_form': ReplyForm(), 'is_bot': is_bot, + 'num_comments': len(thread), 'participants': thread.participants, 'last_view': last_view, 'unread_count': unread_count, @@ -386,10 +387,15 @@ def reattach(request, mlist_fqdn, threadid): def reattach_suggest(request, mlist_fqdn, threadid): store = get_store(request) + mlist = store.get_list(mlist_fqdn) thread = store.get_thread(mlist_fqdn, threadid) - default_search_query = thread.subject.lower().replace("re:", "") - search_query = request.GET.get("q", default_search_query) + default_search_query = stripped_subject( + mlist, thread.subject).lower().replace("re:", "") + search_query = request.GET.get("q") + if not search_query: + search_query = default_search_query + search_query = search_query.strip() search_result = store.search(search_query, mlist_fqdn, 1, 50) messages = search_result["results"] suggested_threads = [] @@ -398,6 +404,7 @@ def reattach_suggest(request, mlist_fqdn, threadid): suggested_threads.append(msg.thread) context = { + 'mlist' : mlist, 'suggested_threads': suggested_threads[:10], } return render(request, "ajax/reattach_suggest.html", context) |