summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates/month_view.html
blob: 16bef680290a5d9a910bd07bdee41f9bf7c9d451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{% extends "base.html" %}
{% load gravatar %}
{% load hk_generic %}
{% load storm %}


{% block title %}
{{ month|date:"F Y"|capfirst }} - {{ mlist.display_name|default:mlist.name|escapeemail }} - {{ app_name|title }}
{% endblock %}

{% block content %}

<div class="row-fluid">

{% include 'threads/month_list.html' %}

	<div id="month-view" class="span8">

		<div class="month-header">
			<div class="list-name">{{ mlist.display_name|default:mlist.name|escapeemail }}</div>
			<div class="month-name">{{ month|date:"F Y"|capfirst }}</div>
			<ul class="month-info">
				<li class="participant">
					{{ month_participants }} participants
				</li>
				<li class="discussion">
					{{ month_discussions }} discussions
				</li>
			</ul>
			{% if mlist.display_name %}
			<p class="list-address">
				{{ list_address|escapeemail }}
			</p>
			{% endif %}
		</div>

		{% for thread in threads %}
		<!-- New thread -->
		<div class="thread">
			<div class="notsaved">
				<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>
				<span class="thread_date">{{thread.date_active|timesince }}</span>
			</div>
			<div class="thread_content">
				{% if thread.category_tag %}
				<div class="inline-block type type_{{thread.category_tag}}">
					<a href="{% url search_tag mlist_fqdn=list_address, tag=thread.category_tag %}"
						>{{thread.category}}</a>
				</div>
				{% endif %}
				{% if thread.category %}
				<div class="inline-block type type_{{thread.category|lower}}">
					<a href="{% url search_tag mlist_fqdn=list_address, tag=thread.category|lower %}"
						>{{thread.category}}</a>
				</div>
				{% endif %}
				<div class="gravatar">
					{% if thread.starting_email.sender_email %}
					{% gravatar thread.starting_email.sender_email 40 %}
					<br />
					{% endif %}
					{{ thread.starting_email.sender_name|escapeemail }}
				</div>
				<div class="thread_email">
					<span class="expander collapsed">
						{{ thread.starting_email.content|urlizetrunc:76|escapeemail }}
					</span>
				</div>
			</div>
			<div class="thread_info">
				<ul class="tags inline">
					{% if thread.tags|length %}
					<li>
						Tags:
					</li>
					{% for tag in thread.tags %}
					<li>
						<a href="{% url search_tag mlist_fqdn=list_address, tag=tag %}">{{tag}}</a>
					</li>
					{% endfor %}
					{% endif %}
				</ul>
				<ul class="inline-block">
					<li class="participant">
						{{ thread.participants|length }} participants
					</li>
					<li class="discussion">
						{{ thread|length }} comments
					</li>
				</ul>
				<ul class="inline-block">
					{% include "messages/like_form.html" with hashid=thread.thread_id object=thread %}
				</ul>
				<a href="{% url thread threadid=thread.thread_id, mlist_fqdn=list_address %}"
				   class="btn">Show discussion</a>
			</div>
		</div>
		<!-- End of thread -->
		{% empty %}
			Sorry no emails could be found for this month.
		{% endfor %}

		{% include "paginator.html" %}

	</div>

</div>

{% endblock %}

{% block additionaljs %}
<script src="{{ STATIC_URL }}libs/jquery.expander.js"></script>
<script>
	$(document).ready(function() {
		$('span.expander').expander({
			slicePoint: 500,
			userCollapseText : '\nView Less',
			expandText : '\nView More',
			afterExpand: function() {
				$(this).removeClass("collapsed");
				$(this).addClass("expanded");
			},
			onCollapse: function() {
				$(this).removeClass("expanded");
				$(this).addClass("collapsed");
			}
		});
	});
</script>
{% endblock %}

{# vim: set noet: #}