f7942b42ac
Trying to add support for Travis CI. Added the NullUserStore for tests. Moved more text out of the templates. Removed an unnecessary dependency for Cosora. Fixed a few more bugs in the MSSQL Adapter. Disabled upserts for now, as it isn't working on MySQL. Refactored the scheduled group logic to reduce the number of potential bugs and to stop using upserts. Fixed many bugs in the Markdown Plugin. Added the ability to escape Markdown. Fixed a number of tests, commented unneccesary ones, and added new ones to probe for new problems. Added the wink smiley. Cleaned up some of the JavaScript. Refactored the permissions logic to use transactions and avoid duplicating logic. Added the ChangeRank method to the Group struct. Added the ChangeGroup method to the User struct. Added the currently unused LogWarning function. Added the transaction versions of the builder methods. Better ones coming up soon! The IsBanned flag is always set to false on mod and admin groups now. Refactored the group creation logic to use transactions. Fixed a bug in the group creator where new groups aren't visible to Exists(). The installer now drops tables for MySQL Databases, if they already exist to make it easier for us to run automated tests. Added more ARIA Attributes.
78 lines
4.1 KiB
HTML
78 lines
4.1 KiB
HTML
{{template "header.html" . }}
|
|
<main>
|
|
|
|
<div class="rowblock rowhead topic_list_title_block">
|
|
<div class="rowitem topic_list_title{{if ne .CurrentUser.ID 0}} has_opt{{end}}"><h1>All Topics</h1></div>
|
|
{{if ne .CurrentUser.ID 0}}
|
|
{{if .ForumList}}
|
|
<div class="opt create_topic_opt" title="Create Topic" aria-label="Create a topic"><a class="create_topic_link" href="/topics/create/"></a></div>
|
|
{{/** TODO: Add a permissions check for this **/}}
|
|
<div class="opt mod_opt" title="Moderate">
|
|
<a class="moderate_link" href="#"></a>
|
|
</div>
|
|
{{else}}<div class="opt locked_opt" title="You don't have the permissions needed to create a topic" aria-label="You don't have the permissions needed to make a topic anywhere"><a></a></div>{{end}}
|
|
<div style="clear: both;"></div>
|
|
{{end}}
|
|
</div>
|
|
{{if ne .CurrentUser.ID 0}}
|
|
{{if .ForumList}}
|
|
<div class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
|
<form name="topic_create_form_form" id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
|
<div class="formrow topic_board_row real_first_child">
|
|
<div class="formitem"><select form="topic_create_form_form" id="topic_board_input" name="topic-board">
|
|
{{range .ForumList}}<option {{if eq .ID $.DefaultForum}}selected{{end}} value="{{.ID}}">{{.Name}}</option>{{end}}
|
|
</select></div>
|
|
</div>
|
|
<div class="formrow topic_name_row">
|
|
<div class="formitem">
|
|
<input form="topic_create_form_form" name="topic-name" placeholder="Topic title" required>
|
|
</div>
|
|
</div>
|
|
<div class="formrow topic_content_row">
|
|
<div class="formitem">
|
|
<textarea form="topic_create_form_form" id="input_content" name="topic-content" placeholder="Insert post here" required></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="formrow quick_button_row">
|
|
<div class="formitem">
|
|
<button form="topic_create_form_form" class="formbutton">Create Topic</button>
|
|
{{if .CurrentUser.Perms.UploadFiles}}
|
|
<input name="upload_files" form="topic_create_form_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}}
|
|
<button class="formbutton close_form">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
<div id="topic_list" class="rowblock topic_list" aria-label="A list containing topics from every forum">
|
|
{{range .TopicList}}<div class="topic_row">
|
|
<div class="rowitem topic_left passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
|
<span class="selector"></span>
|
|
{{if .Creator.Avatar}}<img src="{{.Creator.Avatar}}" height="64" />{{end}}
|
|
<span class="topic_inner_left">
|
|
<a class="rowtopic" href="{{.Link}}"><span>{{.Title}}</span></a> {{if .ForumName}}<a class="rowsmall parent_forum" href="{{.ForumLink}}">{{.ForumName}}</a>{{end}}
|
|
<br /><a class="rowsmall starter" href="{{.Creator.Link}}">{{.Creator.Name}}</a>
|
|
{{/** TODO: Avoid the double '|' when both .IsClosed and .Sticky are set to true. We could probably do this with CSS **/}}
|
|
{{if .IsClosed}}<span class="rowsmall topic_status_e topic_status_closed" title="Status: Closed"> | 🔒︎</span>{{end}}
|
|
{{if .Sticky}}<span class="rowsmall topic_status_e topic_status_sticky" title="Status: Pinned"> | 📍︎</span>{{end}}
|
|
</span>
|
|
<span class="topic_inner_right rowsmall" style="float: right;">
|
|
<span class="replyCount">{{.PostCount}}</span><br />
|
|
<span class="likeCount">{{.LikeCount}}</span>
|
|
</span>
|
|
</div>
|
|
<div class="rowitem topic_right passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
|
{{if .LastUser.Avatar}}<img src="{{.LastUser.Avatar}}" height="64" />{{end}}
|
|
<span>
|
|
<a href="{{.LastUser.Link}}" class="lastName" style="font-size: 14px;">{{.LastUser.Name}}</a><br>
|
|
<span class="rowsmall lastReplyAt">{{.RelativeLastReplyAt}}</span>
|
|
</span>
|
|
</div>
|
|
</div>{{else}}<div class="rowitem passive">There aren't any topics yet.{{if .CurrentUser.Perms.CreateTopic}} <a href="/topics/create/">Start one?</a>{{end}}</div>{{end}}
|
|
</div>
|
|
|
|
</main>
|
|
{{template "footer.html" . }}
|