91f70d2a4a
Added basic support for server sync. Re-added a few missing defers. Renamed TO-DO to TODO across the entire codebase. Renamed StaticForumStore to MemoryForumStore. The ForumStore is now built on a sync.Map with a view slice for generating /forums rather than a slice. Renamed many more functions and variables to satisfy the linter. increase_post_user_stats() and decrease_post_user_stats() are now methods on the User struct. We also fix a bug where they take the moderator's score rather than the target user's into account when recalculating their level after a post / topic is deleted. Transitioned the topic list to CSS Grid for Tempra Simple, with a float fallback. Cosmo and Cosmo Conflux are now hidden from the theme list. Fixed more data races. Added more debug data to the template compiler logs.
76 lines
3.5 KiB
HTML
76 lines
3.5 KiB
HTML
{{template "header.html" . }}
|
|
{{template "panel-menu.html" . }}
|
|
<script>var form_vars = {
|
|
'forum_active': ['Hide','Show'],
|
|
'forum_preset': ['all','announce','members','staff','admins','archive','custom']};
|
|
</script>
|
|
|
|
<main class="colstack_right">
|
|
<div class="colstack_item colstack_head">
|
|
<div class="rowitem"><h1>Forums</h1></div>
|
|
</div>
|
|
<div id="panel_forums" class="colstack_item rowlist">
|
|
{{range .ItemList}}
|
|
<div class="rowitem editable_parent{{if eq .ID 1}} builtin_forum_divider{{end}}">
|
|
<span class="panel_floater">
|
|
<span data-field="forum_active" data-type="list" class="panel_tag editable_block forum_active {{if .Active}}forum_active_Show" data-value="1{{else}}forum_active_Hide" data-value="0{{end}}" title="Hidden"></span>
|
|
<span data-field="forum_preset" data-type="list" data-value="{{.Preset}}" class="panel_tag editable_block forum_preset forum_preset_{{.Preset}}" title="{{.PresetLang}}"></span>
|
|
|
|
<span class="panel_buttons">
|
|
{{if gt .ID 0}}<a class="panel_tag edit_fields hide_on_edit panel_right_button">Edit</a>
|
|
<a class="panel_right_button" href="/panel/forums/edit/submit/{{.ID}}"><button class='panel_tag submit_edit show_on_edit' type='submit'>Update</button></a>{{end}}
|
|
{{if gt .ID 1}}<a href="/panel/forums/delete/{{.ID}}?session={{$.CurrentUser.Session}}" class="panel_tag panel_right_button hide_on_edit">Delete</a>{{end}}
|
|
<a href="/panel/forums/edit/{{.ID}}" class="panel_tag panel_right_button show_on_edit">Full Edit</a>
|
|
</span>
|
|
</span>
|
|
<span style="float: left;">
|
|
{{/** TODO: Make sure the forum_active_name class is set and unset when the activity status of this forum is changed **/}}
|
|
<a data-field="forum_name" data-type="text" class="editable_block forum_name{{if not .Active}} forum_active_name{{end}}">{{.Name}}</a>
|
|
</span>
|
|
<br /><span data-field="forum_desc" data-type="text" class="editable_block forum_desc rowsmall">{{.Desc}}</span>
|
|
<div style="clear: both;"></div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
|
|
<div class="colstack_item colstack_head">
|
|
<div class="rowitem"><h1>Add Forum</h1></div>
|
|
</div>
|
|
<div class="colstack_item">
|
|
<form action="/panel/forums/create/?session={{.CurrentUser.Session}}" method="post">
|
|
<div class="formrow">
|
|
<div class="formitem formlabel"><a>Forum Name</a></div>
|
|
<div class="formitem"><input name="forum-name" type="text" placeholder="Super Secret Forum" /></div>
|
|
</div>
|
|
<div class="formrow">
|
|
<div class="formitem formlabel"><a>Description</a></div>
|
|
<div class="formitem"><input name="forum-desc" type="text" placeholder="Where all the super secret stuff happens" /></div>
|
|
</div>
|
|
<div class="formrow">
|
|
<div class="formitem formlabel"><a>Hidden?</a></div>
|
|
<div class="formitem"><select name="forum-active">
|
|
<option value="0">Yes</option>
|
|
<option value="1">No</option>
|
|
</select></div>
|
|
</div>
|
|
<div class="formrow">
|
|
<div class="formitem formlabel"><a>Preset</a></div>
|
|
<div class="formitem"><select name="forum-preset">
|
|
<option selected value="all">Everyone</option>
|
|
<option value="announce">Announcements</option>
|
|
<option value="members">Member Only</option>
|
|
<option value="staff">Staff Only</option>
|
|
<option value="admins">Admin Only</option>
|
|
<option value="archive">Archive</option>
|
|
<option value="custom">Custom</option>
|
|
</select></div>
|
|
</div>
|
|
<div class="formrow">
|
|
<div class="formitem"><button name="panel-button" class="formbutton">Add Forum</button></div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</main>
|
|
|
|
{{template "footer.html" . }}
|