summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--templates/base.html15
-rw-r--r--templates/base_thread.html4
-rw-r--r--templates/index.html16
-rw-r--r--templates/index2.html17
-rw-r--r--templates/mockup/base.html (renamed from templates/base2.html)15
-rw-r--r--templates/mockup/base_thread.html75
-rw-r--r--templates/mockup/index.html17
-rw-r--r--templates/mockup/month_view.html71
-rw-r--r--templates/mockup/recent_activities.html139
-rw-r--r--templates/mockup/search.html73
-rw-r--r--templates/mockup/thread.html134
-rw-r--r--templates/month_view.html113
-rw-r--r--templates/month_view2.html102
-rw-r--r--templates/recent_activities.html12
-rw-r--r--templates/search.html66
-rw-r--r--templates/search2.html115
-rw-r--r--urls.py46
-rw-r--r--views/mockup.py12
-rw-r--r--views/pages.py4
19 files changed, 697 insertions, 349 deletions
diff --git a/templates/base.html b/templates/base.html
index 9445add..dc84fcb 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -21,7 +21,11 @@
{% block header %}
<div id="headline">
<ul class="inline-block">
- <li id="list_name"><a href="/">{{list_name}}</a></li>
+ {% 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>
</ul>
{% if month_participants and month_discussions %}
@@ -32,16 +36,23 @@
</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'>
+ <a href="/">
+ All lists
+ </a>
+ </p>
<div id="searchbox">
- <form action="/search" method="get">
+ <form action="/search/{{list_address}}" method="get">
{{ search_form }}
</form>
</div>
+ {% endif %}
<div id="newthread">
<a href="#Create_new_thread">
<img src="{{ STATIC_URL }}img/newthread.png" alt="New thread" />
diff --git a/templates/base_thread.html b/templates/base_thread.html
index 4122283..31ed8af 100644
--- a/templates/base_thread.html
+++ b/templates/base_thread.html
@@ -21,11 +21,11 @@
<div class="header">
<div id="headline">
<ul class="inline-block">
- <li id="list_name"><a href="/2/">{{list_name}}</a></li>
+ <li id="list_name"><a href="/">{{list_name}}</a></li>
<li id="page_date">{{month}}</li>
</ul>
<div id="top_right">
- <form action="/2/search/{{list_address}}" method="get">
+ <form action="/search/{{list_address}}" method="get">
{{ search_form }}
</form>
</div>
diff --git a/templates/index.html b/templates/index.html
index caae906..f63c160 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -3,15 +3,15 @@
{% block title %}{{ app_name }}{% endblock %}
{% block content %}
+ <p>
+ These are the list available on this server:
+ </p>
<ul>
- <li>
- <a href="archives">Archives current month</a>
- </li>
- <li>
- <a href="archives/2012/01/">Archives January 2012</a>
- </li>
- <li>
- <a href="recent">Recent activities</a>
+ {% for mlist in lists %}
+ <li>{{mlist}} ({{mlist}}) --
+ <a href="/list/{{mlist}}">Recent</a> --
+ <a href="/archives/{{mlist}}">Archives current month</a>
</li>
+ {% endfor %}
</ul>
{% endblock %}
diff --git a/templates/index2.html b/templates/index2.html
deleted file mode 100644
index ac2e3c7..0000000
--- a/templates/index2.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% extends "base2.html" %}
-
-{% block title %}{{ app_name }}{% endblock %}
-
-{% block content %}
- <p>
- These are the list available on this server:
- </p>
- <ul>
- {% for mlist in lists %}
- <li>{{mlist}} ({{mlist}}) --
- <a href="/2/list/{{mlist}}">Recent</a> --
- <a href="/2/archives/{{mlist}}">Archives current month</a>
- </li>
- {% endfor %}
- </ul>
-{% endblock %}
diff --git a/templates/base2.html b/templates/mockup/base.html
index bb9ab53..9445add 100644
--- a/templates/base2.html
+++ b/templates/mockup/base.html
@@ -21,11 +21,7 @@
{% block header %}
<div id="headline">
<ul class="inline-block">
- {% if list_address %}
- <li id="list_name"><a href="/2/list/{{list_address}}">{{list_name}}</a></li>
- {% else %}
- <li id="list_name"><a href="/2/list/">{{list_name}}</a></li>
- {% endif %}
+ <li id="list_name"><a href="/">{{list_name}}</a></li>
<li id="page_date">{{month}}</li>
</ul>
{% if month_participants and month_discussions %}
@@ -36,23 +32,16 @@
</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'>
- <a href="/2/">
- All lists
- </a>
- </p>
<div id="searchbox">
- <form action="/2/search/{{list_address}}" method="get">
+ <form action="/search" method="get">
{{ search_form }}
</form>
</div>
- {% endif %}
<div id="newthread">
<a href="#Create_new_thread">
<img src="{{ STATIC_URL }}img/newthread.png" alt="New thread" />
diff --git a/templates/mockup/base_thread.html b/templates/mockup/base_thread.html
new file mode 100644
index 0000000..31ed8af
--- /dev/null
+++ b/templates/mockup/base_thread.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="ROBOTS" content="INDEX, FOLLOW" />
+
+ <title>{% block title %}Mail app{% 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_headers %}
+ {% endblock %}
+</head>
+
+<body>
+
+ <!-- Header -->
+ <div class="header">
+ <div id="headline">
+ <ul class="inline-block">
+ <li id="list_name"><a href="/">{{list_name}}</a></li>
+ <li id="page_date">{{month}}</li>
+ </ul>
+ <div id="top_right">
+ <form action="/search/{{list_address}}" method="get">
+ {{ search_form }}
+ </form>
+ </div>
+ </div>
+
+ <div id="thread_nav">
+ <div id="newewthread" class="inline-block">
+ <a href="{{ next_thread_id }}">
+ <img src="{{ STATIC_URL }}img/button_newer.png" alt="New thread" />
+ </a>
+ <br />
+ {{next_thread}}
+ </div>
+
+ <div class="inline-block thread_title">
+ <span class="type type_question">
+ <a href="/tag/question"> question </a>
+ </span>
+ <br />
+ {{first_mail.email.Subject}}
+ <ul class="inline thread_info">
+ <li class="participant"> {{participants|length}} participants</li>
+ <li class="discussion"> {{answers}} comments</li>
+ </ul>
+ </div>
+
+ <div id="olderhread" class="inline-block right">
+ <a href="{{ prev_thread_id }}">
+ <img src="{{ STATIC_URL }}img/button_older.png" alt="New thread" />
+ </a>
+ <br />
+ {{prev_thread}}
+ </div>
+ </div>
+
+
+ <hr id="white"/>
+ <hr />
+ </div>
+
+ <div class="content">
+ {% block content %}
+ {% endblock %}
+ </div>
+
+</body>
+</html>
diff --git a/templates/mockup/index.html b/templates/mockup/index.html
new file mode 100644
index 0000000..caae906
--- /dev/null
+++ b/templates/mockup/index.html
@@ -0,0 +1,17 @@
+{% extends "base.html" %}
+
+{% block title %}{{ app_name }}{% endblock %}
+
+{% block content %}
+ <ul>
+ <li>
+ <a href="archives">Archives current month</a>
+ </li>
+ <li>
+ <a href="archives/2012/01/">Archives January 2012</a>
+ </li>
+ <li>
+ <a href="recent">Recent activities</a>
+ </li>
+ </ul>
+{% endblock %}
diff --git a/templates/mockup/month_view.html b/templates/mockup/month_view.html
new file mode 100644
index 0000000..24cbf37
--- /dev/null
+++ b/templates/mockup/month_view.html
@@ -0,0 +1,71 @@
+{% extends "base.html" %}
+
+{% block title %}{{ app_name }}{% endblock %}
+
+{% block additional_headers %}
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
+ <script src="{{ STATIC_URL }}jquery.expander.js"></script>
+ <script>
+ $(document).ready(function() {
+ $('span.expander').expander({
+ userCollapseText: 'View Less',
+ expandText: 'View More'
+ });
+ });
+ </script>
+{% endblock %}
+
+{% block content %}
+
+ {% for email in threads %}
+ <!-- New thread -->
+ <div class="thread">
+ <div class="notsaved">
+ <span class="thread_title">{{email.title}}</span>
+ <span class="thread_date"> {{email.age}} ago</span>
+ </div>
+ <div class="thread_content">
+ {% if email.category_tag %}
+ <div class="inline-block type type_{{email.category_tag}}">
+ <a href="/tag/{{email.category_tag}}"> {{email.category}} </a>
+ </div>
+ {% else %}
+ <div class="inline-block type type_{{email.category}}">
+ <a href="/tag/{{email.category}}"> {{email.category}} </a>
+ </div>
+ {% endif %}
+ <div class="inline-block gravatar">
+ {% if email.avatar %}
+ <img src="{{email.avatar}}" alt="avatar" /> <br />
+ {% endif %}
+ {{email.author}}
+ </div>
+ <div class="inline-block thread_email">
+ <span class="expander">
+ {{email.body}}
+ </span>
+ </div>
+ </div>
+ <div class="thread_info">
+ <ul class="tags inline">
+ <li>Tags:</li>
+ {% for tag in email.tags %}
+ <li> <a href="/tag/{{tag}}">{{tag}}</a></li>
+ {% endfor %}
+ </ul>
+ <ul class="inline-block">
+ <li class="participant"> {{email.participants|length}} participants</li>
+ <li class="discussion"> {{email.answers|length}} 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>
+ <li class="showdiscussion"> <a href="#show"> Show discussion</a></li>
+ </ul>
+ </div>
+ </div>
+ <!-- End of thread -->
+ {% endfor %}
+
+{% endblock %}
diff --git a/templates/mockup/recent_activities.html b/templates/mockup/recent_activities.html
new file mode 100644
index 0000000..009f2a9
--- /dev/null
+++ b/templates/mockup/recent_activities.html
@@ -0,0 +1,139 @@
+{% extends "base.html" %}
+{% load poll_extras %}
+
+{% block title %} {{ app_name }} {% endblock %}
+
+{% block additional_headers %}
+<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/jquery-ui-1.8.18.custom.css" />
+<script src="{{ STATIC_URL }}jquery-1.7.1.min.js" type="text/javascript"></script>
+<script src="{{ STATIC_URL }}jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
+
+<script>
+$(function() {
+ $( "#accordion" ).accordion();
+});
+</script>
+{% endblock %}
+
+{% block content %}
+
+ <section id="recent_activities">
+ <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">{{email.Subject}}</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}} </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">{{email.Subject}}</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}} </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.avatar %}
+ <img src="{{author.avatar}}" alt="avatar" />
+ {% 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 %}
diff --git a/templates/mockup/search.html b/templates/mockup/search.html
new file mode 100644
index 0000000..f3b44cf
--- /dev/null
+++ b/templates/mockup/search.html
@@ -0,0 +1,73 @@
+{% extends "base.html" %}
+
+{% block title %}{{ app_name }}{% endblock %}
+
+{% block additional_headers %}
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
+ <script src="{{ STATIC_URL }}jquery.expander.js"></script>
+ <script>
+ $(document).ready(function() {
+ $('span.expander').expander({
+ userCollapseText: 'View Less',
+ expandText: 'View More'
+ });
+ });
+ </script>
+{% endblock %}
+
+{% block content %}
+
+ {% for email in threads %}
+ <!-- New thread -->
+ <div class="thread">
+ <div class="notsaved">
+ <span class="thread_title">{{email.title}}</span>
+ <span class="thread_date"> 6 hours ago</span>
+ </div>
+ <div class="thread_content">
+ {% if email.category_tag %}
+ <div class="inline-block type type_{{email.category_tag}}">
+ <a href="/tag/{{email.category_tag}}"> {{email.category}} </a>
+ </div>
+ {% else %}
+ <div class="inline-block type type_{{email.category}}">
+ <a href="/tag/{{email.category}}"> {{email.category}} </a>
+ </div>
+ {% endif %}
+ <div class="inline-block gravatar">
+ {% if email.avatar %}
+ <img src="{{email.avatar}}" alt="avatar" /> <br />
+ {% endif %}
+ {{email.author}}
+ </div>
+ <div class="inline-block thread_email">
+ <span class="expander">
+ {{email.body}}
+ </span>
+ </div>
+ </div>
+ <div class="thread_info">
+ <ul class="tags inline">
+ <li>Tags:</li>
+ {% for tag in email.tags %}
+ <li> <a href="/tag/{{tag}}">{{tag}}</a></li>
+ {% endfor %}
+ </ul>
+ <ul class="inline-block">
+ <li class="participant"> {{email.participants|length}} participants</li>
+ <li class="discussion"> {{email.answers|length}} comments</li>
+ </ul>
+ <ul class="inline-block">
+ <li class="like"> +1</li>
+ <li class="youlike"> <a href="#like"> Like</a></li>
+ <li class="youdislike"> <a href="#dislike"> Dislike</a></li>
+ <li class="showdiscussion"> <a href="#show"> Show discussion</a></li>
+ </ul>
+ </div>
+ </div>
+ <!-- End of thread -->
+ {% empty %}
+ Sorry no emails could be found for your search.
+ {% endfor %}
+
+{% endblock %}
diff --git a/templates/mockup/thread.html b/templates/mockup/thread.html
new file mode 100644
index 0000000..423ea4c
--- /dev/null
+++ b/templates/mockup/thread.html
@@ -0,0 +1,134 @@
+{% extends "base_thread.html" %}
+
+{% block title %}{{ app_name }}{% endblock %}
+
+{% block additional_headers %}
+ <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/thread.css" />
+
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
+ <script src="{{ STATIC_URL }}jquery.expander.js"></script>
+ <script>
+ $(document).ready(function() {
+ $('div.email_body').expander({
+ userCollapseText: 'View Less',
+ expandText: 'View More'
+ });
+ });
+ </script>
+{% endblock %}
+
+{% block content %}
+
+ <div class="content">
+
+ <!-- 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="#add_tag" method="get" >
+ <input id="add_tag_field" type="text" name="add_tag" class="inline-block"/>
+ <input id="add_tag_button" type="submit" value="ADD" class="inline-block"/>
+ </form>
+ </div>
+ <div id="participants">
+ <span id="participants_title"> participants </span>({{participants|length}})
+ <ul>
+ {% for ppl in participants %}
+ <li>
+ <img src="http://planet.fedoraproject.org/images/heads/default.png" alt="avatar" />
+ {{ppl}}
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ </section>
+
+ <!-- main section, the email thread -->
+ <section id="thread_content">
+
+ <!-- Start first email -->
+ <div class="first_email">
+ <div class="email_header">
+ <img src="http://planet.fedoraproject.org/images/heads/default.png" alt="avatar" />
+ <div class="email_author inline-block">
+ <span class="name">{{first_mail.email.From}}</span>
+ <br />
+ <span class="rank">Rank 10</span>
+ </div>
+ <div class="email_date inline-block right">
+ <span class="date">{{first_mail.email.Date}}</span>
+ <br />
+ <span class="time"></span>
+ </div>
+ </div>
+ <div id="first_email_body">
+ {{first_mail.email.Content}}
+ </div>
+ <ul class="email_info inline">
+ <li class="neutral"> 0</li>
+ <li class="youlike"> <a href="#like"> Like</a></li>
+ <li class="youdislike"> <a href="#dislike"> Dislike</a></li>
+ <li class="discussion add_comment"> <a href="#comment"> Add your own comment</a></li>
+ </ul>
+ </div>
+ <!-- End first email -->
+
+ {% for email in threads %}
+ <!-- Start email -->
+ <div class="even">
+ <!-- Start email -->
+ <div class="email" style="padding-left: {{email.level}}em">
+ <div class="email_header">
+ <img src="http://planet.fedoraproject.org/images/heads/default.png" alt="avatar" />
+ <div class="email_author inline-block">
+ <span class="name">{{email.email.From}}</span>
+ <br />
+ <span class="rank">Rank 8</span>
+ </div>
+ <div class="email_date inline-block right">
+ <span class="date">{{email.email.Date}}</span>
+ <br />
+ </div>
+ </div>
+ <div class="email_body">
+ {{email.email.Content}}
+ </div>
+ <ul class="email_info inline">
+ <li class="neutral"> 0</li>
+ <li class="youlike"> <a href="#like"> Like</a></li>
+ <li class="youdislike"> <a href="#dislike"> Dislike</a></li>
+ <li class="discussion add_comment"> <a href="#comment">Reply</a></li>
+ </ul>
+ </div>
+ <!-- End of email -->
+ {% empty %}
+ Sorry no emails could be found for your search.
+ {% endfor %}
+
+ </section>
+
+ </div> <!-- end of content -->
+{% endblock %}
diff --git a/templates/month_view.html b/templates/month_view.html
index 24cbf37..b55e353 100644
--- a/templates/month_view.html
+++ b/templates/month_view.html
@@ -1,4 +1,5 @@
{% extends "base.html" %}
+{% load poll_extras %}
{% block title %}{{ app_name }}{% endblock %}
@@ -17,55 +18,85 @@
{% block content %}
- {% for email in threads %}
- <!-- New thread -->
- <div class="thread">
- <div class="notsaved">
- <span class="thread_title">{{email.title}}</span>
- <span class="thread_date"> {{email.age}} ago</span>
- </div>
- <div class="thread_content">
- {% if email.category_tag %}
- <div class="inline-block type type_{{email.category_tag}}">
- <a href="/tag/{{email.category_tag}}"> {{email.category}} </a>
- </div>
- {% else %}
- <div class="inline-block type type_{{email.category}}">
- <a href="/tag/{{email.category}}"> {{email.category}} </a>
+ <div id="recent_activities">
+ {% for email in threads %}
+ <!-- New thread -->
+ <div class="thread">
+ <div class="notsaved">
+ <span class="thread_title">
+ <a name="{{email.ThreadID}}"
+ href="/thread/{{list_address}}/{{email.ThreadID}}">
+ {{email.Subject}}
+ </a>
+ </span>
+ <span class="thread_date"> {{email.Date}}</span>
</div>
- {% endif %}
- <div class="inline-block gravatar">
- {% if email.avatar %}
- <img src="{{email.avatar}}" alt="avatar" /> <br />
+ <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 %}
- {{email.author}}
+ <div class="inline-block gravatar">
+ {% if email.avatar %}
+ <img src="{{email.avatar}}" alt="avatar" /> <br />
+ {% endif %}
+ {{email.From}}
+ </div>
+ <div class="inline-block thread_email">
+ <span class="expander">
+ {{email.Content}}
+ </span>
+ </div>
</div>
- <div class="inline-block thread_email">
- <span class="expander">
- {{email.body}}
- </span>
+ <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}} 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>
- <div class="thread_info">
- <ul class="tags inline">
- <li>Tags:</li>
- {% for tag in email.tags %}
- <li> <a href="/tag/{{tag}}">{{tag}}</a></li>
+ <!-- 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>
- <ul class="inline-block">
- <li class="participant"> {{email.participants|length}} participants</li>
- <li class="discussion"> {{email.answers|length}} 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>
- <li class="showdiscussion"> <a href="#show"> Show discussion</a></li>
- </ul>
</div>
+ {% endfor %}
</div>
- <!-- End of thread -->
- {% endfor %}
+
{% endblock %}
diff --git a/templates/month_view2.html b/templates/month_view2.html
deleted file mode 100644
index cc3c678..0000000
--- a/templates/month_view2.html
+++ /dev/null
@@ -1,102 +0,0 @@
-{% extends "base2.html" %}
-{% load poll_extras %}
-
-{% block title %}{{ app_name }}{% endblock %}
-
-{% block additional_headers %}
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
- <script src="{{ STATIC_URL }}jquery.expander.js"></script>
- <script>
- $(document).ready(function() {
- $('span.expander').expander({
- userCollapseText: 'View Less',
- expandText: 'View More'
- });
- });
- </script>
-{% endblock %}
-
-{% 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.ThreadID}}"
- href="/2/thread/{{list_address}}/{{email.ThreadID}}">
- {{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="/2/tag/{{list_address}}/{{email.category_tag}}"> {{email.Category}} </a>
- </div>
- {% else %}
- <div class="inline-block type type_{{email.Category|lower}}">
- <a href="/2/tag/{{list_address}}/{{email.Category|lower}}"> {{email.Category}} </a>
- </div>
- {% endif %}
- <div class="inline-block gravatar">
- {% if email.avatar %}
- <img src="{{email.avatar}}" alt="avatar" /> <br />
- {% endif %}
- {{email.From}}
- </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="/2/tag/{{list_address}}/{{tag}}">{{tag}}</a></li>
- {% endfor %}
- </ul>
- <ul class="inline-block">
- <li class="participant"> {{email.participants}} 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="/2/archives/{{list_address}}/{{key}}/{{ar_month}}">
- {{ ar_month|tomonth }}
- </a>
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endfor %}
- </div>
-
-
-{% endblock %}
diff --git a/templates/recent_activities.html b/templates/recent_activities.html
index 85a3506..009f2a9 100644
--- a/templates/recent_activities.html
+++ b/templates/recent_activities.html
@@ -1,4 +1,4 @@
-{% extends "base2.html" %}
+{% extends "base.html" %}
{% load poll_extras %}
{% block title %} {{ app_name }} {% endblock %}
@@ -30,13 +30,13 @@ $(function() {
<ul class="inline-block">
{% if email.category_tag %}
<li class="type type_{{email.category_tag}}">
- <a href="/2/tag/{{list_address}}/{{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="/2/tag/{{list_address}}/{{email.Category|lower}}">
+ <a href="/tag/{{list_address}}/{{email.Category|lower}}">
{{email.Category}}
</a>
</li>
@@ -63,13 +63,13 @@ $(function() {
<ul class="inline-block">
{% if email.category_tag %}
<li class="type type_{{email.category_tag}}">
- <a href="/2/tag/{{list_address}}/{{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="/2/tag/{{list_address}}/{{email.Category|lower}}">
+ <a href="/tag/{{list_address}}/{{email.Category|lower}}">
{{email.Category}}
</a>
</li>
@@ -127,7 +127,7 @@ $(function() {
<ul>
{% for ar_month in value %}
<li>
- <a href="/2/archives/{{list_address}}/{{key}}/{{ar_month}}">
+ <a href="/archives/{{list_address}}/{{key}}/{{ar_month}}">
{{ ar_month|tomonth }}
</a>
</li>
diff --git a/templates/search.html b/templates/search.html
index f3b44cf..fa76cea 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -17,32 +17,52 @@
{% block content %}
- {% for email in threads %}
+ {% if threads.object_list %}
+ <div class="pagination">
+ <span class="step-links">
+ {% if threads.has_previous %}
+ <a href="?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="?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">
- <span class="thread_title">{{email.title}}</span>
- <span class="thread_date"> 6 hours ago</span>
+ <a href="/thread/{{list_address}}/{{email.ThreadID}}">
+ <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/{{email.category_tag}}"> {{email.category}} </a>
+ <a href="/tag/{{list_address}}/{{email.category_tag}}"> {{email.Category}} </a>
</div>
{% else %}
- <div class="inline-block type type_{{email.category}}">
- <a href="/tag/{{email.category}}"> {{email.category}} </a>
+ <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.avatar %}
<img src="{{email.avatar}}" alt="avatar" /> <br />
{% endif %}
- {{email.author}}
+ {{email.From}}
</div>
<div class="inline-block thread_email">
<span class="expander">
- {{email.body}}
+ {{email.Content}}
</span>
</div>
</div>
@@ -50,18 +70,22 @@
<ul class="tags inline">
<li>Tags:</li>
{% for tag in email.tags %}
- <li> <a href="/tag/{{tag}}">{{tag}}</a></li>
+ <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|length}} comments</li>
+ <li class="participant"> {{email.participants}} participants</li>
+ <li class="discussion"> {{email.answers}} comments</li>
</ul>
<ul class="inline-block">
- <li class="like"> +1</li>
+ <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>
@@ -69,5 +93,23 @@
{% 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="?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="?page={{ threads.next_page_number }}">next</a>
+ {% endif %}
+ </span>
+ </div>
+ {% endif %}
{% endblock %}
diff --git a/templates/search2.html b/templates/search2.html
deleted file mode 100644
index 9545a27..0000000
--- a/templates/search2.html
+++ /dev/null
@@ -1,115 +0,0 @@
-{% extends "base2.html" %}
-
-{% block title %}{{ app_name }}{% endblock %}
-
-{% block additional_headers %}
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
- <script src="{{ STATIC_URL }}jquery.expander.js"></script>
- <script>
- $(document).ready(function() {
- $('span.expander').expander({
- userCollapseText: 'View Less',
- expandText: 'View More'
- });
- });
- </script>
-{% endblock %}
-
-{% block content %}
-
- {% if threads.object_list %}
- <div class="pagination">
- <span class="step-links">
- {% if threads.has_previous %}
- <a href="?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="?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="/2/thread/{{list_address}}/{{email.ThreadID}}">
- <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="/2/tag/{{list_address}}/{{email.category_tag}}"> {{email.Category}} </a>
- </div>
- {% else %}
- <div class="inline-block type type_{{email.Category|lower}}">
- <a href="/2/tag/{{list_address}}/{{email.Category|lower}}"> {{email.Category}} </a>
- </div>
- {% endif %}
- <div class="inline-block gravatar">
- {% if email.avatar %}
- <img src="{{email.avatar}}" alt="avatar" /> <br />
- {% endif %}
- {{email.From}}
- </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="/2/tag/{{list_address}}/{{tag}}">{{tag}}</a></li>
- {% endfor %}
- </ul>
- <ul class="inline-block">
- <li class="participant"> {{email.participants}} 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="?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="?page={{ threads.next_page_number }}">next</a>
- {% endif %}
- </span>
- </div>
- {% endif %}
-
-{% endblock %}
diff --git a/urls.py b/urls.py
index 1ea56e9..e0a0034 100644
--- a/urls.py
+++ b/urls.py
@@ -12,34 +12,34 @@ urlpatterns = patterns('',
# url(r'^$', 'hyperkitty.views.home', name='home'),
# url(r'^hyperkitty/', include('hyperkitty.foo.urls')),
# This will be the new index page
- url(r'^2$', 'views.pages.index'),
- url(r'^2/$', 'views.pages.index'),
+ url(r'^$', 'views.pages.index'),
+ url(r'^/$', 'views.pages.index'),
# This will be the new archives page
- url(r'^2/archives/(?P<mlist_fqdn>.*@.*)/(?P<year>\d{4})/(?P<month>\d\d?)/$', 'views.pages.archives'),
- url(r'^2/archives/(?P<mlist_fqdn>.*@.*)/(?P<year>\d{4})/(?P<month>\d\d?)$', 'views.pages.archives'),
- url(r'^2/archives/(?P<mlist_fqdn>.*@.*)/$', 'views.pages.archives'),
- url(r'^2/archives/(?P<mlist_fqdn>.*@.*)$', 'views.pages.archives'),
+ url(r'^archives/(?P<mlist_fqdn>.*@.*)/(?P<year>\d{4})/(?P<month>\d\d?)/$', 'views.pages.archives'),
+ url(r'^archives/(?P<mlist_fqdn>.*@.*)/(?P<year>\d{4})/(?P<month>\d\d?)$', 'views.pages.archives'),
+ url(r'^archives/(?P<mlist_fqdn>.*@.*)/$', 'views.pages.archives'),
+ url(r'^archives/(?P<mlist_fqdn>.*@.*)$', 'views.pages.archives'),
# The thread view
- url(r'^2/thread/(?P<mlist_fqdn>.*@.*)/(?P<threadid>\d+)$', 'views.pages.thread'),
+ url(r'^thread/(?P<mlist_fqdn>.*@.*)/(?P<threadid>\d+)$', 'views.pages.thread'),
# This will be the new recent page
- url(r'^2/list$', 'views.pages.index'),
- url(r'^2/list/$', 'views.pages.index'),
- url(r'^2/list/(?P<mlist_fqdn>.*@.*)/$', 'views.pages.list'),
- url(r'^2/list/(?P<mlist_fqdn>.*@.*)$', 'views.pages.list'),
+ url(r'^list$', 'views.pages.index'),
+ url(r'^list/$', 'views.pages.index'),
+ url(r'^list/(?P<mlist_fqdn>.*@.*)/$', 'views.pages.list'),
+ url(r'^list/(?P<mlist_fqdn>.*@.*)$', 'views.pages.list'),
# Search
- #url(r'^2/search$', 'views.pages.search'),
- url(r'^2/search/(?P<mlist_fqdn>.*@.*)$', 'views.pages.search_keyword'),
- url(r'^2/search/(?P<mlist_fqdn>.*@.*)/$', 'views.pages.search_keyword'),
- url(r'^2/search/(?P<mlist_fqdn>.*@.*)\/(?P<keyword>.*)$', 'views.pages.search_keyword'),
- url(r'^2/tag/(?P<mlist_fqdn>.*@.*)\/(?P<tag>.*)$', 'views.pages.search_tag'),
+ #url(r'^search$', 'views.pages.search'),
+ url(r'^search/(?P<mlist_fqdn>.*@.*)$', 'views.pages.search_keyword'),
+ url(r'^search/(?P<mlist_fqdn>.*@.*)/$', 'views.pages.search_keyword'),
+ url(r'^search/(?P<mlist_fqdn>.*@.*)\/(?P<keyword>.*)$', 'views.pages.search_keyword'),
+ url(r'^tag/(?P<mlist_fqdn>.*@.*)\/(?P<tag>.*)$', 'views.pages.search_tag'),
# mockups:
- url(r'^$', 'views.mockup.index'),
- url(r'^archives$', 'views.mockup.archives'),
- url(r'^archives/(?P<year>\d{4})/(?P<month>\d{2})/$', 'views.mockup.archives'),
- url(r'^recent$', 'views.mockup.recent'),
- url(r'^search$', 'views.mockup.search'),
- url(r'^search\/(?P<keyword>.*)$', 'views.mockup.search_keyword'),
- url(r'^tag\/(?P<tag>.*)$', 'views.mockup.search_tag'),
+ url(r'^mockup/$', 'views.mockup.index'),
+ url(r'^mockup/archives$', 'views.mockup.archives'),
+ url(r'^mockup/archives/(?P<year>\d{4})/(?P<month>\d{2})/$', 'views.mockup.archives'),
+ url(r'^mockup/recent$', 'views.mockup.recent'),
+ url(r'^mockup/search$', 'views.mockup.search'),
+ url(r'^mockup/search\/(?P<keyword>.*)$', 'views.mockup.search_keyword'),
+ url(r'^mockup/tag\/(?P<tag>.*)$', 'views.mockup.search_tag'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
diff --git a/views/mockup.py b/views/mockup.py
index 170c7be..f5a46f9 100644
--- a/views/mockup.py
+++ b/views/mockup.py
@@ -45,7 +45,7 @@ class SearchForm(forms.Form):
def index(request):
- t = loader.get_template('index.html')
+ t = loader.get_template('mockup/index.html')
search_form = SearchForm(auto_id=False)
c = RequestContext(request, {
'app_name': settings.APP_NAME,
@@ -65,7 +65,7 @@ def archives(request, year=None, month=None):
except ValueError, err:
logger.error('Wrong format given for the date')
search_form = SearchForm(auto_id=False)
- t = loader.get_template('month_view.html')
+ t = loader.get_template('mockup/month_view.html')
c = RequestContext(request, {
'app_name': settings.APP_NAME,
'list_name' : MAILING_LIST,
@@ -79,7 +79,7 @@ def archives(request, year=None, month=None):
return HttpResponse(t.render(c))
def recent(request):
- t = loader.get_template('recent_activities.html')
+ t = loader.get_template('mockup/recent_activities.html')
threads = generate_random_thread()
threads2 = threads[:]
threads2.reverse()
@@ -106,12 +106,12 @@ def recent(request):
def search(request):
keyword = request.GET.get('keyword')
- return HttpResponseRedirect('/search/%s' % keyword)
+ return HttpResponseRedirect('/mockup/search/%s' % keyword)
def search_keyword(request, keyword):
search_form = SearchForm(auto_id=False)
- t = loader.get_template('search.html')
+ t = loader.get_template('mockup/search.html')
if keyword:
c = RequestContext(request, {
'app_name': settings.APP_NAME,
@@ -138,7 +138,7 @@ def search_keyword(request, keyword):
def search_tag(request, tag):
search_form = SearchForm(auto_id=False)
- t = loader.get_template('search.html')
+ t = loader.get_template('mockup/search.html')
c = RequestContext(request, {
'app_name': settings.APP_NAME,
'list_name' : MAILING_LIST,
diff --git a/views/pages.py b/views/pages.py
index 98f183c..d486915 100644
--- a/views/pages.py
+++ b/views/pages.py
@@ -45,7 +45,7 @@ class SearchForm(forms.Form):
def index(request):
- t = loader.get_template('index2.html')
+ t = loader.get_template('index.html')
search_form = SearchForm(auto_id=False)
base_url = settings.MAILMAN_API_URL % {
'username': settings.MAILMAN_USER, 'password': settings.MAILMAN_PASS}
@@ -83,7 +83,7 @@ def archives(request, mlist_fqdn, year=None, month=None):
list_name = mlist_fqdn.split('@')[0]
search_form = SearchForm(auto_id=False)
- t = loader.get_template('month_view2.html')
+ t = loader.get_template('month_view.html')
threads = mongo.get_archives(list_name, start=begin_date,
end=end_date)