Truncate questions on question list.
[prawokultury.git] / questions / templates / questions / question_list.html
index 0b830e2..46e757c 100755 (executable)
@@ -1,20 +1,69 @@
 {% extends "base.html" %}
 {% load url from future %}
+{% load pagination_tags fnp_prevnext %}
+{% load compressed %}
+{% load chunks %}
 
 {% block "titleextra" %}Pierwsza pomoc w prawie autorskim :: {% endblock %}
 {% block "body" %}
-<h1>Pierwsza pomoc w prawie autorskim</h1>
+<h1>Pierwsza pomoc w prawie autorskim: zapytaj prawnika</h1>
 
 <div class="normal">
-<p>Jeśli rozwiązania Twojego problemu nie ma na tej stronie,
-<a href="{% url "migdal_entry_publications" "pierwsza-pomoc" %} ">zajrzyj do naszego podręcznika</a>. Jeśli i to nie pomoże,
-<a href="{% url 'questions_form' %}">zadaj pytanie naszemu prawnikowi</a>.</p>
-  
-<ul>
+{% chunk 'questions_list_info' %}
+
+<div id="questions-filter">
+    <h2>Filtruj pytania</h2>
+    Wybierz kategorię tematów:
+    <div id="questions-categories">
+    {% if has_uncategorized_tags %}
+    <a href="#" {% if tag and not tag.category %}class="selected"{% endif %} data-category-id="0">bez kategorii</a>
+    {% endif %}
+    {% for category in tag_categories %}
+            <a href="#" style="font-size: {{category.cloud_size}}em;" {% if tag.category == category %}class="selected"{% endif %} data-category-id="{{category.id}}">{{category}}</a>
+    {% endfor %}
+    </div>
+
+    <div id="questions-subjects">
+    {% for category_id, tag_list in tag_lists.items %}
+        <div class="questions-tags-group" data-category-id="{{category_id}}">
+        Wyświetl tylko na temat:
+        {% for atag in tag_list %}
+            {% if atag == tag %}<strong style="font-size: {{atag.cloud_size}}em;">{{ atag }}</strong>
+            {% else %}<a href="?tag={{ atag.slug }}" style="font-size: {{atag.cloud_size}}em;">{{ atag }}</a>
+            {% endif %}
+        {% endfor %}
+        </div>
+    {% endfor %}
+    </div>
+    <div>
+        {% if tag %}<a href=".">Pokaż wszystkie pytania</a>{% endif %}
+    </div>
+</div>
+
+<h2>Odpowiedzi na już zadane pytania
+    {% if tag %}na temat: {{ tag }}{% endif %}
+    ({{ object_list.count }}):</h2>
+
+{% autopaginate object_list 20 %}
+
+<ul class='questions'>
 {% for question in object_list %}
-    <li><a href="{{ question.get_absolute_url }}">{{ question }}</a></li>
+    <li><a href="{{ question.get_absolute_url }}">{{ question|truncatewords:50 }}</a>
+    </li>
 {% endfor %}
 </ul>
+
 </div>
 
-{% endblock %}
\ No newline at end of file
+{% prevnext %}
+
+
+{% endblock %}
+
+{% block "extra_css" %}
+    {% compressed_css 'questions' %}
+{% endblock %}
+
+{% block "extra_js" %}
+    {% compressed_js 'questions' %}
+{% endblock %}