]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/question.html
Fixed http://jira.osqa.net/browse/OSQA-214 and improved awarded badges list.
[osqa.git] / forum / skins / default / templates / question.html
1 {% extends "base.html" %}\r
2 <!-- question.html -->\r
3 {% load node_tags %}\r
4 {% load extra_tags %}\r
5 {% load extra_filters %}\r
6 {% load smart_if %}\r
7 {% load humanize %}\r
8 {% load i18n %}\r
9 {% load cache %}\r
10 {% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}\r
11 {% block forejs %}\r
12         <meta name="description" content="{{question.summary}}" />\r
13         <meta name="keywords" content="{{question.tagname_meta_generator}}" />\r
14         <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />\r
15         {% if not question.closed %}\r
16         <script type='text/javascript' src='{% media  "/media/js/wmd/showdown.js" %}'></script>\r
17         <script type='text/javascript' src='{% media  "/media/js/wmd/wmd.js" %}'></script>\r
18         <link rel="stylesheet" type="text/css" href="{% media  "/media/js/wmd/wmd.css" %}" />\r
19         {% endif %}\r
20 \r
21         <script type="text/javascript">\r
22         $().ready(function(){\r
23             $("#nav_questions").attr('className',"on");\r
24             var answer_sort_tab = "{{ tab_id }}";\r
25             $("#" + answer_sort_tab).attr('className',"on");\r
26 \r
27             $('#editor').TextAreaResizer();\r
28         });\r
29         </script>\r
30         <noscript>\r
31             <style>\r
32                 .comment.not_top_scorer {\r
33                     display: block;\r
34                 }\r
35                 .comment-form-container {\r
36                     display: block;\r
37                 }\r
38                 .div.comment-tools {\r
39                     display: none;\r
40                 }\r
41             </style>\r
42         </noscript>\r
43 {% endblock %}\r
44         \r
45 {% block content %}\r
46 <div class="headNormal">\r
47     <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>\r
48 </div>\r
49 <div id="main-body" class="">\r
50     <div id="askform">\r
51             <table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}>\r
52                 <tr>\r
53                     <td style="width:30px;vertical-align:top">\r
54                         <div class="vote-buttons">\r
55                             {% vote_buttons question request.user %}\r
56                             {% favorite_mark question request.user %}                            \r
57                         </div>\r
58                     </td>\r
59                     <td>\r
60                         <div id="item-right">\r
61                             <div class="question-body">\r
62                                 {{ question.html|safe }}\r
63                             </div>\r
64                             <div id="question-controls" class="post-controls">\r
65                                 <div id="question-tags" class="tags">\r
66                                     {% for tag in question.tagname_list %}\r
67                                         <a href="{% url tag_questions tag|urlencode %}" class="post-tag"\r
68                                             title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>\r
69                                     {% endfor %}\r
70                                 </div>\r
71                                 {% post_controls question request.user %}\r
72                             </div>\r
73                             <div class="post-update-info-container">\r
74                                     {% post_contributor_info question "original_author" %}\r
75                                     {% post_contributor_info question "last_updater" %}\r
76                             </div>\r
77                             {% comments question request.user %}\r
78                         </div>\r
79                         \r
80                     </td>\r
81                 </tr>\r
82             </table>\r
83             {% if question.marked %}\r
84             <div class="question-status" style="margin-bottom:15px">\r
85             <h3>\r
86                 {% blocktrans with question.closed.extra as close_reason %}\r
87                     The question has been closed for the following reason "{{ close_reason }}" by\r
88                 {% endblocktrans %}\r
89                 <a href="{{ question.closed.by.get_profile_url }}">{{ question.closed.by.username }}</a>\r
90                  {% diff_date question.closed.at %}\r
91             </h3>\r
92             </div>\r
93             {% endif %}\r
94             {% if answers %}\r
95                 <hr/>\r
96                 <div class="tabBar">\r
97                     <a name="sort-top"></a>\r
98                     <div class="headQuestions">\r
99                     {% blocktrans count answers|length as counter %}\r
100                     One Answer:\r
101                     {% plural %}\r
102                     {{counter}} Answers:\r
103                     {% endblocktrans %}\r
104                     </div>\r
105                     <div class="tabsA">\r
106                          <a id="oldest" href="{{ question.get_absolute_url }}?sort=oldest#sort-top"\r
107                             title="{% trans "oldest answers will be shown first" %}">{% trans "oldest answers" %}</a>\r
108                         <a id="latest" href="{{ question.get_absolute_url }}?sort=latest#sort-top"\r
109                             title="{% trans "newest answers will be shown first" %}">{% trans "newest answers" %}</a>\r
110                         <a id="votes" href="{{ question.get_absolute_url }}?sort=votes#sort-top" \r
111                             title="{% trans "most voted answers will be shown first" %}">{% trans "popular answers" %}</a>   \r
112                     </div>\r
113                 </div>\r
114                 {% cnprog_paginator context %}\r
115   \r
116                 {% for answer in answers %}\r
117                     <a name="{{ answer.id }}"></a>\r
118                     <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% ifequal answer.author_id question.author_id %} answered-by-owner{% endifequal %} {% if answer.deleted %}deleted{% endif %}">\r
119                         <table style="width:100%;">\r
120                             <tr>\r
121                                 <td style="width:30px;vertical-align:top">\r
122                                     <div class="vote-buttons">\r
123                                         {% vote_buttons answer request.user %}\r
124                                         {% accept_button answer request.user %}\r
125                                     </div>\r
126                                 </td>\r
127                                 <td>\r
128                                     <div class="item-right">\r
129                                         <div class="answer-body">\r
130                                             {{ answer.html|safe }}\r
131                                         </div>\r
132                                         <div class="answer-controls post-controls">\r
133                                             {% post_controls answer request.user %}\r
134                                         </div>\r
135                                         <div class="post-update-info-container">\r
136                                                 {% post_contributor_info answer "original_author" %}\r
137                                                 {% post_contributor_info answer "last_updater" %}\r
138                                         </div>\r
139                                         {% comments answer request.user %}\r
140                                     </div>\r
141                                 </td>\r
142                             </tr>\r
143                         </table>\r
144                     </div>\r
145                 {% endfor %}\r
146                 <div class="paginator-container-left">\r
147                     {% cnprog_paginator context %}\r
148                 </div>\r
149             {% endif %}\r
150         <form id="fmanswer" action="{% url answer question.id %}" method="post">\r
151             <div style="clear:both">\r
152             </div>\r
153             \r
154             {% if not question.closed %}\r
155                 <div style="padding:10px 0 0 0;">\r
156                     {% spaceless %}\r
157                     <div class="headNormal">\r
158                         {% if answers %}\r
159                             {% trans "Your answer" %}\r
160                         {% else %}\r
161                             {% trans "Be the first one to answer this question!" %}\r
162                         {% endif %}\r
163                     </div>\r
164                     {% endspaceless %}\r
165                 </div>\r
166                 {% if not request.user.is_authenticated %}\r
167                     <div class="message">{% trans "you can answer anonymously and then login" %}</div>\r
168                 {% else %}\r
169                     <p class="message">\r
170                         {% ifequal request.user question.author  %}\r
171                             {% trans "answer your own question only to give an answer" %}\r
172                         {% else %}\r
173                             {% trans "please only give an answer, no discussions" %}\r
174                         {% endifequal %}\r
175                     </p>\r
176                 {% endif %}\r
177 \r
178                 <div id="description" class="" >\r
179                     <div id="wmd-button-bar" class="wmd-panel"></div>\r
180                     {{ answer.text }}\r
181                     <div class="preview-toggle">\r
182                         <table width="100%">\r
183                             <tr>\r
184                                 <td>\r
185                                     <span id="pre-collapse" \r
186                                         title="{% trans "Toggle the real time Markdown editor preview" %}">\r
187                                             {% trans "toggle preview" %}\r
188                                     </span>\r
189                                 </td>\r
190                                 {% if settings.WIKI_ON %}\r
191                                 <td style="text-align:right;">\r
192                                     {{ answer.wiki }} \r
193                                     <span style="font-weight:normal;cursor:help" \r
194                                         title="{{answer.wiki.help_text}}">\r
195                                             {{ answer.wiki.label_tag }} \r
196                                     </span>\r
197                                 </td>\r
198                                 {% endif %}\r
199                             </tr>\r
200                         \r
201                         </table>  \r
202                     </div>\r
203                     <div id="previewer" class="wmd-preview"></div>\r
204                     {{ answer.text.errors }}\r
205                 </div>\r
206                 <p><span class="form-error"></span></p>\r
207                 <input type="submit" \r
208                     {% if user.is_anonymous %}\r
209                         value="{% trans "Login/Signup to Post Your Answer" %}" \r
210                     {% else %}\r
211                         {% if user == question.author %}\r
212                         value="{% trans "Answer Your Own Question" %}" \r
213                         {% else %}\r
214                         value="{% trans "Answer the question" %}" \r
215                         {% endif %}\r
216                     {% endif %}\r
217                     class="submit" style="float:left"/>\r
218             {% endif %}\r
219         </form>\r
220     </div>\r
221 </div>\r
222 {% endblock %}\r
223 \r
224 {% block sidebar %}\r
225 <div class="boxC" id="subscription_box">\r
226     {% include "subscription_status.html" %}\r
227 </div>\r
228 {% cache 60 questions_tags settings.APP_URL question.id %}\r
229 <div class="boxC">\r
230     <p>\r
231                 {% trans "Question tags" %}:\r
232     </p>\r
233     <p class="tags" >\r
234         {% for tag in tags %}\r
235                 <a href="{% url tag_questions tag.name|urlencode %}" \r
236                         title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}" \r
237                         rel="tag">{{ tag.name }}</a> <span class="tag-number">&#215;{{ tag.used_count|intcomma }}</span><br/>\r
238         {% endfor %}\r
239     </p>\r
240     <p>\r
241         {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>\r
242     </p>\r
243     <p> \r
244         {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>\r
245     </p>\r
246     <p> \r
247         {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>\r
248     </p>\r
249 </div>\r
250 {% endcache %}\r
251 <div class="boxC">\r
252     <h3 class="subtitle">{% trans "Related questions" %}</h3>\r
253     <div class="questions-related">\r
254 \r
255         {% for question in similar_questions %}\r
256         <p>\r
257             <a href="{{ question.get_absolute_url }}">{{ question.headline }}</a>\r
258         </p>\r
259         {% endfor %}\r
260 \r
261     </div>\r
262 </div>\r
263 \r
264 {% endblock %}\r
265 \r
266 {% block endjs %}\r
267 {% endblock %}\r
268 <!-- end question.html -->\r