14a14b7e80
This commit might be a little broken, another is coming to fix things up! The topics list is now paginated. Refactored the error handling system. Added the Trumboyg WYSIWYG editor for Cosora. Moved Delete() out of the TopicStore and into *Topic You can now bulk delete and bulk lock topics on Cosora. h1s are now formatted properly on Firefox. Added more ARIA Labels. SuperModOnly is now a piece of middleware for the Control Panel routes. Refactored and extended the router generator. Improved the SEO for the paginators. Added bits of Microdata to improve SEO further. Wrote benchmarks for users.Get() and users.BypassGet() More errors are caught now. You can now attach pcss files to posts. Improved the error logging for JavaScript. Topic list avatars now link to the associated profiles. Added last poster avatars to the forum list.
108 lines
7.2 KiB
HTML
108 lines
7.2 KiB
HTML
{{template "header.html" . }}
|
|
|
|
{{if gt .Page 1}}<link rel="prev" href="/topic/{{.Topic.ID}}?page={{subtract .Page 1}}" />
|
|
<div id="prevFloat" class="prev_button"><a class="prev_link" aria-label="Go to the previous page" rel="prev" href="/topic/{{.Topic.ID}}?page={{subtract .Page 1}}"><</a></div>{{end}}
|
|
|
|
{{if ne .LastPage .Page}}<link rel="prerender next" href="/topic/{{.Topic.ID}}?page={{add .Page 1}}" />
|
|
<div id="nextFloat" class="next_button"><a class="next_link" aria-label="Go to the next page" rel="next" href="/topic/{{.Topic.ID}}?page={{add .Page 1}}">></a></div>{{end}}
|
|
|
|
<main>
|
|
|
|
<div class="rowblock rowhead topic_block" aria-label="The opening post of this topic">
|
|
<form action='/topic/edit/submit/{{.Topic.ID}}' method="post">
|
|
<div class="rowitem topic_item{{if .Topic.Sticky}} topic_sticky_head{{else if .Topic.IsClosed}} topic_closed_head{{end}}">
|
|
<h1 class='topic_name hide_on_edit'>{{.Topic.Title}}</h1>
|
|
{{/** TODO: Inline this CSS **/}}
|
|
{{if .Topic.IsClosed}}<span class='username hide_on_micro topic_status_e topic_status_closed hide_on_edit' title='Status: Closed' style="font-weight:normal;float: right;position:relative;top:-5px;">🔒︎</span>{{end}}
|
|
{{if .CurrentUser.Perms.EditTopic}}
|
|
<input class='show_on_edit topic_name_input' name="topic_name" value='{{.Topic.Title}}' type="text" />
|
|
<button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button>
|
|
{{end}}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="rowblock post_container">
|
|
<article itemscope itemtype="http://schema.org/CreativeWork" class="rowitem passive deletable_block editable_parent post_item top_post" aria-label="The opening post for this topic">
|
|
<div class="userinfo" aria-label="The information on the poster">
|
|
<div class="avatar_item" style="background-image: url({{.Topic.Avatar}}), url(/static/white-dot.jpg);background-position: 0px -10px;"> </div>
|
|
<a href="{{.Topic.UserLink}}" class="the_name" rel="author">{{.Topic.CreatedByName}}</a>
|
|
{{if .Topic.Tag}}<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">{{.Topic.Tag}}</div><div class="tag_post"></div></div>{{else}}<div class="tag_block"><div class="tag_pre"></div><div class="post_tag post_level">Level {{.Topic.Level}}</div><div class="tag_post"></div></div>{{end}}
|
|
</div>
|
|
<div class="content_container">
|
|
<div class="hide_on_edit topic_content user_content" itemprop="text">{{.Topic.ContentHTML}}</div>
|
|
<textarea name="topic_content" class="show_on_edit topic_content_input">{{.Topic.Content}}</textarea>
|
|
<div class="button_container">
|
|
{{if .CurrentUser.Loggedin}}
|
|
{{if .CurrentUser.Perms.LikeItem}}<a href="/topic/like/submit/{{.Topic.ID}}" class="action_button">+1</a>{{end}}
|
|
{{if .CurrentUser.Perms.EditTopic}}<a href="/topic/edit/{{.Topic.ID}}" class="action_button open_edit">Edit</a>{{end}}
|
|
{{if .CurrentUser.Perms.DeleteTopic}}<a href="/topic/delete/submit/{{.Topic.ID}}" class="action_button delete_item">Delete</a>{{end}}
|
|
{{if .CurrentUser.Perms.CloseTopic}}
|
|
{{if .Topic.IsClosed}}<a href='/topic/unlock/submit/{{.Topic.ID}}' class="action_button">Unlock</a>{{else}}<a href='/topic/lock/submit/{{.Topic.ID}}' class="action_button">Lock</a>{{end}}{{end}}
|
|
{{if .CurrentUser.Perms.PinTopic}}
|
|
{{if .Topic.Sticky}}<a href='/topic/unstick/submit/{{.Topic.ID}}' class="action_button">Unpin</a>{{else}}<a href='/topic/stick/submit/{{.Topic.ID}}' class="action_button">Pin</a>{{end}}{{end}}
|
|
<a href="/report/submit/{{.Topic.ID}}?session={{.CurrentUser.Session}}&type=topic" class="action_button report_item">Report</a>
|
|
{{end}}
|
|
{{if .Topic.LikeCount}}<a class="action_button action_button_right like_count hide_on_micro">{{.Topic.LikeCount}} up</a>{{end}}
|
|
<a class="action_button action_button_right created_at hide_on_mobile">{{.Topic.CreatedAt}}</a>
|
|
{{if .CurrentUser.Perms.ViewIPs}}<a href="#" title="IP Address" class="action_button action_button_right ip_item hide_on_mobile">{{.Topic.IPAddress}}</a>{{end}}
|
|
</div>
|
|
</div><div style="clear:both;"></div>
|
|
</article>
|
|
|
|
{{range .ItemList}}
|
|
<article itemscope itemtype="http://schema.org/CreativeWork" class="rowitem passive deletable_block editable_parent post_item {{if .ActionType}}action_item{{end}}">
|
|
<div class="userinfo" aria-label="The information on the poster">
|
|
<div class="avatar_item" style="background-image: url({{.Avatar}}), url(/static/white-dot.jpg);background-position: 0px -10px;"> </div>
|
|
<a href="{{.UserLink}}" class="the_name" rel="author">{{.CreatedByName}}</a>
|
|
{{if .Tag}}<div class="tag_block"><div class="tag_pre"></div><div class="post_tag">{{.Tag}}</div><div class="tag_post"></div></div>{{else}}<div class="tag_block"><div class="tag_pre"></div><div class="post_tag post_level">Level {{.Level}}</div><div class="tag_post"></div></div>{{end}}
|
|
</div>
|
|
<div class="content_container" {{if .ActionType}}style="margin-left: 0px;"{{end}}>
|
|
{{if .ActionType}}
|
|
<span class="action_icon" style="font-size: 18px;padding-right: 5px;">{{.ActionIcon}}</span>
|
|
<span itemprop="text">{{.ActionType}}</span>
|
|
{{else}}
|
|
{{/** TODO: We might end up with <br>s in the inline editor, fix this **/}}
|
|
<div class="editable_block user_content" itemprop="text">{{.ContentHtml}}</div>
|
|
<div class="button_container">
|
|
{{if $.CurrentUser.Loggedin}}
|
|
{{if $.CurrentUser.Perms.LikeItem}}<a href="/reply/like/submit/{{.ID}}" class="action_button">+1</a>{{end}}
|
|
{{if $.CurrentUser.Perms.EditReply}}<a href="/reply/edit/submit/{{.ID}}" class="action_button edit_item">Edit</a>{{end}}
|
|
{{if $.CurrentUser.Perms.DeleteReply}}<a href="/reply/delete/submit/{{.ID}}" class="action_button delete_item">Delete</a>{{end}}
|
|
<a href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=reply" class="action_button report_item">Report</a>
|
|
{{end}}
|
|
{{if .LikeCount}}<a class="action_button action_button_right like_count hide_on_micro">{{.LikeCount}} up</a>{{end}}
|
|
<a class="action_button action_button_right created_at hide_on_mobile">{{.CreatedAt}}</a>
|
|
{{if $.CurrentUser.Perms.ViewIPs}}<a href="#" title="IP Address" class="action_button action_button_right ip_item hide_on_mobile">{{.IPAddress}}</a>{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
<div style="clear:both;"></div>
|
|
</article>
|
|
{{end}}</div>
|
|
|
|
{{if .CurrentUser.Perms.CreateReply}}
|
|
<div class="rowblock topic_reply_form quick_create_form">
|
|
<form id="reply_form" enctype="multipart/form-data" action="/reply/create/" method="post"></form>
|
|
<input form="reply_form" name="tid" value='{{.Topic.ID}}' type="hidden" />
|
|
<div class="formrow real_first_child">
|
|
<div class="formitem">
|
|
<textarea id="input_content" form="reply_form" name="reply-content" placeholder="Insert reply here" required></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="formrow quick_button_row">
|
|
<div class="formitem">
|
|
<button form="reply_form" name="reply-button" class="formbutton">Create Reply</button>
|
|
{{if .CurrentUser.Perms.UploadFiles}}
|
|
<input name="upload_files" form="reply_form" id="upload_files" multiple type="file" style="display: none;" />
|
|
<label for="upload_files" class="formbutton add_file_button">Add File</label>
|
|
<div id="upload_file_dock"></div>{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
</main>
|
|
|
|
{{template "footer.html" . }}
|