From 115c5a5891a943756922be6019a35674a2e8c34c Mon Sep 17 00:00:00 2001 From: Aamir Khan Date: Wed, 28 Mar 2012 22:41:52 +0530 Subject: real pages are at / rather than /2, mockup is at /mockup --- templates/base.html | 15 +++- templates/base2.html | 72 ----------------- templates/base_thread.html | 4 +- templates/index.html | 16 ++-- templates/index2.html | 17 ---- templates/mockup/base.html | 61 ++++++++++++++ templates/mockup/base_thread.html | 75 +++++++++++++++++ templates/mockup/index.html | 17 ++++ templates/mockup/month_view.html | 71 ++++++++++++++++ templates/mockup/recent_activities.html | 139 ++++++++++++++++++++++++++++++++ templates/mockup/search.html | 73 +++++++++++++++++ templates/mockup/thread.html | 134 ++++++++++++++++++++++++++++++ templates/month_view.html | 113 ++++++++++++++++---------- templates/month_view2.html | 102 ----------------------- templates/recent_activities.html | 12 +-- templates/search.html | 66 ++++++++++++--- templates/search2.html | 115 -------------------------- urls.py | 46 +++++------ views/mockup.py | 12 +-- views/pages.py | 4 +- 20 files changed, 756 insertions(+), 408 deletions(-) delete mode 100644 templates/base2.html delete mode 100644 templates/index2.html create mode 100644 templates/mockup/base.html create mode 100644 templates/mockup/base_thread.html create mode 100644 templates/mockup/index.html create mode 100644 templates/mockup/month_view.html create mode 100644 templates/mockup/recent_activities.html create mode 100644 templates/mockup/search.html create mode 100644 templates/mockup/thread.html delete mode 100644 templates/month_view2.html delete mode 100644 templates/search2.html 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 %}
{% if month_participants and month_discussions %} @@ -32,16 +36,23 @@ {% endif %}
+ {% if list_address %}

{{list_address}}

+

+ + All lists + +

+ {% endif %}
New thread diff --git a/templates/base2.html b/templates/base2.html deleted file mode 100644 index bb9ab53..0000000 --- a/templates/base2.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - {% block title %}Mail app{% endblock %} - - - - - - - {% block additional_headers %} - {% endblock %} - - - - -
- {% block header %} -
- - {% if month_participants and month_discussions %} -
    -
  • {{month_participants}} participants
  • -
  • {{month_discussions}} discussions
  • -
  • 1 saved
  • -
- {% endif %} -
- {% if list_address %} -

- - {{list_address}} - -

-

- - All lists - -

- - {% endif %} -
- - New thread - -
-
-
-
- {% endblock %} - -
- {% block content %} - {% endblock %} -
- - - 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 @@
-
+ {{ search_form }}
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 %} +

+ These are the list available on this server: +

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

- These are the list available on this server: -

- -{% endblock %} diff --git a/templates/mockup/base.html b/templates/mockup/base.html new file mode 100644 index 0000000..9445add --- /dev/null +++ b/templates/mockup/base.html @@ -0,0 +1,61 @@ + + + + + + + {% block title %}Mail app{% endblock %} + + + + + + + {% block additional_headers %} + {% endblock %} + + + + +
+ {% block header %} +
+ + {% if month_participants and month_discussions %} +
    +
  • {{month_participants}} participants
  • +
  • {{month_discussions}} discussions
  • +
  • 1 saved
  • +
+ {% endif %} +
+

+ + {{list_address}} + +

+ +
+ + New thread + +
+
+
+
+ {% endblock %} + +
+ {% block content %} + {% endblock %} +
+ + + 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 @@ + + + + + + + {% block title %}Mail app{% endblock %} + + + + + + + {% block additional_headers %} + {% endblock %} + + + + + +
+
+ +
+
+ {{ search_form }} +
+
+
+ +
+
+ + New thread + +
+ {{next_thread}} +
+ +
+ + question + +
+ {{first_mail.email.Subject}} +
    +
  • {{participants|length}} participants
  • +
  • {{answers}} comments
  • +
+
+ +
+ + New thread + +
+ {{prev_thread}} +
+
+ + +
+
+
+ +
+ {% block content %} + {% endblock %} +
+ + + 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 %} + +{% 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 %} + + + +{% endblock %} + +{% block content %} + + {% for email in threads %} + +
+
+ {{email.title}} + {{email.age}} ago +
+
+ {% if email.category_tag %} + + {% else %} + + {% endif %} +
+ {% if email.avatar %} + avatar
+ {% endif %} + {{email.author}} +
+
+ + {{email.body}} + +
+
+
+
    +
  • Tags:
  • + {% for tag in email.tags %} +
  • {{tag}}
  • + {% endfor %} +
