22650aad27
Added Attachments. Added Attachment Media Embeds. Renamed a load of *Store and *Cache methods to reduce the amount of unneccesary typing. Added petabytes as a unit and cleaned up a few of the friendly units. Refactored the username change logic to make it easier to maintain. Refactored the avatar change logic to make it easier to maintain. Shadow now uses CSS Variables for most of it's colours. We have plans to transpile this to support older browsers later on! Snuck some CSS Variables into Tempra Conflux. Added the GroupCache interface to MemoryGroupStore. Added the Length method to MemoryGroupStore. Added support for a site short name. Added the UploadFiles permission. Renamed more functions. Fixed the background for the left gutter on the postbit for Tempra Simple and Shadow. Added support for if statements operating on int8, int16, int32, int32, int64, uint, uint8, uint16, uint32, uint64, float32, and float64 for the template compiler. Added support for if statements operating on slices and maps for the template compiler. Fixed a security exploit in reply editing. Fixed a bug in the URL detector in the parser where it couldn't find URLs with non-standard ports. Fixed buttons having blue outlines on focus on Shadow. Refactored the topic creation logic to make it easier to maintain. Made a few responsive fixes, but there's still more to do in the following commits!
70 lines
3.9 KiB
HTML
70 lines
3.9 KiB
HTML
{{template "header.html" . }}
|
|
<main>
|
|
|
|
<div class="rowblock rowhead">
|
|
<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"><a class="create_topic_link" href="/topics/create/"></a></div>
|
|
{{else}}<div class="opt locked_opt" title="You don't have the permissions needed to create a topic"><a></a></div>{{end}}
|
|
<div style="clear: both;"></div>
|
|
{{end}}
|
|
</div>
|
|
{{if ne .CurrentUser.ID 0}}
|
|
{{if .ForumList}}
|
|
<div class="rowblock topic_create_form" style="display: none;">
|
|
<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="topic_content" name="topic-content" placeholder="Insert post here" required></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="formrow topic_button_row">
|
|
<div class="formitem">
|
|
<button form="topic_create_form_form" class="formbutton">Create Topic</button>
|
|
{{if .CurrentUser.Perms.UploadFiles}}
|
|
<input name="quick_topic_upload_files" form="topic_create_form_form" id="quick_topic_upload_files" multiple type="file" style="display: none;" />
|
|
<label for="quick_topic_upload_files" class="formbutton add_file_button">Add File</label>{{end}}
|
|
<div id="upload_file_dock"></div>
|
|
<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="rowitem topic_left passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}" style="{{if .Creator.Avatar}}background-image: url({{.Creator.Avatar}});background-position: left;background-repeat: no-repeat;background-size: 64px;padding-left: 72px;{{end}}">
|
|
<span class="topic_inner_right rowsmall" style="float: right;">
|
|
<span class="replyCount">{{.PostCount}} replies</span><br />
|
|
<span class="lastReplyAt">{{.LastReplyAt}}</span>
|
|
</span>
|
|
<span>
|
|
<a class="rowtopic" href="{{.Link}}">{{.Title}}</a> {{if .ForumName}}<a class="rowsmall" href="{{.ForumLink}}">{{.ForumName}}</a>{{end}}
|
|
<br /><a class="rowsmall" href="{{.Creator.Link}}">Starter: {{.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>
|
|
</div>
|
|
<div class="rowitem topic_right passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}" style="{{if .LastUser.Avatar}}background-image: url({{.LastUser.Avatar}});background-position: left;background-repeat: no-repeat;background-size: 64px;padding-left: 72px;{{end}}">
|
|
<span>
|
|
<a href="{{.LastUser.Link}}" class="lastName" style="font-size: 14px;">{{.LastUser.Name}}</a><br>
|
|
<span class="rowsmall lastReplyAt">Last: {{.LastReplyAt}}</span>
|
|
</span>
|
|
</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" . }}
|