summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-11-28 12:25:25 +0100
committerAurélien Bompard <aurelien@bompard.org>2013-11-28 14:05:18 +0100
commitdc34f0e874c42018e11ed951efc5b3fcfe7e8feb (patch)
treed9aae53bff1beb78a076ecdbd65c86cefd22c85d /hyperkitty/templates
parentc976dc96c79a897b55ca8430b824eb8063cd0403 (diff)
downloadhyperkitty-dc34f0e874c42018e11ed951efc5b3fcfe7e8feb.tar.gz
hyperkitty-dc34f0e874c42018e11ed951efc5b3fcfe7e8feb.tar.xz
hyperkitty-dc34f0e874c42018e11ed951efc5b3fcfe7e8feb.zip
Load the list's recent activity via AJAX
Diffstat (limited to 'hyperkitty/templates')
-rw-r--r--hyperkitty/templates/base.html2
-rw-r--r--hyperkitty/templates/index.html28
-rw-r--r--hyperkitty/templates/overview.html16
3 files changed, 12 insertions, 34 deletions
diff --git a/hyperkitty/templates/base.html b/hyperkitty/templates/base.html
index a6feb9a..eb8e452 100644
--- a/hyperkitty/templates/base.html
+++ b/hyperkitty/templates/base.html
@@ -130,7 +130,7 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ STATIC_URL }}hyperkitty/libs/jquery/jquery-1.10.1.min.js"><\/script>')</script>
<script src="{{ STATIC_URL }}hyperkitty/libs/jquery/jquery-ui-1.10.3.custom.min.js"></script>
- {% assets filters="rjsmin", output="gen/hyperkitty.js", "hyperkitty/libs/bootstrap/js/bootstrap.min.js", "hyperkitty/libs/jquery.expander.js", "hyperkitty/libs/d3.v2.min.js", "hyperkitty/libs/jquery.hotkeys.js", "hyperkitty/js/hyperkitty-common.js", "hyperkitty/js/hyperkitty-thread.js", "hyperkitty/js/hyperkitty-userprofile.js" %}
+ {% assets filters="rjsmin", output="gen/hyperkitty.js", "hyperkitty/libs/bootstrap/js/bootstrap.min.js", "hyperkitty/libs/jquery.expander.js", "hyperkitty/libs/d3.v2.min.js", "hyperkitty/libs/jquery.hotkeys.js", "hyperkitty/js/hyperkitty-common.js", "hyperkitty/js/hyperkitty-index.js", "hyperkitty/js/hyperkitty-thread.js", "hyperkitty/js/hyperkitty-userprofile.js" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{% block additionaljs %} {% endblock %}
diff --git a/hyperkitty/templates/index.html b/hyperkitty/templates/index.html
index 3dd9d79..8d2fcf9 100644
--- a/hyperkitty/templates/index.html
+++ b/hyperkitty/templates/index.html
@@ -109,7 +109,9 @@
{{ mlist.description|default_if_none:"" }}
</td>
<td class="activity">
- <div class="chart" data-chart-values="{{ mlist.evolution|to_json }}"></div>
+ <div class="chart">
+ <img alt="Loading..." class="ajaxloader" src="{{ STATIC_URL }}hyperkitty/img/ajax-loader.gif" />
+ </div>
<ul class="list-stats">
<li><span class="participant">
{% if mlist.can_view %}
@@ -159,29 +161,7 @@
<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");
- });
- $(".initials").animate({ right: 0 }, {duration: 600});
- // Override the scrolling because we have a fixed header
- $(".initials a").click(function (e) {
- e.preventDefault();
- var target = $("a[name="+$(this).attr("href").substring(1)+"]");
- $(window).scrollTop(target.offset().top - 70);
- });
- $(".hide-switches input").click(function() {
- var target = $("table.lists tr.list."+$(this).val());
- if ($(this).prop("checked")) {
- target.hide();
- } else {
- target.show();
- }
- });
+ setup_index("{% url 'list_recent_activity' 'PLACEHOLDER@PLACEHOLDER' %}");
});
</script>
diff --git a/hyperkitty/templates/overview.html b/hyperkitty/templates/overview.html
index edb98ca..b8be4ae 100644
--- a/hyperkitty/templates/overview.html
+++ b/hyperkitty/templates/overview.html
@@ -18,7 +18,7 @@
{% include 'threads/month_list.html' %}
<section id="overview" class="span10">
-
+
<section id="title">
<h2>
{% if mlist.display_name %}
@@ -28,12 +28,13 @@
{% endif %}
</h2>
<p id="description">{{ mlist.description|default_if_none:"" }}</p>
-
+
<section id="statistics">
-
- <div id="chart" data-chart-values="{{ evolution|to_json }}"></div>
+
+ <div id="chart">
+ </div>
<p class="caption">Post volume over the past <strong>30</strong> days.</p>
-
+
<p class="thread-new">
<a href="{% url "message_new" mlist_fqdn=mlist.name %}"
class="thread-new btn{% if not user.is_authenticated %} disabled" title="You must be logged-in to create a thread.{% endif %}">
@@ -151,10 +152,7 @@
<script type="text/javascript" >
$(function() {
- $("#chart").each(function() {
- chart($(this).get(0),
- $.parseJSON($(this).attr("data-chart-values")));
- });
+ ajax_chart("#chart", "{% url 'list_recent_activity' mlist.name %}");
});
</script>