]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/questions.html
deleting the test file
[osqa.git] / forum / skins / default / templates / questions.html
1 {% extends "base.html" %}\r
2 <!-- questions.html -->\r
3 {% load extra_tags %}\r
4 {% load i18n %}\r
5 {% load humanize %}\r
6 {% load extra_filters %}\r
7 {% load smart_if %}\r
8 {% block title %}{% spaceless %}{% trans "Questions" %}{% endspaceless %}{% endblock %}\r
9 {% block forejs %}\r
10        <script type="text/javascript">\r
11            var tags = {{ tags_autocomplete|safe }};\r
12            $().ready(function(){\r
13                var tab_id = "{{ tab_id }}";\r
14                $("#"+tab_id).attr('className',"on");\r
15                var on_tab = {% if is_unanswered %}'#nav_unanswered'{% else %}'#nav_questions'{% endif %};\r
16                $(on_tab).attr('className','on');\r
17                Hilite.exact = false;\r
18                Hilite.elementid = "listA";\r
19                Hilite.debug_referrer = location.href;\r
20            });\r
21        </script>\r
22        <script type='text/javascript' src='{% media  "/media/js/com.cnprog.editor.js" %}'></script>\r
23        <script type='text/javascript' src='{% media  "/media/js/com.cnprog.tag_selector.js" %}'></script>\r
24 {% endblock %}\r
25 {% block content %}\r
26 <div class="tabBar">\r
27     <div class="headQuestions">\r
28         {% if searchtag %}\r
29             {% trans "Found by tags" %}\r
30         {% else %}\r
31             {% if searchtitle %}\r
32                 {% if settings.USE_SPHINX_SEARCH %}\r
33                     {% trans "Search results" %}\r
34                 {% else %}\r
35                     {% trans "Found by title" %}\r
36                 {% endif %}\r
37             {% else %}\r
38                 {% if is_unanswered %}\r
39                     {% trans "Unanswered questions" %}\r
40                 {% else %}\r
41                     {% trans "All questions" %}\r
42                 {% endif %}\r
43             {% endif %}\r
44         {% endif %}\r
45     </div>\r
46     <div class="tabsA">\r
47         <a id="latest" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=latest" class="off" title="{% trans "most recently asked questions" %}">{% trans "newest" %}</a>\r
48         <a id="active" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=active" class="off" title="{% trans "most recently updated questions" %}">{% trans "active" %}</a>\r
49         <a id="hottest" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=hottest" class="off" title="{% trans "hottest questions" %}">{% trans "hottest" %}</a>\r
50         <a id="mostvoted" href="{% if is_search %}{{ search_uri }}&{% else %}?{% endif %}sort=mostvoted" class="off" title="{% trans "most voted questions" %}">{% trans "most voted" %}</a>    \r
51     </div>\r
52 </div>\r
53 <div id="listA">\r
54     {% for question in questions.object_list %}\r
55     <div class="qstA"\r
56         {% if request.user.is_authenticated %}\r
57             {% if question.interesting_score > 0 %}\r
58                     style="background:#ffff99;"\r
59             {% else %}\r
60                 {% if not request.user.hide_ignored_questions %}\r
61                     {% if question.ignored_score > 0 %}\r
62                     style="background:#f3f3f3;"\r
63                     {% endif %}\r
64                 {% endif %}\r
65             {% endif %}\r
66         {% endif %}\r
67     >\r
68         <h2>\r
69             <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>\r
70         </h2>\r
71         <div class="stat">\r
72             <table>\r
73                 <tr>\r
74                     <td><span class="num">{{ question.answer_count|intcomma }}</span> </td>\r
75                     <td><span class="num">{{ question.score|intcomma }}</span> </td>\r
76                     <td><span class="num">{{ question.view_count|cnprog_intword|safe }}</span> </td>\r
77                 </tr>  \r
78                 <tr>\r
79                     <td><span class="unit">{% trans "answers" %}</span></td>\r
80                     <td><span class="unit">{% trans "votes" %}</span></td>\r
81                     <td><span class="unit">{% trans "views" %}</span></td>\r
82                 </tr> \r
83             </table>\r
84         </div>\r
85         \r
86         <div class="summary">\r
87             {{ question.summary }}...                \r
88         </div>\r
89         \r
90         {% ifequal tab_id 'active'%}\r
91         {% if question.wiki and settings.WIKI_ON %}\r
92         <span class="from wiki">{% trans "community wiki" %}</span>\r
93         <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>\r
94         {% else %}\r
95         <div class="from">\r
96             {% comment %}{% gravatar question.last_activity_by 24 %}{% endcomment %}\r
97             <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>\r
98             <span class="score">{% get_score_badge question.last_activity_by %} </span>\r
99             <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>\r
100         </div>\r
101         {% endif %}\r
102         {% else %}\r
103         {% if question.wiki and settings.WIKI_ON %}\r
104         <span class="from wiki">{% trans "community wiki" %}</span>\r
105         <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>\r
106         {% else %}\r
107         <div class="from">\r
108             {% comment %}{% gravatar question.author 24 %}{% endcomment %}\r
109             {% if question.last_activity_at != question.added_at %}\r
110                 {% if question.author.id != question.last_activity_by.id %}\r
111                     {% trans "Posted:" %}\r
112                     <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span>\r
113                     <span class="score">{% get_score_badge question.author %} </span>\r
114                     / {% trans "Updated:" %}\r
115                     <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>\r
116                     <span class="score">{% get_score_badge question.last_activity_by %} </span>\r
117                     <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>\r
118                 {% else %}\r
119                     {% trans "Updated:" %}\r
120                     <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>\r
121                     <span class="score">{% get_score_badge question.last_activity_by %} </span>\r
122                     <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>\r
123                 {% endif %}\r
124             {% else %}\r
125                 {% trans "Posted:" %}\r
126                 <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span>\r
127                 <span class="score">{% get_score_badge question.author %} </span>\r
128                 <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>\r
129             {% endif %}\r
130         </div>\r
131         {% endif %}\r
132         {% endifequal %}\r
133         \r
134         <div class="tags">\r
135         {% for tag in question.tagname_list %}\r
136         <a href="{% url tag_questions tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a>\r
137         {% endfor %}\r
138         </div>\r
139     </div>\r
140     {% endfor %}\r
141     {% if searchtitle %}\r
142         {% if questions_count == 0 %}\r
143         <p class="evenMore" style="padding-top:30px;text-align:center;">\r
144             {% trans "Did not find anything?" %}\r
145         {% else %}\r
146         <p class="evenMore" style="padding-left:9px">\r
147             {% trans "Did not find what you were looking for?" %} \r
148         {% endif %}\r
149         <a href="{% url ask %}">{% trans "Please, post your question!" %}</a>\r
150         </p>\r
151     {% endif %}\r
152 </div>\r
153 {% endblock %}\r
154 \r
155 {% block tail %}\r
156     <div class="pager">{% cnprog_paginator context %}</div>\r
157     <div class="pagesize">{% cnprog_pagesize context %}</div>\r
158 {% endblock %}\r
159 \r
160 {% block sidebar %}\r
161 <div class="boxC">\r
162                 {% if searchtag %}\r
163             {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num and searchtag as tagname %}\r
164             have total {{q_num}} questions tagged {{tagname}}\r
165             {% plural %}\r
166             have total {{q_num}} questions tagged {{tagname}}\r
167             {% endblocktrans %}\r
168                 {% else %}\r
169                         {% if searchtitle %}\r
170                 {% if settings.USE_SPHINX_SEARCH %}\r
171                     {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}\r
172                     have total {{q_num}} questions containing {{searchtitle}} in full text\r
173                     {% plural %}\r
174                     have total {{q_num}} questions containing {{searchtitle}} in full text\r
175                     {% endblocktrans %}\r
176                 {% else %}\r
177                     {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}\r
178                     have total {{q_num}} questions containing {{searchtitle}}\r
179                     {% plural %}\r
180                     have total {{q_num}} questions containing {{searchtitle}}\r
181                     {% endblocktrans %}\r
182                 {% endif %}\r
183                         {% else %}\r
184                 {% if is_unanswered %}\r
185                     {% blocktrans count questions as cnt with questions_count|intcomma as q_num %}\r
186                     have total {{q_num}} unanswered questions\r
187                     {% plural %}\r
188                     have total {{q_num}} unanswered questions\r
189                     {% endblocktrans %}\r
190                 {% else %}\r
191                     {% blocktrans count questions as cnt with questions_count|intcomma as q_num %}\r
192                     have total {{q_num}} questions\r
193                     {% plural %}\r
194                     have total {{q_num}} questions\r
195                     {% endblocktrans %}\r
196                 {% endif %}\r
197                         {% endif %}\r
198                 {% endif %}\r
199         <p class="nomargin">\r
200         {% ifequal tab_id "latest" %}\r
201                         {% trans "latest questions info" %}\r
202         {% endifequal %}\r
203         \r
204         {% ifequal tab_id "active" %}\r
205             {% trans "Questions are sorted by the <strong>time of last update</strong>." %} \r
206                         {% trans "Most recently answered ones are shown first." %}\r
207         {% endifequal %}\r
208         \r
209         {% ifequal tab_id "hottest" %}\r
210                         {% trans "Questions sorted by <strong>number of responses</strong>." %}\r
211             {% trans "Most answered questions are shown first." %}\r
212         {% endifequal %}\r
213         \r
214         {% ifequal tab_id "mostvoted" %}\r
215                         {% trans "Questions are sorted by the <strong>number of votes</strong>." %}\r
216             {% trans "Most voted questions are shown first." %}\r
217         {% endifequal %}\r
218         </p>\r
219 </div>\r
220 {% if request.user.is_authenticated %} \r
221 {% include "tag_selector.html" %}\r
222 {% endif %}\r
223 <div class="boxC">\r
224         <h3 class="subtitle">{% trans "Related tags" %}</h3>\r
225     <div class="tags">\r
226         {% for tag in tags %}\r
227             <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}"  href="{% url tag_questions tag.name|urlencode %}">{{ tag.name }}</a>\r
228             <span class="tag-number">&#215; {{ tag.used_count|intcomma }}</span>\r
229             <br />\r
230         {% endfor %}\r
231     </div>\r
232 </div>\r
233 \r
234 {% endblock %}\r
235 <!-- end questions.html -->\r