summaryrefslogtreecommitdiffstats
path: root/templates/search.html
blob: 680191bb582e5ba6f7f3a68dd798d384fc92cee3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{% extends "base.html" %}
{% load poll_extras %}
{% load gravatar %}

{% 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="{{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 %}
    
    {% for email in threads.object_list %}
    <!-- New thread -->
    <div class="thread">
      <div class="notsaved">
        <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/{{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.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="/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="{{ 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 %}