summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates/index.html
blob: 7e39a58933f29030acb63d5139d57188bea55fd0 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% load hk_generic %}


{% block title %}
{% trans 'Available lists' %} - {{ app_name|title }}
{% endblock %}

{% block content %}

<div class="row-fluid all-lists">

<div class="span2 lists-menu">
    <h2>{% trans 'Lists' %}</h2>
    <ul>
        <li>
            {% if not sort_mode %}
            <span class="active">{% trans 'All' %}</span>
            {% else %}
            <a href="{% url 'root' %}">{% trans 'All' %}</a>
            {% endif %}
        </li>
        <li>
           {% if sort_mode == "active" %}
           <span class="active">{% trans 'Most active' %}</span>
           {% else %}
           <a href="{% url 'root' %}?sort=active">{% trans 'Most active' %}</a>
           {% endif %}
        </li>
        <li>
           {% if sort_mode == "popular" %}
           <span class="active">{% trans 'Most popular' %}</span>
           {% else %}
            <a href="{% url 'root' %}?sort=popular">{% trans 'Most popular' %}</a>
           {% endif %}
        </li>
        <li>
           {% if sort_mode == "creation" %}
           <span class="active">{% trans 'Newest' %}</span>
           {% else %}
            <a href="{% url 'root' %}?sort=creation">{% trans 'Newest' %}</a>
           {% endif %}
        </li>
    </ul>
</div>

<div class="span10">

<h1>
    {% trans 'Available lists' %}
    {% if sort_mode == 'active' %}
        <small>({% trans 'most active first' %})</small>
    {% elif sort_mode == 'popular' %}
        <small>({% trans 'most popular first' %})</small>
    {% elif sort_mode == 'creation' %}
        <small>({% trans 'newest first' %})</small>
    {% endif %}
</h1>

{% if all_lists %}
<table class="lists table">
    <thead>
        <tr>
            <th>{% trans 'List' %}</th>
            <th>{% trans 'Description' %}</th>
            <th>{% trans 'Activity in the past 30 days' %}</th>
        </tr>
    </thead>
    <tbody>
{% for mlist in all_lists %}
        <tr class="list
           {% if mlist.is_private %}
           private
           {% elif mlist.recent_threads_count == 0 %}
           inactive
           {% endif %}
           ">
            <td>
               {% if mlist.is_new %}
                <span class="new label">{% trans 'new' %}</span>
               {% endif %}
                <a href="{% url 'list_overview' mlist_fqdn=mlist.name %}"
                   class="list-name">
                    {% if mlist.display_name %}
                        {{ mlist.display_name }}
                    {% else %}
                        {{ mlist.name|until:"@" }}
                    {% endif %}
                </a>
               {% if mlist.is_private %}
               <span class="list-tags">private</span>
               {% elif mlist.recent_threads_count == 0 %}
               <span class="list-tags">inactive</span>
               {% endif %}
                <br />
                <span class="list-address">
                    {{ mlist.name }}
                </span>
            </td>
            <td class="list-description">
                {{ mlist.description|default_if_none:"" }}
            </td>
            <td class="activity">
                <div class="chart" data-chart-values="{{ mlist.evolution|to_json }}"></div>
                <ul class="list-stats">
                    <li><span class="participant">
                        {% if mlist.can_view %}
                        {{ mlist.recent_participants_count }}
                        {% else %}
                        ...
                        {% endif %}
                        participants</span></li>
                    <li><span class="discussion">
                        {% if mlist.can_view %}
                        {{ mlist.recent_threads_count }}
                        {% else %}
                        ...
                        {% endif %}
                        discussions</span></li>
                </ul>
            </td>
        </tr>
        <tr class="spacer"><td colspan="3"></td></tr>
{% endfor %}
    </tbody>
</table>
{% else %}
<p>No archived list yet.</p>
{% endif %}

</div> <!-- right column -->

</div>

<img id="logo" alt="HyperKitty" src="{{STATIC_URL}}hyperkitty/img/logo.png" />

{% endblock %}

{% block additionaljs %}

<script>
    $(function() {
        $("div.chart").each(function() {
            chart($(this).get(0),
                  $.parseJSON($(this).attr("data-chart-values")),
                  {height: 30});
        });
        $("table.lists tr.list").click(function(e) {
            document.location.href = $(this).find("a.list-name").attr("href");
        });
    });
</script>

{% endblock %}