aboutsummaryrefslogtreecommitdiffhomepage
path: root/apioforum/templates/view_forum.html
blob: 9c3c2c543f47e60c6479c2c69d1e7fb503c6be08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{% extends 'base.html' %}
{% from 'common.html' import ts, tag, disp_user, post_url, forum_breadcrumb, vote_meter %}
{% block header %}
<h1>{% block title %}{{forum.name}}{%endblock%}</h1>
{% if forum.id != 1 %}
	{{ forum_breadcrumb(forum) }}
{% endif %}
{%endblock%}

{%block content%}
{% if forum.description %}
{{forum.description|md|safe}}
{% endif %}
<p class="avail_tags">available tags:
{% for the_tag in avail_tags %}
{{tag(the_tag)}}
{% else %}
<em>(none available)</em>
{% endfor %}

{% if subforums %}
<h2>subforae</h2>
<div class="forum-list">
	{% for subforum in subforums %}
		<div class="listing">
			<div class="listing-main">
				<div class="listing-title">
					<a href="{{url_for('forum.view_forum',forum_id=subforum.id)}}">
						{{- subforum.name -}}
					</a>
				</div>
			</div>
			<div class="listing-caption">
				{% if subforum.updated %}
					last activity {{ts(subforum.updated)}} ago
				{% else %}
					no threads
				{% endif %}
			</div>
		</div>
	{% endfor %}
</div>
{% endif %}

<h2>threads</h2>
<p>
{% if g.user %}
<a class="actionbutton" href="{{url_for('forum.create_thread',forum_id=forum.id)}}">create new thread</a>
{% else %}
please log in to create a new thread
{% endif %}
</p>
<div class="thread-list">
	{%for thread in threads%}
		<div class="listing">
			<div class="listing-main">
				<div class="listing-title">
					<a href="{{url_for('thread.view_thread',thread_id=thread.id)}}">
						{{- thread.title -}}
					</a>
				</div>
				<div class="thread-listing-tags">
					{% for the_tag in thread_tags[thread.id] %}
						{{tag(the_tag)}}
					{% endfor %}
				</div>
				<div class="thread-listing-creation">
					<div class="thread-listing-creator">
						{{ disp_user(thread.creator) }} 
					</div>
					{{ ts(thread.created) }}
				</div>
			</div>
			{#{% if thread.mrp_id %}#}
				<div class="listing-caption">
					{{ disp_user(thread.mrp_author) }}
					<span class="thread-preview-ts">
						{{ ts(thread.mrp_created) }}
					</span>
					<span class="thread-preview-post">
						<a href="{{url_for('thread.view_thread',thread_id=thread.id)}}#post_{{thread.mrp_id}}">
							{{ thread.mrp_content[:500]|e }}
						</a>
					</span>
				</div>
			{#{% endif %}#}
			{% if thread_polls[thread.id] %}
				<div class="thread-vote-summary">
					{{ vote_meter(thread_polls[thread.id]) }}
				</div>
			{% endif %}
		</div>
	{%endfor%}
</div>
<nav id="pages">
	{% if page > 1 %}
	<a href="{{url_for('forum.view_forum',forum_id=forum.id)}}" aria-label="first page">&lt;&lt;</a>
	<a href="{{url_for('forum.view_forum',forum_id=forum.id,page=page-1)}}" aria-label="previous page">&lt;</a>
	{% endif %}
	page {{page}} of {{max_pageno}}
	{% if page < max_pageno %} {# > #}
	<a href="{{url_for('forum.view_forum',forum_id=forum.id,page=page+1)}}" aria-label="next page">&gt;</a>
	<a href="{{url_for('forum.view_forum',forum_id=forum.id,page=max_pageno)}}" aria-label="last page">&gt;&gt;</a>
	{% endif %}
</nav>
	
	
</nav>
</main>
{%endblock%}