diff options
-rw-r--r-- | templates/base.html | 93 | ||||
-rw-r--r-- | templates/index.html | 24 | ||||
-rw-r--r-- | templates/lists/list_nav.html | 34 | ||||
-rw-r--r-- | templates/login.html | 82 | ||||
-rw-r--r-- | templates/message.html | 77 | ||||
-rw-r--r-- | templates/messages/message.html | 48 | ||||
-rw-r--r-- | templates/month_view.html | 189 | ||||
-rw-r--r-- | templates/recent_activities.html | 397 | ||||
-rw-r--r-- | templates/search.html | 193 | ||||
-rw-r--r-- | templates/thread.html | 131 | ||||
-rw-r--r-- | templates/threads/add_tag_form.html | 12 | ||||
-rw-r--r-- | templates/threads/right_col.html | 100 | ||||
-rw-r--r-- | templates/user_profile.html | 6 | ||||
-rw-r--r-- | urls.py | 2 |
14 files changed, 720 insertions, 668 deletions
diff --git a/templates/base.html b/templates/base.html index 3d51c0d..8842887 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,51 +1,60 @@ <!DOCTYPE HTML> <html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <meta name="ROBOTS" content="INDEX, FOLLOW" /> - <title>{% block title %}{{ app_name }}{% endblock %}</title> - <meta name="author" content="" /> - <meta name="dc.language" content="en" /> - <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/style.css" /> - {% block additional_stylesheets %} {% endblock %} - </head> - {% load i18n %} - - <body> - <!-- Header --> - <div class="header"> - {% block header %} + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta name="ROBOTS" content="INDEX, FOLLOW" /> + <title>{% block title %}{{ app_name }}{% endblock %}</title> + <meta name="author" content="" /> + <meta name="dc.language" content="en" /> + <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/style.css" /> + {% block additional_stylesheets %} {% endblock %} + </head> + {% load i18n %} - <div id="headline"> - <ul class="inline-block">{% if list_address %} - <li id="list_name"> - <a href="/list/{{list_address}}">{{list_name}}</a> - </li>{% else %} - <li id="list_name"> - <a href="/list/">{{list_name}}</a> - </li>{% endif %} - <li id="page_date">{{month}}</li> - <li>{% if user.is_authenticated %}<a class="mm_logout" href="{% url user_logout %}">Logout</a>{% else %}<a class="mm_user" href="{% url user_login %}">Login</a>{% endif %}</li> - </ul> + <body> + <!-- Header --> + <div class="header"> + {% block header %} - {% if user.is_authenticated %} - <div class="mm_loginName">Logged in as: <a href="{% url user_profile %}">{{ user.username }}</a></div> - {% endif %} + <div id="headline"> + <ul class="inline-block"> + {% if list_address %} + <li id="list_name"> + <a href="/list/{{list_address}}">{{list_name}}</a> + </li> + {% else %} + <li id="list_name"> + <a href="/list/">{{list_name}}</a> + </li> + {% endif %} + <li id="page_date"> + {{month}} + </li> + <li> + {% if user.is_authenticated %}<a class="mm_logout" href="{% url user_logout %}">Logout</a>{% else %}<a class="mm_user" href="{% url user_login %}">Login</a>{% endif %} + </li> + </ul> - {% if list_address %} + {% if user.is_authenticated %} + <div class="mm_loginName"> + Logged in as: <a href="{% url user_profile %}">{{ user.username }}</a> + </div> + {% endif %} + + {% if list_address %} {% include 'lists/list_nav.html' %} - {% endif %} - </div> + {% endif %} + </div> - {% endblock %} - </div> - <!-- End of Header --> - <div id="content"> - {% block content %} {% endblock %} - </div> - {% block footer %} {% endblock %} - </body> + {% endblock %} + </div> + <!-- End of Header --> + <div id="content"> + {% block content %} {% endblock %} + </div> + {% block footer %} {% endblock %} + </body> - <script src="{{ STATIC_URL }}/js/libs/jquery-1.7.1.min.js"></script> - {% block additionaljs %} {% endblock %} + <script src="{{ STATIC_URL }}/js/libs/jquery-1.7.1.min.js"></script> + {% block additionaljs %} {% endblock %} </html> diff --git a/templates/index.html b/templates/index.html index 6c0b831..87ba148 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,18 +1,18 @@ {% extends "base.html" %} {% load i18n %} {% block content %} - <h1>{% trans 'Lists' %}</h1> +<h1>{% trans 'Lists' %}</h1> - <table class="table table-bordered table-striped"> - <tbody> - {% for mlist in lists %} - <tr> - <td>{{ mlist }}</td> - <td><a href="/list/{{mlist}}"> Overview </a></td> - <td><a href="/archives/{{mlist}}"> Archives </a></td> - </tr> - {% endfor %} - </tbody> - </table> +<table class="table table-bordered table-striped"> + <tbody> + {% for mlist in lists %} + <tr> + <td>{{ mlist }}</td> + <td><a href="/list/{{mlist}}"> Overview </a></td> + <td><a href="/archives/{{mlist}}"> Archives </a></td> + </tr> + {% endfor %} + </tbody> +</table> {% endblock %} diff --git a/templates/lists/list_nav.html b/templates/lists/list_nav.html index 44ece68..ab16818 100644 --- a/templates/lists/list_nav.html +++ b/templates/lists/list_nav.html @@ -1,20 +1,28 @@ {% if month_participants and month_discussions %} - <ul class="inline-block" id="top_right"> - <li class="participant">{{month_participants}} participants</li> - <li class="discussion">{{month_discussions}} discussions</li> - <li class="saved">1 saved</li> - </ul> +<ul class="inline-block" id="top_right"> + <li class="participant"> + {{month_participants}} participants + </li> + <li class="discussion"> + {{month_discussions}} discussions + </li> + <li class="saved"> + 1 saved + </li> +</ul> {% endif %}</div> {% if list_address %} - <p id="list_email"> - <a href="mailto:{{list_address}}">{{list_address}}</a> - </p> - <p id="list_email" class='inline'> +<p id="list_email"> + <a href="mailto:{{list_address}}">{{list_address}}</a> +</p> +<p id="list_email" class='inline'> <a href="/"> All lists </a> - </p> - <div id="searchbox"> - <form action="/search/{{list_address}}" method="get">{{ search_form }}</form> - </div> +</p> +<div id="searchbox"> + <form action="/search/{{list_address}}" method="get"> + {{ search_form }} + </form> +</div> {% endif %} diff --git a/templates/login.html b/templates/login.html index 9142d7a..1adace9 100644 --- a/templates/login.html +++ b/templates/login.html @@ -2,61 +2,61 @@ {% load i18n %} {% block content %} - - <h2>Login with username and password</h2> - <form action="" method="post" class="login mm_clear"> {% csrf_token %} - {{ form.as_p }} - <div class="field"> - <button class="btn btn-primary" type="submit">{% trans "Login" %}</button> - </div> - </form> +<h2>Login with username and password</h2> - <hr /> +<form action="" method="post" class="login mm_clear"> + {% csrf_token %} + {{ form.as_p }} + <div class="field"> + <button class="btn btn-primary" type="submit"> + {% trans "Login" %} + </button> + </div> +</form> - <!-- - <h2>Login using OpenID</h2> +<hr /> - <form method="post" action="{% url socialauth_begin 'openid' %}"> {% csrf_token %} - OpenID URL: <input type="text" name="openid_identifier" /> - <input type="submit" value="Login using OpenID" /> - </form> +<!-- +<h2>Login using OpenID</h2> - <hr /> - --> +<form method="post" action="{% url socialauth_begin 'openid' %}"> {% csrf_token %} +OpenID URL: <input type="text" name="openid_identifier" /> +<input type="submit" value="Login using OpenID" /> +</form> - <h2>Login using BrowserID</h2> +<hr /> +--> - <form method="post" action="{% url socialauth_complete "browserid" %}"> {% csrf_token %} - <input type="hidden" name="assertion" value="" /> - <a rel="nofollow" id="browserid" href="#"><img src="{{ STATIC_URL }}postorius/default/img/sign_in_blue.png" alt="Login using BrowserID" /></a> - </form> +<h2>Login using BrowserID</h2> + +<form method="post" action="{% url socialauth_complete "browserid" %}"> + {% csrf_token %} + <input type="hidden" name="assertion" value="" /> + <a rel="nofollow" id="browserid" href="#"><img src="{{ STATIC_URL }}postorius/default/img/sign_in_blue.png" alt="Login using BrowserID" /></a> +</form> {% endblock %} {% block additionaljs %} <!-- Include BrowserID JavaScript --> <script src="https://browserid.org/include.js" type="text/javascript"></script> <!-- Setup click handler that receives BrowserID assertion code and sends - POST data --> +POST data --> <script type="text/javascript"> - $(function () { - $('#browserid').click(function (e) { - e.preventDefault(); - var self = $(this); - - navigator.id.get(function (assertion) { - if (assertion) { - self.parent('form') - .find('input[type=hidden]') - .attr('value', assertion) - .end() - .submit(); - } else { - alert('Some error occurred'); - } - }); - }); - }); + $(function() { + $('#browserid').click(function(e) { + e.preventDefault(); + var self = $(this); + + navigator.id.get(function(assertion) { + if (assertion) { + self.parent('form').find('input[type=hidden]').attr('value', assertion).end().submit(); + } else { + alert('Some error occurred'); + } + }); + }); + }); </script> <!-- end browserid stuff --> {% endblock additionaljs %} diff --git a/templates/message.html b/templates/message.html index 70aa67e..58187c0 100644 --- a/templates/message.html +++ b/templates/message.html @@ -2,49 +2,58 @@ {% load gravatar %} {% block additional_stylesheets %} - <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/thread.css" /> +<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/thread.css" /> {% endblock %} {% block content %} - <section id="thread_content"> +<section id="thread_content"> {% include 'messages/first_email.html' with first_mail=message %} - </section> +</section> {% endblock %} {% block additionaljs %} - <script type="text/javascript"> - +<script type="text/javascript"> $(document).ready(function() { - $(".voteup").click(function(){ - // @TODO: Extract the message id from the HTML DOM element instead of hard coding it in Javascript. - message_id = this.parentElement.getAttribute('messageid'); - $.ajax({ - type: "POST", - url: '/vote/{{list_address}}/', - data: { vote : 1, messageid : message_id, list: "{{list_address}}", csrfmiddlewaretoken: '{{ csrf_token }}' }, - success: function(response){ - alert(response); - } - }); - return false; - }); - - $(".votedown").click(function(){ - message_id = this.parentElement.getAttribute('messageid'); - $.ajax({ - type: "POST", - url: '/vote/{{list_address}}/', - data: { vote : -1, messageid : message_id , list: "{{list_address}}", csrfmiddlewaretoken: '{{ csrf_token }}' }, - success: function(response){ - alert(response); - } - }); - return false; - }); - - }); - </script> + $(".voteup").click(function() { + // @TODO: Extract the message id from the HTML DOM element instead of hard coding it in Javascript. + message_id = this.parentElement.getAttribute('messageid'); + $.ajax({ + type : "POST", + url : '/vote/{{list_address}}/', + data : { + vote : 1, + messageid : message_id, + list : "{{list_address}}", + csrfmiddlewaretoken : '{{ csrf_token }}' + }, + success : function(response) { + alert(response); + } + }); + return false; + }); + + $(".votedown").click(function() { + message_id = this.parentElement.getAttribute('messageid'); + $.ajax({ + type : "POST", + url : '/vote/{{list_address}}/', + data : { + vote : -1, + messageid : message_id, + list : "{{list_address}}", + csrfmiddlewaretoken : '{{ csrf_token }}' + }, + success : function(response) { + alert(response); + } + }); + return false; + }); + + }); +</script> {% endblock %} diff --git a/templates/messages/message.html b/templates/messages/message.html index 2c1fb6c..ab30099 100644 --- a/templates/messages/message.html +++ b/templates/messages/message.html @@ -1,25 +1,29 @@ {% load gravatar %} - <div class="email_header"> - {% gravatar_img_for_email email.email 40 %} - <div class="email_author inline-block"> - <span class="name"> - <a href="/message/{{list_address}}/{{email.message_id}}">{{email.sender}}</a> - </span> - <br /> - <span class="rank">Rank 8</span> - </div> - <div class="email_date inline-block right"> - <span class="date">{{email.date}}</span> - <br /> - </div> - </div> - <div class="email_body"> - {{email.content}} - </div> - <ul class="email_info inline" messageid="{{email.message_id}}"> - <li class="neutral"> +{{email.likes}}/-{{email.dislikes}}</li> - <li class="voteup"> <a href="#like"> Like</a></li> - <li class="votedown"> <a href="#dislike"> Dislike</a></li> - </ul> +<div class="email_header"> + {% gravatar_img_for_email email.email 40 %} + <div class="email_author inline-block"> + <span class="name"> <a href="/message/{{list_address}}/{{email.message_id}}">{{email.sender}}</a> </span> + <br /> + <span class="rank">Rank 8</span> + </div> + <div class="email_date inline-block right"> + <span class="date">{{email.date}}</span> + <br /> + </div> +</div> +<div class="email_body"> + {{email.content}} +</div> +<ul class="email_info inline" messageid="{{email.message_id}}"> + <li class="neutral"> + +{{email.likes}}/-{{email.dislikes}} + </li> + <li class="voteup"> + <a href="#like"> Like</a> + </li> + <li class="votedown"> + <a href="#dislike"> Dislike</a> + </li> +</ul> diff --git a/templates/month_view.html b/templates/month_view.html index ba88524..5ba2445 100644 --- a/templates/month_view.html +++ b/templates/month_view.html @@ -4,99 +4,108 @@ {% block content %} - <div id="recent_activities"> - {% for email in threads %} - <!-- New thread --> - <div class="thread"> - <div class="notsaved"> - <span class="thread_title"> - <a name="{{email.thread_id}}" - href="/thread/{{list_address}}/{{email.thread_id}}"> - {{email.subject}} - </a> - </span> - <span class="thread_date"> {{email.date}}</span> - </div> - <div class="thread_content"> - {% if email.category_tag %} - <div class="inline-block type type_{{email.category_tag}}"> - <a href="/tag/{{list_address}}/{{email.category_tag}}"> {{email.category}} </a> - </div> - {% else %} - <div class="inline-block type type_{{email.category|lower}}"> - <a href="/tag/{{list_address}}/{{email.category|lower}}"> {{email.category}} </a> - </div> - {% endif %} - <div class="inline-block gravatar"> - {% if email.email %} - {% gravatar_img_for_email email.email 40 %} <br /> - {% endif %} - {{email.sender}} - </div> - <div class="inline-block thread_email"> - <span class="expander"> - {{email.content}} - </span> - </div> - </div> - <div class="thread_info"> - <ul class="tags inline"> - <li>Tags:</li> - {% for tag in email.tags %} - <li> <a href="/tag/{{list_address}}/{{tag}}">{{tag}}</a></li> - {% endfor %} - </ul> - <ul class="inline-block"> - <li class="participant"> {{email.participants|length}} participants</li> - <li class="discussion"> {{email.answers}} comments</li> - </ul> - <ul class="inline-block"> - <li class="like"> +{{email.liked}}</li> - <li class="youlike"> <a href="#like"> Like</a></li> - <li class="youdislike"> <a href="#dislike"> Dislike</a></li> - {% if email.answers %} - <li class="showdiscussion"> <a href="#show"> Show discussion</a></li> - {% else %} - <li class="showdiscussion invisible"> <a href="#show"> Show discussion</a></li> - {% endif %} - </ul> - </div> - </div> - <!-- End of thread --> - {% empty %} - Sorry no emails could be found for your search. - {% endfor %} - </div> - <div id="archives"> - {% for key, value in archives_length|sort %} - <h3>{{ key }}</h3> - <div> - <ul> - {% for ar_month in value %} - <li> - <a href="/archives/{{list_address}}/{{key}}/{{ar_month}}"> - {{ ar_month|tomonth }} - </a> - </li> - {% endfor %} - </ul> - </div> - {% endfor %} - </div> - +<div id="recent_activities"> + {% for email in threads %} + <!-- New thread --> + <div class="thread"> + <div class="notsaved"> + <span class="thread_title"> <a name="{{email.thread_id}}" + href="/thread/{{list_address}}/{{email.thread_id}}"> {{email.subject}} </a> </span> + <span class="thread_date"> {{email.date}}</span> + </div> + <div class="thread_content"> + {% if email.category_tag %} + <div class="inline-block type type_{{email.category_tag}}"> + <a href="/tag/{{list_address}}/{{email.category_tag}}"> {{email.category}} </a> + </div> + {% else %} + <div class="inline-block type type_{{email.category|lower}}"> + <a href="/tag/{{list_address}}/{{email.category|lower}}"> {{email.category}} </a> + </div> + {% endif %} + <div class="inline-block gravatar"> + {% if email.email %} + {% gravatar_img_for_email email.email 40 %} + <br /> + {% endif %} + {{email.sender}} + </div> + <div class="inline-block thread_email"> + <span class="expander"> {{email.content}} </span> + </div> + </div> + <div class="thread_info"> + <ul class="tags inline"> + <li> + Tags: + </li> + {% for tag in email.tags %} + <li> + <a href="/tag/{{list_address}}/{{tag}}">{{tag}}</a> + </li> + {% endfor %} + </ul> + <ul class="inline-block"> + <li class="participant"> + {{email.participants|length}} participants + </li> + <li class="discussion"> + {{email.answers}} comments + </li> + </ul> + <ul class="inline-block"> + <li class="like"> + +{{email.liked}} + </li> + <li class="youlike"> + <a href="#like"> Like</a> + </li> + <li class="youdislike"> + <a href="#dislike"> Dislike</a> + </li> + {% if email.answers %} + <li class="showdiscussion"> + <a href="#show"> Show discussion</a> + </li> + {% else %} + <li class="showdiscussion invisible"> + <a href="#show"> Show discussion</a> + </li> + {% endif %} + </ul> + </div> + </div> + <!-- End of thread --> + {% empty %} + Sorry no emails could be found for your search. + {% endfor %} +</div> +<div id="archives"> + {% for key, value in archives_length|sort %} + <h3>{{ key }}</h3> + <div> + <ul> + {% for ar_month in value %} + <li> + <a href="/archives/{{list_address}}/{{key}}/{{ar_month}}"> {{ ar_month|tomonth }} </a> + </li> + {% endfor %} + </ul> + </div> + {% endfor %} +</div> {% endblock %} {% block additionaljs %} - <script src="{{ STATIC_URL }}jquery.expander.js"></script> - <script> - $(document).ready(function() { - $('span.expander').expander({ - userCollapseText: 'View Less', - expandText: 'View More' - }); - }); - </script> +<script src="{{ STATIC_URL }}jquery.expander.js"></script> +<script> + $(document).ready(function() { + $('span.expander').expander({ + userCollapseText : 'View Less', + expandText : 'View More' + }); + }); +</script> {% endblock %} - diff --git a/templates/recent_activities.html b/templates/recent_activities.html index 787c102..f52a49c 100644 --- a/templates/recent_activities.html +++ b/templates/recent_activities.html @@ -3,210 +3,207 @@ {% load gravatar %} {% block additional_stylesheets %} - <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/stats.css" /> +<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/stats.css" /> {% endblock %} {% block content %} - <section id="recent_activities"> - <section id="graph"> - <div id="fig"> - <script type="text/javascript+protovis" > - -var dates = ["{{dates_string|join:'","'}}"]; - - - -var data = {{evolution}}, - w = 500, - h = 300, - x = pv.Scale.ordinal(pv.range(32)).splitBanded(0, w, 4/5), - y = pv.Scale.linear(0, {{evolution|length}}).range(0, h); - -var vis = new pv.Panel() - .width(w) - .height(250) - .bottom(60) - .left(30) - .right(5) - .top(5); - -var bar = vis.add(pv.Bar) - .data(data) - .event("click", function(n) self.location = "/archives/{{list_address}}/" + dates[this.index]) - .left(function() x(this.index)) - .width(x.range().band) - .bottom(0) - .height(y); - -bar.anchor("bottom").add(pv.Label) - .textMargin(5) - .textAlign("right") - .textBaseline("middle") - .textAngle(-Math.PI / 3) - .text(function() xlabel(this.index)); - -function xlabel(ind){ - if (!dates[ind -1]){ - return dates[ind]; - } - prev = dates[ind - 1]; - cur = dates[ind]; - if (prev.substring(0,7) == cur.substring(0,7)){ - cur = cur.substring(8); - } - return cur; -} - -var title = vis.add(pv.Label) - .left(250) - .top(16) - .textAlign("center") - .text("Activities on the list over the last 30 days"); - -vis.add(pv.Rule) - .data(y.ticks()) - .bottom(function(d) Math.round(y(d)) - .5) - .strokeStyle(function(d) d ? "rgba(255,255,255,.3)" : "#000") - .add(pv.Rule) - .left(0) - .width(5) - .strokeStyle("#000") - .anchor("left").add(pv.Label) - .text(function(d) d.toFixed(1)); - -vis.render(); - - </script> - </div> - </section> - <section id="most_active"> - <h2>Recently active discussions</h2> - {% for email in most_active_threads %} - <!-- Start thread --> - <div class="thread"> - <span class="thread_id">#{{forloop.counter}}</span> - <span class="thread_title"> - <a name="{{email.thread_id}}" - href="/thread/{{list_address}}/{{email.thread_id}}"> - {{email.subject}} - </a> - </span> - <div class="thread_stats"> - <ul class="inline-block"> - {% if email.category_tag %} - <li class="type type_{{email.category_tag}}"> - <a href="/tag/{{list_address}}/{{email.category_tag}}"> - {{email.category}} - </a> - </li> - {% else %} - <li class="type type_{{email.category|lower}}"> - <a href="/tag/{{list_address}}/{{email.category|lower}}"> - {{email.category}} - </a> - </li> - {% endif %} - <li class="neutral"> 0 </li> - <li class="participant"> {{email.participants|length}} </li> - <li class="discussion"> {{email.answers}} </li> - </ul> - </div> - </div> - <!-- End thread --> - {% endfor %} - </section> - - - <section id="top_discussion"> - <h2>Top discussions the last 30 days</h2> - {% for email in top_threads %} - <!-- Start thread --> - <div class="thread"> - <span class="thread_id">#{{forloop.counter}}</span> - <span class="thread_title"> - <a name="{{email.thread_id}}" - href="/thread/{{list_address}}/{{email.thread_id}}"> - {{email.subject}} - </a> - </span> - <div class="thread_stats"> - <ul class="inline-block"> - {% if email.category_tag %} - <li class="type type_{{email.category_tag}}"> - <a href="/tag/{{list_address}}/{{email.category_tag}}"> - {{email.category}} - </a> - </li> - {% else %} - <li class="type type_{{email.category|lower}}"> - <a href="/tag/{{list_address}}/{{email.category|lower}}"> - {{email.category}} - </a> - </li> - {% endif %} - <li class="neutral"> 0 </li> - <li class="participant"> {{email.participants|length}} </li> - <li class="discussion"> {{email.answers}} </li> - </ul> - </div> - </div> - <!-- End thread --> - {% endfor %} - </section> - - <section id="discussion_marker"> - <h2>Prominent discussion maker</h2> - {% for author in top_author %} - <!-- Start discussion maker --> - <div class="maker"> - <div class="inline-block maker_id"> #{{forloop.counter}} </div> - <div class="inline-block gravatar"> - {% if author.email %} - {% gravatar_img_for_email author.email 40 %} <br /> - {% endif %} - </div> - <div class="inline-block"> - <span class="marker_name">{{author.name}}</span> <br /> - <span class="score">+{{author.kudos}}</span> kudos - </div> - </div> - <!-- End discussion maker --> - {% endfor %} - - <h2>Tag cloud</h2> - </section> - - <section id="discussion_by_topic"> - <h2>Discussion by topic the last 30 days</h2> - {% for category, thread in threads_per_category.items %} - <div> - <h2 class="category type_{{category}}"> {{category}} </h2> - <ul class="category_entry"> - {% for email in thread %} - <li>{{email.title}}</li> - {% endfor %} - </ul> - </div> - {% endfor %} - </section> - </section> - <section id="archives"> - {% for key, value in archives_length|sort %} - <h3>{{ key }}</h3> - <div> - <ul> - {% for ar_month in value %} - <li> - <a href="/archives/{{list_address}}/{{key}}/{{ar_month}}"> - {{ ar_month|tomonth }} - </a> - </li> - {% endfor %} - </ul> - </div> - {% endfor %} - </section> +<section id="recent_activities"> + <section id="graph"> + <div id="fig"> + <script type="text/javascript+protovis" > + + var dates = ["{{dates_string|join:'","'}}"]; + + var data = {{evolution}}, + w = 500, + h = 300, + x = pv.Scale.ordinal(pv.range(32)).splitBanded(0, w, 4/5), + y = pv.Scale.linear(0, {{evolution|length}}).range(0, h); + + var vis = new pv.Panel() + .width(w) + .height(250) + .bottom(60) + .left(30) + .right(5) + .top(5); + + var bar = vis.add(pv.Bar) + .data(data) + .event("click", function(n) self.location = "/archives/{{list_address}}/" + dates[this.index]) + .left(function() x(this.index)) + .width(x.range().band) + .bottom(0) + .height(y); + + bar.anchor("bottom").add(pv.Label) + .textMargin(5) + .textAlign("right") + .textBaseline("middle") + .textAngle(-Math.PI / 3) + .text(function() xlabel(this.index)); + + function xlabel(ind){ + if (!dates[ind -1]){ + return dates[ind]; + } + prev = dates[ind - 1]; + cur = dates[ind]; + if (prev.substring(0,7) == cur.substring(0,7)){ + cur = cur.substring(8); + } + return cur; + } + + var title = vis.add(pv.Label) + .left(250) + .top(16) + .textAlign("center") + .text("Activities on the list over the last 30 days"); + + vis.add(pv.Rule) + .data(y.ticks()) + .bottom(function(d) Math.round(y(d)) - .5) + .strokeStyle(function(d) d ? "rgba(255,255,255,.3)" : "#000") + .add(pv.Rule) + .left(0) + .width(5) + .strokeStyle("#000") + .anchor("left").add(pv.Label) + .text(function(d) d.toFixed(1)); + + vis.render(); + + </script> + </div> + </section> + <section id="most_active"> + <h2>Recently active discussions</h2> + {% for email in most_active_threads %} + <!-- Start thread --> + <div class="thread"> + <span class="thread_id">#{{forloop.counter}}</span> + <span class="thread_title"> <a name="{{email.thread_id}}" + href="/thread/{{list_address}}/{{email.thread_id}}"> {{email.subject}} </a> </span> + <div class="thread_stats"> + <ul class="inline-block"> + {% if email.category_tag %} + <li class="type type_{{email.category_tag}}"> + <a href="/tag/{{list_address}}/{{email.category_tag}}"> {{email.category}} </a> + </li> + {% else %} + <li class="type type_{{email.category|lower}}"> + <a href="/tag/{{list_address}}/{{email.category|lower}}"> {{email.category}} </a> + </li> + {% endif %} + <li class="neutral"> + 0 + </li> + <li class="participant"> + {{email.participants|length}} + </li> + <li class="discussion"> + {{email.answers}} + </li> + </ul> + </div> + </div> + <!-- End thread --> + {% endfor %} + </section> + + <section id="top_discussion"> + <h2>Top discussions the last 30 days</h2> + {% for email in top_threads %} + <!-- Start thread --> + <div class="thread"> + <span class="thread_id">#{{forloop.counter}}</span> + <span class="thread_title"> <a name="{{email.thread_id}}" + href="/thread/{{list_address}}/{{email.thread_id}}"> {{email.subject}} </a> </span> + <div class="thread_stats"> + <ul class="inline-block"> + {% if email.category_tag %} + <li class="type type_{{email.category_tag}}"> + <a href="/tag/{{list_address}}/{{email.category_tag}}"> {{email.category}} </a> + </li> + {% else %} + <li class="type type_{{email.category|lower}}"> + <a href="/tag/{{list_address}}/{{email.category|lower}}"> {{email.category}} </a> + </li> + {% endif %} + <li class="neutral"> + 0 + </li> + <li class="participant"> + {{email.participants|length}} + </li> + <li class="discussion"> + {{email.answers}} + </li> + </ul> + </div> + </div> + <!-- End thread --> + {% endfor %} + </section> + + <section id="discussion_marker"> + <h2>Prominent discussion maker</h2> + {% for author in top_author %} + <!-- Start discussion maker --> + <div class="maker"> + <div class="inline-block maker_id"> + #{{forloop.counter}} + </div> + <div class="inline-block gravatar"> + {% if author.email %} + {% gravatar_img_for_email author.email 40 %} + <br /> + {% endif %} + </div> + <div class="inline-block"> + <span class="marker_name">{{author.name}}</span> + <br /> + <span class="score">+{{author.kudos}}</span> kudos + </div> + </div> + <!-- End discussion maker --> + {% endfor %} + + <h2>Tag cloud</h2> + </section> + + <section id="discussion_by_topic"> + <h2>Discussion by topic the last 30 days</h2> + {% for category, thread in threads_per_category.items %} + <div> + <h2 class="category type_{{category}}"> {{category}} </h2> + <ul class="category_entry"> + {% for email in thread %} + <li> + {{email.title}} + </li> + {% endfor %} + </ul> + </div> + {% endfor %} + </section> +</section> +<section id="archives"> + {% for key, value in archives_length|sort %} + <h3>{{ key }}</h3> + <div> + <ul> + {% for ar_month in value %} + <li> + <a href="/archives/{{list_address}}/{{key}}/{{ar_month}}"> {{ ar_month|tomonth }} </a> + </li> + {% endfor %} + </ul> + </div> + {% endfor %} +</section> {% endblock %} {% block addtionaljs %} diff --git a/templates/search.html b/templates/search.html index c173ebf..e0e4f8c 100644 --- a/templates/search.html +++ b/templates/search.html @@ -4,112 +4,103 @@ {% block content %} - {% if threads.object_list %} - <div class="pagination"> - <span class="step-links"> - {% if threads.has_previous %} - <a href="{{full_path|strip_page}}/{{ threads.previous_page_number }}">previous</a> - {% endif %} +{% if threads.object_list %} +<div class="pagination"> + <span class="step-links"> {% if threads.has_previous %} <a href="{{full_path|strip_page}}/{{ threads.previous_page_number }}">previous</a> {% endif %} <span class="current"> Page {{ threads.number }} of {{ threads.paginator.num_pages }}. </span> {% if threads.has_next %} <a href="{{full_path|strip_page}}/{{ threads.next_page_number }}">next</a> {% endif %} </span> +</div> +{% endif %} - <span class="current"> - Page {{ threads.number }} of {{ threads.paginator.num_pages }}. - </span> +{% for email in threads.object_list %} +<!-- New thread --> +<div class="thread"> + <div class="notsaved"> + <a href="/thread/{{list_address}}/{{email.thread_id}}"> <span class="thread_title">{{email.subject}}</span> </a> + <span class="thread_date">{{email.date}}</span> + </div> + <div class="thread_content"> + {% if email.category_tag %} + <div class="inline-block type type_{{email.category_tag}}"> + <a href="/tag/{{list_address}}/{{email.category_tag}}"> {{email.category}} </a> + </div> + {% else %} + <div class="inline-block type type_{{email.category|lower}}"> + <a href="/tag/{{list_address}}/{{email.category|lower}}"> {{email.category}} </a> + </div> + {% endif %} + <div class="inline-block gravatar"> + {% if email.email %} + {% gravatar_img_for_email email.email 40 %} + <br /> + {% endif %} + {{email.sender}} + </div> + <div class="inline-block thread_email"> + <span class="expander"> {{email.content}} </span> + </div> + </div> + <div class="thread_info"> + <ul class="tags inline"> + <li> + Tags: + </li> + {% for tag in email.tags %} + <li> + <a href="/tag/{{list_address}}/{{tag}}">{{tag}}</a> + </li> + {% endfor %} + </ul> + <ul class="inline-block"> + <li class="participant"> + {{email.participants|length}} participants + </li> + <li class="discussion"> + {{email.answers}} comments + </li> + </ul> + <ul class="inline-block"> + <li class="like"> + +{{email.liked}} + </li> + <li class="youlike"> + <a href="#like"> Like</a> + </li> + <li class="youdislike"> + <a href="#dislike"> Dislike</a> + </li> + {% if email.answers %} + <li class="showdiscussion"> + <a href="#show"> Show discussion</a> + </li> + {% else %} + <li class="showdiscussion invisible"> + <a href="#show"> Show discussion</a> + </li> + {% endif %} + </ul> + </div> +</div> +<!-- End of thread --> +{% empty %} +Sorry no emails could be found for your search. +{% endfor %} - {% if threads.has_next %} - <a href="{{full_path|strip_page}}/{{ threads.next_page_number }}">next</a> - {% endif %} - </span> - </div> - {% endif %} - - {% for email in threads.object_list %} - <!-- New thread --> - <div class="thread"> - <div class="notsaved"> - <a href="/thread/{{list_address}}/{{email.thread_id}}"> - <span class="thread_title">{{email.subject}}</span> - </a> - <span class="thread_date">{{email.date}}</span> - </div> - <div class="thread_content"> - {% if email.category_tag %} - <div class="inline-block type type_{{email.category_tag}}"> - <a href="/tag/{{list_address}}/{{email.category_tag}}"> {{email.category}} </a> - </div> - {% else %} - <div class="inline-block type type_{{email.category|lower}}"> - <a href="/tag/{{list_address}}/{{email.category|lower}}"> {{email.category}} </a> - </div> - {% endif %} - <div class="inline-block gravatar"> - {% if email.email %} - {% gravatar_img_for_email email.email 40 %} <br /> - {% endif %} - {{email.sender}} - </div> - <div class="inline-block thread_email"> - <span class="expander"> - {{email.content}} - </span> - </div> - </div> - <div class="thread_info"> - <ul class="tags inline"> - <li>Tags:</li> - {% for tag in email.tags %} - <li> <a href="/tag/{{list_address}}/{{tag}}">{{tag}}</a></li> - {% endfor %} - </ul> - <ul class="inline-block"> - <li class="participant"> {{email.participants|length}} participants</li> - <li class="discussion"> {{email.answers}} comments</li> - </ul> - <ul class="inline-block"> - <li class="like"> +{{email.liked}}</li> - <li class="youlike"> <a href="#like"> Like</a></li> - <li class="youdislike"> <a href="#dislike"> Dislike</a></li> - {% if email.answers %} - <li class="showdiscussion"> <a href="#show"> Show discussion</a></li> - {% else %} - <li class="showdiscussion invisible"> <a href="#show"> Show discussion</a></li> - {% endif %} - </ul> - </div> - </div> - <!-- End of thread --> - {% empty %} - Sorry no emails could be found for your search. - {% endfor %} - - {% if threads.object_list %} - <div class="pagination"> - <span class="step-links"> - {% if threads.has_previous %} - <a href="{{ threads.previous_page_number }}">previous</a> - {% endif %} - - <span class="current"> - Page {{ threads.number }} of {{ threads.paginator.num_pages }}. - </span> - - {% if threads.has_next %} - <a href="{{ threads.next_page_number }}">next</a> - {% endif %} - </span> - </div> - {% endif %} +{% if threads.object_list %} +<div class="pagination"> + <span class="step-links"> {% if threads.has_previous %} <a href="{{ threads.previous_page_number }}">previous</a> {% endif %} <span class="current"> Page {{ threads.number }} of {{ threads.paginator.num_pages }}. </span> {% if threads.has_next %} <a href="{{ threads.next_page_number }}">next</a> {% endif %} </span> +</div> +{% endif %} {% endblock %} {% block additionaljs %} - <script src="{{ STATIC_URL }}jquery.expander.js"></script> - <script> - $(document).ready(function() { - $('span.expander').expander({ - userCollapseText: 'View Less', - expandText: 'View More' - }); - }); - </script> +<script src="{{ STATIC_URL }}jquery.expander.js"></script> +<script> + $(document).ready(function() { + $('span.expander').expander({ + userCollapseText : 'View Less', + expandText : 'View More' + }); + }); +</script> {% endblock %} diff --git a/templates/thread.html b/templates/thread.html index 8ffd5ea..508b03a 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -3,84 +3,91 @@ {% load gravatar %} {% block additional_stylesheets %} - <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/thread.css" /> +<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/thread.css" /> {% endblock %} {% block content %} - <div class="content"> - - {% include 'threads/right_col.html' %} +<div class="content"> - <!-- main section, the email thread --> - <section id="thread_content"> + {% include 'threads/right_col.html' %} - <!-- Start first email --> - {% include 'messages/first_email.html' %} - <!-- End first email --> + <!-- main section, the email thread --> + <section id="thread_content"> - {% for email in threads %} - <!-- Start email --> - <div class="even"> + <!-- Start first email --> + {% include 'messages/first_email.html' %} + <!-- End first email --> + + {% for email in threads %} + <!-- Start email --> + <div class="even"> {% include 'messages/message.html' %} </div> - <!-- End of email --> + <!-- End of email --> - {% empty %} - Sorry no emails could be found for your search. - {% endfor %} + {% empty %} + Sorry no emails could be found for your search. + {% endfor %} - </section> + </section> - </div> <!-- end of content --> +</div> +<!-- end of content --> {% endblock %} - - {% block additionaljs %} - <script src="{{ STATIC_URL }}jquery.expander.js"></script> - <script type="text/javascript"> - $(document).ready(function() { - $('div.email_body').expander({ - userCollapseText: 'View Less', - expandText: 'View More' - }); - }); - </script> - - - <script type="text/javascript"> - +<script src="{{ STATIC_URL }}jquery.expander.js"></script> +<script type="text/javascript"> + $(document).ready(function() { + $('div.email_body').expander({ + userCollapseText : 'View Less', + expandText : 'View More' + }); + }); +</script> + +<script type="text/javascript"> $(document).ready(function() { - $(".voteup").click(function(){ - // @TODO: Extract the message id from the HTML DOM element instead of hard coding it in Javascript. - message_id = this.parentElement.getAttribute('messageid'); - $.ajax({ - type: "POST", - url: '/vote/{{list_address}}/', - data: { vote : 1, messageid : message_id, list: "{{list_address}}", csrfmiddlewaretoken: '{{ csrf_token }}' }, - success: function(response){ - alert(response); - } - }); - return false; - }); - - $(".votedown").click(function(){ - message_id = this.parentElement.getAttribute('messageid'); - $.ajax({ - type: "POST", - url: '/vote/{{list_address}}/', - data: { vote : -1, messageid : message_id , list: "{{list_address}}", csrfmiddlewaretoken: '{{ csrf_token }}' }, - success: function(response){ - alert(response); - } - }); - return false; - }); - - }); - </script> + $(".voteup").click(function() { + // @TODO: Extract the message id from the HTML DOM element instead of hard coding it in Javascript. + message_id = this.parentElement.getAttribute('messageid'); + $.ajax({ + type : "POST", + url : '/vote/{{list_address}}/', + data : { + vote : 1, + messageid : message_id, + list : "{{list_address}}", + csrfmiddlewaretoken : '{{ csrf_token }}' + }, + success : function(response) { + alert(response); + } + }); + return false; + }); + + $(".votedown").click(function() { + message_id = this.parentElement.getAttribute('messageid'); + $.ajax({ + type : "POST", + url : '/vote/{{list_address}}/', + data : { + vote : -1, + messageid : message_id, + list : "{{list_address}}", + csrfmiddlewaretoken : '{{ csrf_token }}' + }, + success : function(response) { + alert(response); + } + }); + return false; + }); + + }); +</script> {% endblock %} diff --git a/templates/threads/add_tag_form.html b/templates/threads/add_tag_form.html index da1014d..65f6577 100644 --- a/templates/threads/add_tag_form.html +++ b/templates/threads/add_tag_form.html @@ -3,9 +3,11 @@ {% block header %} {% endblock %} {% block content %} - <form action="/addtag/{{list_address}}/{{email_id}}/" method="post"> - {% csrf_token %} - {{ addtag_form }} - <button type="submit">Add</button> - </form> +<form action="/addtag/{{list_address}}/{{email_id}}/" method="post"> + {% csrf_token %} + {{ addtag_form }} + <button type="submit"> + Add + </button> +</form> {% endblock %} diff --git a/templates/threads/right_col.html b/templates/threads/right_col.html index 200e47a..9a1e448 100644 --- a/templates/threads/right_col.html +++ b/templates/threads/right_col.html @@ -1,48 +1,60 @@ {% load gravatar %} <!-- right column --> - <section id="thread_overview_info"> - <!-- Start dates --> - <div id="thread_date_info"> - <div class="days_num inline-block">21</div> - <div class="days_text inline-block"> - days<br /> inactive - </div> - <div id="days_old" class="days_num inline-block">24</div> - <div class="days_text inline-block"> - days <br /> old - </div> - </div> - <p id="add_to_fav"> - <a href="#AddFav" class="notsaved">Add to favorite discussions</a> - </p> - <!-- End dates --> - <hr id="grey"/> - <div id="tags"> - <span id="tag_title">tags </span>({{tags|length}}) - <ul class="inline"> - {% for tag in tags %} - <li> {{ tag }} |</li> - {% endfor %} - </ul> - </div> - <div id="add_tag"> - <form action="/addtag/{{list_address}}/{{first_mail.message_id}}/" method="post"> - {% csrf_token %} - {{ addtag_form.as_p }} - <button type="submit">Add a tag</button> - </form> - </div> - <div id="participants"> - <span id="participants_title"> participants </span>({{participants|length}}) - <ul> - {% for key,value in participants.items %} - <li> - {% gravatar_img_for_email value.email 20%} - {{key}} - </li> - {% endfor %} - </ul> - </div> - </section> +<section id="thread_overview_info"> + <!-- Start dates --> + <div id="thread_date_info"> + <div class="days_num inline-block"> + 21 + </div> + <div class="days_text inline-block"> + days + <br /> + inactive + </div> + <div id="days_old" class="days_num inline-block"> + 24 + </div> + <div class="days_text inline-block"> + days + <br /> + old + </div> + </div> + <p id="add_to_fav"> + <a href="#AddFav" class="notsaved">Add to favorite discussions</a> + </p> + <!-- End dates --> + <hr id="grey"/> + <div id="tags"> + <span id="tag_title">tags </span>({{tags|length}}) + <ul class="inline"> + {% for tag in tags %} + <li> + {{ tag }} | + </li> + {% endfor %} + </ul> + </div> + <div id="add_tag"> + <form action="/addtag/{{list_address}}/{{first_mail.message_id}}/" method="post"> + {% csrf_token %} + {{ addtag_form.as_p }} + <button type="submit"> + Add a tag + </button> + </form> + </div> + <div id="participants"> + <span id="participants_title"> participants </span>({{participants|length}}) + <ul> + {% for key,value in participants.items %} + <li> + {% gravatar_img_for_email value.email 20%} + {{key}} + </li> + {% endfor %} + </ul> + </div> +</section> diff --git a/templates/user_profile.html b/templates/user_profile.html index 70fe2bc..a4c21e9 100644 --- a/templates/user_profile.html +++ b/templates/user_profile.html @@ -1,3 +1,7 @@ {% extends "base.html" %} -{% block content %} <p> User profiles are under contruction. </p> {% endblock %} +{% block content %} +<p> + User profiles are under contruction. +</p> +{% endblock %}
\ No newline at end of file @@ -16,7 +16,7 @@ urlpatterns = patterns('', # Index url(r'^/$', 'views.pages.index', name='index'), - url(r'^$', 'views.pages.index', name='index'), + url(r'^$', 'views.pages.index', name='index'), # Archives url(r'^archives/(?P<mlist_fqdn>.*@.*)/(?P<year>\d{4})/(?P<month>\d\d?)/(?P<day>\d\d?)/$', |