summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-01-28 16:48:03 +0100
committerAurélien Bompard <aurelien@bompard.org>2013-01-28 16:48:03 +0100
commita4bf2658ce6474c1b8dc2d4f8997d8a4c508a1a3 (patch)
treef29b7f89faff32d99387da43b6a5825d3f5f0f07 /hyperkitty/templates
parentfd1616185405265189dc6d5ce70cc6c16456088c (diff)
downloadhyperkitty-a4bf2658ce6474c1b8dc2d4f8997d8a4c508a1a3.tar.gz
hyperkitty-a4bf2658ce6474c1b8dc2d4f8997d8a4c508a1a3.tar.xz
hyperkitty-a4bf2658ce6474c1b8dc2d4f8997d8a4c508a1a3.zip
fix the favorites system
Diffstat (limited to 'hyperkitty/templates')
-rw-r--r--hyperkitty/templates/month_view.html2
-rw-r--r--hyperkitty/templates/threads/add_tag_form.html15
-rw-r--r--hyperkitty/templates/threads/right_col.html16
-rw-r--r--hyperkitty/templates/user_profile.html83
4 files changed, 64 insertions, 52 deletions
diff --git a/hyperkitty/templates/month_view.html b/hyperkitty/templates/month_view.html
index 16bef68..243c8b1 100644
--- a/hyperkitty/templates/month_view.html
+++ b/hyperkitty/templates/month_view.html
@@ -37,7 +37,7 @@
{% for thread in threads %}
<!-- New thread -->
<div class="thread">
- <div class="notsaved">
+ <div class="{% if thread.favorite %}saved{% else %}notsaved{% endif %}">
<span class="thread_title"><a name="{{thread.thread_id}}"
href="{% url thread threadid=thread.thread_id, mlist_fqdn=list_address %}"
>{{ thread.starting_email.subject|strip_subject:mlist }}</a></span>
diff --git a/hyperkitty/templates/threads/add_tag_form.html b/hyperkitty/templates/threads/add_tag_form.html
deleted file mode 100644
index 44b5f76..0000000
--- a/hyperkitty/templates/threads/add_tag_form.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends "base.html" %}
-
-{% block header %} {% endblock %}
-
-{% block content %}
-<form id="addtag" action="{% url add_tag mlist_fqdn=list_address, hashid=threadid %}" method="post">
- {% csrf_token %}
- {{ addtag_form }}
- <button type="submit">
- Add
- </button>
-</form>
-{% endblock %}
-
-{# vim: set noet: #}
diff --git a/hyperkitty/templates/threads/right_col.html b/hyperkitty/templates/threads/right_col.html
index 73194df..60bed09 100644
--- a/hyperkitty/templates/threads/right_col.html
+++ b/hyperkitty/templates/threads/right_col.html
@@ -22,18 +22,22 @@
old
</div>
</div>
- {% if use_mockups %}
- <p id="add_to_fav">
- <a href="#AddFav" class="notsaved">Add to favorite discussions</a>
- </p>
- {% endif %}
+ <form id="fav_form" name="favorite" method="post" class="favorite"
+ action="{% url favorite mlist_fqdn=list_address, threadid=threadid %}">
+ {% csrf_token %}
+ <input type="hidden" name="action" value="{{ fav_action }}" />
+ <p>
+ <a href="#AddFav" class="notsaved">Add to favorite discussions</a>
+ <a href="#RmFav" class="saved">Remove from favorite discussions</a>
+ </p>
+ </form>
<!-- End dates -->
<div id="tags">
{% include 'threads/tags.html' %}
</div>
<div id="add_tag">
<form id="add_tag_form" name="addtag" method="post"
- action="{% url add_tag mlist_fqdn=list_address, hashid=threadid %}">
+ action="{% url add_tag mlist_fqdn=list_address, threadid=threadid %}">
{% csrf_token %}
{{ addtag_form.as_p }}
</form>
diff --git a/hyperkitty/templates/user_profile.html b/hyperkitty/templates/user_profile.html
index e39c0b6..a0a86e4 100644
--- a/hyperkitty/templates/user_profile.html
+++ b/hyperkitty/templates/user_profile.html
@@ -39,39 +39,62 @@
</tbody>
</table>
- <h3> Up Votes : </h3>
- <ul>
- {% for vote in votes_up %}
- <li>
- {% if vote.message.content|trimString|length > 0 %}
- <a href="{% url message_index mlist_fqdn=vote.list_address, hashid=vote.messageid %}"
- >{{ vote.message.subject }}</a> by {{ vote.message.sender_name }}
- ({{ vote.message|viewer_date|date:"l, j F Y H:i:s" }})
- {% else %}
- <a href="{% url message_index mlist_fqdn=vote.list_address, hashid=vote.messageid %}">Message is empty</a>
- {% endif %}
- </li>
- {% empty %}
+
+ <h3>Favorites</h3>
+ {% if favorites %}
+ <ul>
+ {% for fav in favorites %}
+ <li>
+ <a href="{% url thread mlist_fqdn=fav.list_address, threadid=fav.threadid %}"
+ >{{ fav.thread.starting_email.subject }}</a> by {{ fav.thread.starting_email.sender_name }}
+ ({{ fav.thread|viewer_date|date:"l, j F Y H:i:s" }})
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p>No favorite yet.</p>
+ {% endif %}
+
+
+ <h3>Votes</h3>
+ <h4>Up Votes</h4>
+ {% if votes_up %}
+ <ul>
+ {% for vote in votes_up %}
+ <li>
+ {% if vote.message.content|trimString|length > 0 %}
+ <a href="{% url message_index mlist_fqdn=vote.list_address, hashid=vote.messageid %}"
+ >{{ vote.message.subject }}</a> by {{ vote.message.sender_name }}
+ ({{ vote.message|viewer_date|date:"l, j F Y H:i:s" }})
+ {% else %}
+ <a href="{% url message_index mlist_fqdn=vote.list_address, hashid=vote.messageid %}">Message is empty</a>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
<p>No up vote yet.</p>
- {% endfor %}
- </ul>
+ {% endif %}
- <h3> Down Votes : </h3>
- <ul>
- {% for vote in votes_down %}
- <li>
- {% if vote.message.content|trimString|length > 0 %}
- <a href="{% url message_index mlist_fqdn=vote.list_address, hashid=vote.messageid %}"
- >{{ vote.message.subject }}</a> by {{ vote.message.sender_name }}
- ({{ vote.message|viewer_date|date:"l, j F Y H:i:s" }})
- {% else %}
- <a href="{% url message_index mlist_fqdn=vote.list_address, hashid=vote.messageid %}">Message is empty</a>
- {% endif %}
- </li>
- {% empty %}
+ <h4>Down Votes</h4>
+ {% if votes_down %}
+ <ul>
+ {% for vote in votes_down %}
+ <li>
+ {% if vote.message.content|trimString|length > 0 %}
+ <a href="{% url message_index mlist_fqdn=vote.list_address, hashid=vote.messageid %}"
+ >{{ vote.message.subject }}</a> by {{ vote.message.sender_name }}
+ ({{ vote.message|viewer_date|date:"l, j F Y H:i:s" }})
+ {% else %}
+ <a href="{% url message_index mlist_fqdn=vote.list_address, hashid=vote.messageid %}">Message is empty</a>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
<p>No down vote yet.</p>
- {% endfor %}
- </ul>
+ {% endif %}
+
{% endblock %}