From d830b1ab3d95f8598de98b2a97cfed7ed19c4175 Mon Sep 17 00:00:00 2001 From: Aamir Khan Date: Mon, 25 Jun 2012 16:17:10 -0400 Subject: Code Formatting --- templates/base.html | 93 +++++---- templates/index.html | 24 +-- templates/lists/list_nav.html | 34 +-- templates/login.html | 82 ++++---- templates/message.html | 77 ++++--- templates/messages/message.html | 48 +++-- templates/month_view.html | 189 +++++++++-------- templates/recent_activities.html | 397 ++++++++++++++++++------------------ templates/search.html | 193 +++++++++--------- templates/thread.html | 131 ++++++------ templates/threads/add_tag_form.html | 12 +- templates/threads/right_col.html | 100 +++++---- templates/user_profile.html | 6 +- 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 @@ - - - - {% block title %}{{ app_name }}{% endblock %} - - - - {% block additional_stylesheets %} {% endblock %} - - {% load i18n %} - - - -
- {% block header %} + + + + {% block title %}{{ app_name }}{% endblock %} + + + + {% block additional_stylesheets %} {% endblock %} + + {% load i18n %} -
- + + +
+ {% block header %} - {% if user.is_authenticated %} -
Logged in as: {{ user.username }}
- {% endif %} +
+ - {% if list_address %} + {% if user.is_authenticated %} +
+ Logged in as: {{ user.username }} +
+ {% endif %} + + {% if list_address %} {% include 'lists/list_nav.html' %} - {% endif %} -
+ {% endif %} +
- {% endblock %} -
- -
- {% block content %} {% endblock %} -
- {% block footer %} {% endblock %} - + {% endblock %} +
+ +
+ {% block content %} {% endblock %} +
+ {% block footer %} {% endblock %} + - - {% block additionaljs %} {% endblock %} + + {% block additionaljs %} {% endblock %} 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 %} -

{% trans 'Lists' %}

+

{% trans 'Lists' %}

- - - {% for mlist in lists %} - - - - - - {% endfor %} - -
{{ mlist }} Overview Archives
+ + + {% for mlist in lists %} + + + + + + {% endfor %} + +
{{ mlist }} Overview Archives
{% 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 %} - + {% endif %} {% if list_address %} -

- {{list_address}} -

-

+

+ {{list_address}} +

+

All lists -

- +

+ {% 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 %} - -

Login with username and password

-
{% csrf_token %} - {{ form.as_p }} -
- -
-
+

Login with username and password

-
+
+ {% csrf_token %} + {{ form.as_p }} +
+ +
+
- +
{% csrf_token %} +OpenID URL: + +
-

Login using BrowserID

+
+--> -
{% csrf_token %} - - Login using BrowserID -
+

Login using BrowserID

+ +
+ {% csrf_token %} + + Login using BrowserID +
{% endblock %} {% block additionaljs %} +POST data --> {% 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 %} - + {% endblock %} {% block content %} -
+
{% include 'messages/first_email.html' with first_mail=message %} -
+
{% endblock %} {% block additionaljs %} - + $(".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; + }); + + }); + {% 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 %} -
- {% gravatar_img_for_email email.email 40 %} - - -
-
- {{email.content}} -
- +
+ {% gravatar_img_for_email email.email 40 %} + + +
+
+ {{email.content}} +
+ 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 %} -
- {% for email in threads %} - -
-
- - - {{email.subject}} - - - {{email.date}} -
-
- {% if email.category_tag %} - - {% else %} - - {% endif %} -
- {% if email.email %} - {% gravatar_img_for_email email.email 40 %}
- {% endif %} - {{email.sender}} -
-
- - {{email.content}} - -
-
-
-
    -
  • Tags:
  • - {% for tag in email.tags %} -
  • {{tag}}
  • - {% endfor %} -
-
    -
  • {{email.participants|length}} participants
  • -
  • {{email.answers}} comments
  • -
- -
-
- - {% empty %} - Sorry no emails could be found for your search. - {% endfor %} -
-
- {% for key, value in archives_length|sort %} -

{{ key }}

-
- -
- {% endfor %} -
- +
+ {% for email in threads %} + +
+
+ {{email.subject}} + {{email.date}} +
+
+ {% if email.category_tag %} + + {% else %} + + {% endif %} +
+ {% if email.email %} + {% gravatar_img_for_email email.email 40 %} +
+ {% endif %} + {{email.sender}} +
+
+ {{email.content}} +
+
+
+
    +
  • + Tags: +
  • + {% for tag in email.tags %} +
  • + {{tag}} +
  • + {% endfor %} +
+
    +
  • + {{email.participants|length}} participants +
  • +
  • + {{email.answers}} comments +
  • +
+ +
+
+ + {% empty %} + Sorry no emails could be found for your search. + {% endfor %} +
+
+ {% for key, value in archives_length|sort %} +

{{ key }}

+
+ +
+ {% endfor %} +
{% endblock %} {% block additionaljs %} - - + + {% 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 %} - + {% endblock %} {% block content %} -
-
-
- -
-
-
-

Recently active discussions

- {% for email in most_active_threads %} - -
- #{{forloop.counter}} - - - {{email.subject}} - - -
- -
-
- - {% endfor %} -
- - -
-

