Commit cd03c79c3f3b4ce245f7c03cc645a4cfb31752c7
1 parent
c584db52
Exists in
master
and in
39 other branches
Adding a box to allow users reply in thread
template only.
Showing
2 changed files
with
68 additions
and
50 deletions
Show diff stats
src/super_archives/templates/message-thread.html
1 | 1 | {% extends "base.html" %} |
2 | -{% load i18n gravatar superarchives %} | |
2 | +{% load i18n superarchives %} | |
3 | 3 | |
4 | 4 | {% trans "Anonymous" as anonymous %} |
5 | 5 | |
... | ... | @@ -99,56 +99,12 @@ |
99 | 99 | <div class="col-lg-9 col-md-9 col-sm-12"> |
100 | 100 | <ul class="unstyled-list"> |
101 | 101 | {% for email in emails %} |
102 | - {% with email.from_address.user.get_absolute_url as profile_link %} | |
103 | - <li> | |
104 | - {% spaceless %} | |
105 | - <div class="email-message" id="msg-{{ email.id }}"> | |
106 | - <div class="panel panel-default"> | |
107 | - <div class="panel-heading clearfix"> | |
108 | - <div class="col-lg-6 col-md-6 col-sm-6"> | |
109 | - {% if profile_link %} | |
110 | - <a href="{{ profile_link }}"> | |
111 | - {% endif %} | |
112 | - {% gravatar email.from_address 34 %} | |
113 | - <strong class="user-fullname">{{ email.from_address.get_full_name_or_anonymous }}</strong> | |
114 | - {% if profile_link %} | |
115 | - </a> | |
116 | - {% endif %} | |
117 | - </div> | |
118 | - | |
119 | - <div class="col-lg-6 col-md-6 col-sm-6"> | |
120 | - <div class="pull-right text-right"> | |
121 | - <span class="date"> | |
122 | - {{ email.received_time|date:'DATETIME_FORMAT' }} | |
123 | - </span> | |
124 | - | |
125 | - <div class="btn-group"> | |
126 | - <button class="btn btn-default vote-count disabled"> | |
127 | - {{ email.votes_count }} | |
128 | - </button> | |
129 | - {% if user in email.vote_list %} | |
130 | - <button class="btn btn-success vote" data-loading-text="..."> | |
131 | - {% else %} | |
132 | - <button class="btn btn-default vote" data-loading-text="..."> | |
133 | - {% endif %} | |
134 | - <span class="glyphicon glyphicon-thumbs-up"></span> | |
135 | - </button> | |
136 | - </div> | |
137 | - </div> | |
138 | - </div> | |
139 | - | |
140 | - </div> | |
141 | - <div class="panel-collapse in"> | |
142 | - <div class="panel-body"> | |
143 | - {% display_message email %} | |
144 | - </div> | |
145 | - </div> | |
146 | - </div> | |
147 | - </div> | |
148 | - {% endspaceless %} | |
149 | - </li> | |
150 | - {% endwith %} | |
102 | + {% include "superarchives/includes/message.html" with userprofile=email.from_address.user emailaddress=email.from_address fullname=email.from_address.get_full_name_or_anonymous %} | |
151 | 103 | {% endfor %} |
104 | + | |
105 | + {% if user.is_active %} | |
106 | + {% include "superarchives/includes/message.html" with userprofile=user emailaddress=user.email fullname=user.get_full_name reply=True %} | |
107 | + {% endif %} | |
152 | 108 | </ul> |
153 | 109 | </div> |
154 | 110 | ... | ... |
src/super_archives/templates/superarchives/includes/message.html
0 → 100644
... | ... | @@ -0,0 +1,62 @@ |
1 | +{% load gravatar superarchives i18n %} | |
2 | +<li> | |
3 | + {% spaceless %} | |
4 | + <div class="email-message" id="msg-{{ email.id }}"> | |
5 | + <div class="panel panel-default"> | |
6 | + <div class="panel-heading clearfix"> | |
7 | + <div class="col-lg-6 col-md-6 col-sm-6"> | |
8 | + {% if userprofile.get_absolute_url %} | |
9 | + <a href="{{ userprofile.get_absolute_url }}"> | |
10 | + {% endif %} | |
11 | + {% gravatar emailaddress 34 %} | |
12 | + <strong class="user-fullname">{{ fullname }}</strong> | |
13 | + {% if userprofile.get_absolute_url %} | |
14 | + </a> | |
15 | + {% endif %} | |
16 | + </div> | |
17 | + | |
18 | + {% if not reply %} | |
19 | + <div class="col-lg-6 col-md-6 col-sm-6"> | |
20 | + <div class="pull-right text-right"> | |
21 | + <span class="date"> | |
22 | + {{ email.received_time|date:'DATETIME_FORMAT' }} | |
23 | + </span> | |
24 | + | |
25 | + <div class="btn-group"> | |
26 | + <button class="btn btn-default vote-count disabled"> | |
27 | + {{ email.votes_count }} | |
28 | + </button> | |
29 | + {% if user in email.vote_list %} | |
30 | + <button class="btn btn-success vote" data-loading-text="..."> | |
31 | + {% else %} | |
32 | + <button class="btn btn-default vote" data-loading-text="..."> | |
33 | + {% endif %} | |
34 | + <span class="glyphicon glyphicon-thumbs-up"></span> | |
35 | + </button> | |
36 | + </div> | |
37 | + </div> | |
38 | + </div> | |
39 | + {% endif %} | |
40 | + | |
41 | + </div> | |
42 | + <div class="panel-collapse in"> | |
43 | + <div class="panel-body"> | |
44 | + {% if not reply %} | |
45 | + {% display_message email %} | |
46 | + {% else %} | |
47 | + <p> | |
48 | + <textarea placeholder="{% trans 'Send a message' %}" rows="5" class="form-control"></textarea> | |
49 | + </p> | |
50 | + <div class="col-lg-11 col-md-9 col-sm-9 col-xs-8"> | |
51 | + <p class="quiet">{% trans "After sending a message it will take few minutes before it shows up in here. Why don't you grab a coffee?" %}</p> | |
52 | + </div> | |
53 | + <div class="col-lg-1 col-md-3 col-sm-3 col-xs-4 text-right"> | |
54 | + <button class="btn btn-success">{% trans 'Send' %}</button> | |
55 | + </div> | |
56 | + {% endif %} | |
57 | + </div> | |
58 | + </div> | |
59 | + </div> | |
60 | + </div> | |
61 | +{% endspaceless %} | |
62 | +</li> | ... | ... |