+
    +
  • {{email.participants|length}} participants
  • +
  • {{email.answers|length}} comments
  • +
+ +
+
+ + {% 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 %} + + + + + + +{% 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.avatar %} + avatar + {% 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 %} 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 %} + + + +{% endblock %} + +{% block content %} + + {% for email in threads %} + +
+
+ {{email.title}} + 6 hours ago +
+
+ {% if email.category_tag %} + + {% else %} + + {% endif %} +
+ {% if email.avatar %} + avatar
+ {% endif %} + {{email.author}} +
+
+ + {{email.body}} + +
+
+
+
    +
  • Tags:
  • + {% for tag in email.tags %} +
  • {{tag}}
  • + {% endfor %} +
+
    +
  • {{email.participants|length}} participants
  • +
  • {{email.answers|length}} comments
  • +
+ +
+
+ + {% 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 %} + + + + + +{% endblock %} + +{% block content %} + +
+ + +
+ +
+
21
+
+ days
inactive +
+
24
+
+ days
old +
+
+

+ Add to favorite discussions +

+ +
+
+ tags ({{tags|length}}) +
    + {% for tag in tags %} +
  • {{ tag }} |
  • + {% endfor %} +
+
+
+
+ + +
+
+
+ participants ({{participants|length}}) +
    + {% for ppl in participants %} +
  • + avatar + {{ppl}} +
  • + {% endfor %} +
+
+
+ + +
+ + +
+ +
+ {{first_mail.email.Content}} +
+ +
+ + + {% for email in threads %} + +
+ + + + {% empty %} + Sorry no emails could be found for your search. + {% endfor %} + +
+ +
+{% 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 %} - -
-
- {{email.title}} - {{email.age}} ago -
-
- {% if email.category_tag %} - - {% else %} -
- {{email.category}} +
+ {% for email in threads %} + +
+
+ + + {{email.Subject}} + + + {{email.Date}}
- {% endif %} -
- {% if email.avatar %} - avatar
+
+ {% if email.category_tag %} + + {% else %} + {% endif %} - {{email.author}} +
+ {% if email.avatar %} + avatar
+ {% endif %} + {{email.From}} +
+
+ + {{email.Content}} + +
-
- - {{email.body}} - +
+
    +
  • Tags:
  • + {% for tag in email.tags %} +
  • {{tag}}
  • + {% endfor %} +
+
    +
  • {{email.participants}} participants
  • +
  • {{email.answers}} comments
  • +
+
-
-
    -
  • Tags:
  • - {% for tag in email.tags %} -
  • {{tag}}
  • + + {% empty %} + Sorry no emails could be found for your search. + {% endfor %} +
+
+ {% for key, value in archives_length|sort %} +

{{ key }}

+
+ -
    -
  • {{email.participants|length}} participants
  • -
  • {{email.answers|length}} comments
  • -
-
+ {% endfor %}
- - {% 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 %} - - - -{% endblock %} - -{% block content %} - -
- {% for email in threads %} - -
-
- - - {{email.Subject}} - - - {{email.Date}} -
-
- {% if email.category_tag %} - - {% else %} - - {% endif %} -
- {% if email.avatar %} - avatar
- {% endif %} - {{email.From}} -
-
- - {{email.Content}} - -
-
-
-
    -
  • Tags:
  • - {% for tag in email.tags %} -
  • {{tag}}
  • - {% endfor %} -
