2021-05-03 14:51:07 +00:00
|
|
|
{{ template "base.html" . }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
<div class="content-block">
|
2021-05-03 23:59:43 +00:00
|
|
|
{{ range .Subcategories }}
|
|
|
|
<div class="pv3">
|
|
|
|
<h2 class="ma0 ph3 pb2">
|
|
|
|
<a href="{{ .Url }}">
|
|
|
|
{{ .Name }} »<br/>
|
|
|
|
</a>
|
|
|
|
</h2>
|
|
|
|
{{ range .Threads }}
|
|
|
|
{{ template "thread_list_item.html" . }}
|
|
|
|
{{ end }}
|
|
|
|
{{ $more := sub .TotalThreads 3 }}
|
|
|
|
{{ if gt $more 0 }}
|
|
|
|
<div class="ph3 pv1">
|
|
|
|
<a class="title" href="{{ .Url }}">{{ $more }} more »</a>
|
|
|
|
</div>
|
2021-05-03 22:45:17 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
2021-05-03 23:59:43 +00:00
|
|
|
{{ end }}
|
|
|
|
<div class="optionbar">
|
|
|
|
{{ template "forum_category_options" . }}
|
2021-05-03 22:45:17 +00:00
|
|
|
</div>
|
2021-05-03 14:51:07 +00:00
|
|
|
{{ range .Threads }}
|
|
|
|
{{ template "thread_list_item.html" . }}
|
|
|
|
{{ end }}
|
2021-05-03 23:59:43 +00:00
|
|
|
<div class="optionbar bottom">
|
|
|
|
{{ template "forum_category_options" . }}
|
|
|
|
</div>
|
2021-05-03 14:51:07 +00:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
2021-05-03 23:59:43 +00:00
|
|
|
|
|
|
|
{{ define "forum_category_options" }}
|
|
|
|
<div class="options">
|
|
|
|
{{ if .User }}
|
2021-05-11 22:53:23 +00:00
|
|
|
<a class="button new-thread" href="{{ .NewThreadUrl }}"><span class="big">+</span> New Thread</a>
|
2021-05-04 12:02:33 +00:00
|
|
|
{{/* TODO(asaf): Mark read should probably be a POST, since it's destructive and we would probably want CSRF for it */}}
|
2021-05-11 22:53:23 +00:00
|
|
|
<a class="button" href="{{ .MarkReadUrl }}"><span class="big">✓</span> Mark threads here as read</a>
|
2021-05-03 23:59:43 +00:00
|
|
|
{{ else }}
|
2021-05-11 22:53:23 +00:00
|
|
|
<a class="button" href="{{ .LoginPageUrl }}">Log in to post a new thread</a>
|
2021-05-03 23:59:43 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
<div class="options">
|
|
|
|
{{ template "pagination.html" .Pagination }}
|
|
|
|
</div>
|
2021-05-04 12:02:33 +00:00
|
|
|
{{ end }}
|