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