-
    -
  • {{email.participants}} 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 %} 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() {
    {% if email.category_tag %}
  • - + {{email.Category}}
  • {% else %}
  • - + {{email.Category}}
  • @@ -63,13 +63,13 @@ $(function() {
      {% if email.category_tag %}
    • - + {{email.Category}}
    • {% else %}
    • - + {{email.Category}}
    • @@ -127,7 +127,7 @@ $(function() {
        {% for ar_month in value %}
      • - + {{ ar_month|tomonth }}
      • 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 %} + + {% endif %} + + {% for email in threads.object_list %}
        - {{email.title}} - 6 hours ago + + {{email.Subject}} + + {{email.Date}}
        {% if email.category_tag %} {% else %} -
        - {{email.category}} + {% endif %}
        {% if email.avatar %} avatar
        {% endif %} - {{email.author}} + {{email.From}}
        - {{email.body}} + {{email.Content}}
        @@ -50,18 +70,22 @@
          -
        • {{email.participants|length}} participants
        • -
        • {{email.answers|length}} comments
        • +
        • {{email.participants}} participants
        • +
        • {{email.answers}} comments
        @@ -69,5 +93,23 @@ {% empty %} Sorry no emails could be found for your search. {% endfor %} + + {% if threads.object_list %} + + {% 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 %} - - - -{% endblock %} - -{% 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.avatar %} - avatar
        - {% endif %} - {{email.From}} -
        -
        - - {{email.Content}} - -
        -
        -
        -
          -
        • Tags:
        • - {% for tag in email.tags %} -
        • {{tag}}
        • - {% endfor %} -
        -
          -
        • {{email.participants}} participants
        • -
        • {{email.answers}} comments
        • -
        - -
        -
        - - {% empty %} - Sorry no emails could be found for your search. - {% endfor %} - - {% if threads.object_list %} - - {% 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.*@.*)/(?P\d{4})/(?P\d\d?)/$', 'views.pages.archives'), - url(r'^2/archives/(?P.*@.*)/(?P\d{4})/(?P\d\d?)$', 'views.pages.archives'), - url(r'^2/archives/(?P.*@.*)/$', 'views.pages.archives'), - url(r'^2/archives/(?P.*@.*)$', 'views.pages.archives'), + url(r'^archives/(?P.*@.*)/(?P\d{4})/(?P\d\d?)/$', 'views.pages.archives'), + url(r'^archives/(?P.*@.*)/(?P\d{4})/(?P\d\d?)$', 'views.pages.archives'), + url(r'^archives/(?P.*@.*)/$', 'views.pages.archives'), + url(r'^archives/(?P.*@.*)$', 'views.pages.archives'), # The thread view - url(r'^2/thread/(?P.*@.*)/(?P\d+)$', 'views.pages.thread'), + url(r'^thread/(?P.*@.*)/(?P\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.*@.*)/$', 'views.pages.list'), - url(r'^2/list/(?P.*@.*)$', 'views.pages.list'), + url(r'^list$', 'views.pages.index'), + url(r'^list/$', 'views.pages.index'), + url(r'^list/(?P.*@.*)/$', 'views.pages.list'), + url(r'^list/(?P.*@.*)$', 'views.pages.list'), # Search - #url(r'^2/search$', 'views.pages.search'), - url(r'^2/search/(?P.*@.*)$', 'views.pages.search_keyword'), - url(r'^2/search/(?P.*@.*)/$', 'views.pages.search_keyword'), - url(r'^2/search/(?P.*@.*)\/(?P.*)$', 'views.pages.search_keyword'), - url(r'^2/tag/(?P.*@.*)\/(?P.*)$', 'views.pages.search_tag'), + #url(r'^search$', 'views.pages.search'), + url(r'^search/(?P.*@.*)$', 'views.pages.search_keyword'), + url(r'^search/(?P.*@.*)/$', 'views.pages.search_keyword'), + url(r'^search/(?P.*@.*)\/(?P.*)$', 'views.pages.search_keyword'), + url(r'^tag/(?P.*@.*)\/(?P.*)$', 'views.pages.search_tag'), # mockups: - url(r'^$', 'views.mockup.index'), - url(r'^archives$', 'views.mockup.archives'), - url(r'^archives/(?P\d{4})/(?P\d{2})/$', 'views.mockup.archives'), - url(r'^recent$', 'views.mockup.recent'), - url(r'^search$', 'views.mockup.search'), - url(r'^search\/(?P.*)$', 'views.mockup.search_keyword'), - url(r'^tag\/(?P.*)$', 'views.mockup.search_tag'), + url(r'^mockup/$', 'views.mockup.index'), + url(r'^mockup/archives$', 'views.mockup.archives'), + url(r'^mockup/archives/(?P\d{4})/(?P\d{2})/$', 'views.mockup.archives'), + url(r'^mockup/recent$', 'views.mockup.recent'), + url(r'^mockup/search$', 'views.mockup.search'), + url(r'^mockup/search\/(?P.*)$', 'views.mockup.search_keyword'), + url(r'^mockup/tag\/(?P.*)$', '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) -- cgit