Top discussions the last 30 days

- {% for email in top_threads %} - -
- #{{forloop.counter}} - - - {{email.subject}} - - -
- -
-
- - {% endfor %} -
- -
-

Prominent discussion maker

- {% for author in top_author %} - -
-
#{{forloop.counter}}
-
- {% if author.email %} - {% gravatar_img_for_email author.email 40 %}
- {% endif %} -
-
- {{author.name}}
- +{{author.kudos}} kudos -
-
- - {% endfor %} - -

Tag cloud

-
- -
-

Discussion by topic the last 30 days

- {% for category, thread in threads_per_category.items %} -
-

{{category}}

-
    - {% for email in thread %} -
  • {{email.title}}
  • - {% endfor %} -
-
- {% endfor %} -
-
-
- {% for key, value in archives_length|sort %} -

{{ key }}

-
- -
- {% endfor %} -
+
+
+
+ +
+
+
+

Recently active discussions

+ {% for email in most_active_threads %} + +
+ #{{forloop.counter}} + {{email.subject}} +
+ +
+
+ + {% endfor %} +
+ +
+

Top discussions the last 30 days

+ {% for email in top_threads %} + +
+ #{{forloop.counter}} + {{email.subject}} +
+ +
+
+ + {% endfor %} +
+ +
+

Prominent discussion maker

+ {% for author in top_author %} + +
+
+ #{{forloop.counter}} +
+
+ {% if author.email %} + {% gravatar_img_for_email author.email 40 %} +
+ {% endif %} +
+
+ {{author.name}} +
+ +{{author.kudos}} kudos +
+
+ + {% endfor %} + +

Tag cloud

+
+ +
+

Discussion by topic the last 30 days

+ {% for category, thread in threads_per_category.items %} +
+

{{category}}

+
    + {% for email in thread %} +
  • + {{email.title}} +
  • + {% endfor %} +
+
+ {% endfor %} +
+
+
+ {% for key, value in archives_length|sort %} +

{{ key }}

+
+ +
+ {% endfor %} +
{% 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 %} - - {% endif %} - - {% for email in threads.object_list %} - -
-
- - {{email.subject}} - - {{email.date}} -
-
- {% if email.category_tag %} - - {% else %} - - {% endif %} -
- {% if email.email %} - {% gravatar_img_for_email email.email 40 %}
- {% endif %} - {{email.sender}} -
-
- - {{email.content}} - -
-
-
-
    -
  • Tags:
  • - {% for tag in email.tags %} -
  • {{tag}}
  • - {% endfor %} -
-
    -
  • {{email.participants|length}} participants
  • -
  • {{email.answers}} comments
  • -
- -
-
- - {% empty %} - Sorry no emails could be found for your search. - {% endfor %} - - {% if threads.object_list %} - - {% endif %} +{% if threads.object_list %} + +{% endif %} {% endblock %} {% block additionaljs %} - - + + {% 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 %} - + {% endblock %} {% block content %} -
- - {% include 'threads/right_col.html' %} +
- -
+ {% include 'threads/right_col.html' %} - - {% include 'messages/first_email.html' %} - + +
- {% for email in threads %} - -
+ + {% include 'messages/first_email.html' %} + + + {% for email in threads %} + +
{% include 'messages/message.html' %}
- + - {% empty %} - Sorry no emails could be found for your search. - {% endfor %} + {% empty %} + Sorry no emails could be found for your search. + {% endfor %} -
+
-
+
+ {% endblock %} - - {% block additionaljs %} - - - - - + + + + $(".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; + }); + + }); + {% 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 %} -
- {% csrf_token %} - {{ addtag_form }} - -
+
+ {% csrf_token %} + {{ addtag_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 %} -
- -
-
21
-
- days
inactive -
-
24
-
- days
old -
-
-

- Add to favorite discussions -

- -
-
- tags ({{tags|length}}) -
    - {% for tag in tags %} -
  • {{ tag }} |
  • - {% endfor %} -
-
-
-
- {% csrf_token %} - {{ addtag_form.as_p }} - -
-
-
- participants ({{participants|length}}) -
    - {% for key,value in participants.items %} -
  • - {% gravatar_img_for_email value.email 20%} - {{key}} -
  • - {% endfor %} -
-
-
+
+ +
+
+ 21 +
+
+ days +
+ inactive +
+
+ 24 +
+
+ days +
+ old +
+
+

+ Add to favorite discussions +

+ +
+
+ tags ({{tags|length}}) +
    + {% for tag in tags %} +
  • + {{ tag }} | +
  • + {% endfor %} +
+
+
+
+ {% csrf_token %} + {{ addtag_form.as_p }} + +
+
+
+ participants ({{participants|length}}) +
    + {% for key,value in participants.items %} +
  • + {% gravatar_img_for_email value.email 20%} + {{key}} +
  • + {% endfor %} +
+
+
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 %}

User profiles are under contruction.

{% endblock %} +{% block content %} +

+ User profiles are under contruction. +

+{% endblock %} \ No newline at end of file diff --git a/urls.py b/urls.py index 6c17fe3..5ee4a59 100644 --- a/urls.py +++ b/urls.py @@ -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.*@.*)/(?P\d{4})/(?P\d\d?)/(?P\d\d?)/$', -- cgit