b9885e9d7a
The benchmark now uses ten replies instead of one for a more relevant result. Slices are now used instead of maps for itemLists. The compiled template engine now supports slice loops. More routes are compiled now. Fixed a bug with the sorting of the itemLists in the templates. Guests can no longer see the reply creation forms. Fixed the notice system.
60 lines
4.3 KiB
HTML
60 lines
4.3 KiB
HTML
{{template "header.html" . }}
|
|
<div class="rowblock">
|
|
<form action='/topic/edit/submit/{{.Something.ID}}' method="post">
|
|
<div class="rowitem"{{ if .Something.Sticky }} style="background-color: #FFFFEA;"{{end}}>
|
|
<a class='topic_name hide_on_edit'>{{.Something.Title}}</a>
|
|
<span class='username topic_status_e topic_status_{{.Something.Status}} hide_on_edit' style="font-weight:normal;float: right;">{{.Something.Status}}</span>
|
|
<span class="username" style="border-right: 0;font-weight: normal;float: right;">Status</span>
|
|
{{if .CurrentUser.Is_Mod}}
|
|
<a href='/topic/edit/{{.Something.ID}}' class="username hide_on_edit open_edit" style="font-weight: normal;margin-left: 6px;">Edit</a>
|
|
<a href='/topic/delete/submit/{{.Something.ID}}' class="username" style="font-weight: normal;">Delete</a>
|
|
{{ if .Something.Sticky }}<a href='/topic/unstick/submit/{{.Something.ID}}' class="username" style="font-weight: normal;">Unpin</a>{{else}}<a href='/topic/stick/submit/{{.Something.ID}}' class="username" style="font-weight: normal;">Pin</a>{{end}}
|
|
|
|
<input class='show_on_edit topic_name_input' name="topic_name" value='{{.Something.Title}}' type="text" />
|
|
<select name="topic_status" class='show_on_edit topic_status_input' style='float: right;'>
|
|
<option>open</option>
|
|
<option>closed</option>
|
|
</select>
|
|
<button name="topic-button" class="formbutton show_on_edit submit_edit">Update</button>
|
|
{{end}}
|
|
<a href="/report/submit/{{.Something.ID}}?session={{.CurrentUser.Session}}&type=topic" class="username report_item" style="font-weight: normal;">Report</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="rowblock">
|
|
<div class="rowitem passive editable_parent" style="border-bottom: none;{{ if .Something.Avatar }}background-image: url({{ .Something.Avatar }}), url(/static/white-dot.jpg);background-position: 0px {{if le .Something.ContentLines 5}}-1{{end}}0px;background-repeat: no-repeat, repeat-y;background-size: 128px;padding-left: 136px;{{.Something.Css}}{{end}}">
|
|
<span class="hide_on_edit topic_content user_content">{{.Something.Content}}</span>
|
|
<textarea name="topic_content" class="show_on_edit topic_content_input">{{.Something.Content}}</textarea>
|
|
<br /><br />
|
|
<a href="/user/{{.Something.CreatedBy}}" class="username">{{.Something.CreatedByName}}</a>
|
|
{{if .Something.Tag}}<a class="username" style="float: right;">{{.Something.Tag}}</a>{{else if .Something.URLName}}<a href="{{.Something.URL}}" class="username" style="color: #505050;float: right;">{{.Something.URLName}}</a>
|
|
<a class="username" style="color: #505050;float: right;border-right: 0;">{{.Something.URLPrefix}}</a>{{end}}
|
|
</div>
|
|
</div><br />
|
|
<div class="rowblock" style="overflow: hidden;">
|
|
{{range .ItemList}}
|
|
<div class="rowitem passive deletable_block editable_parent" style="{{ if .Avatar }}background-image: url({{.Avatar}}), url(/static/white-dot.jpg);background-position: 0px {{if le .ContentLines 5}}-1{{end}}0px;background-repeat: no-repeat, repeat-y;background-size: 128px;padding-left: 136px;{{.Css}}{{end}}">
|
|
<span class="editable_block user_content">{{.ContentHtml}}</span>
|
|
<br /><br />
|
|
<a href="/user/{{.CreatedBy}}" class="username">{{.CreatedByName}}</a>
|
|
{{if $.CurrentUser.Is_Mod}}<a href="/reply/edit/submit/{{.ID}}"><button class="username edit_item">Edit</button></a>
|
|
<a href="/reply/delete/submit/{{.ID}}"><button class="username delete_item">Delete</button></a>{{end}}
|
|
<a href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=reply"><button class="username report_item">Report</button></a>
|
|
{{if .Tag}}<a class="username" style="float: right;">{{.Tag}}</a>{{else if .URLName}}<a href="{{.URL}}" class="username" style="color: #505050;float: right;" rel="nofollow">{{.URLName}}</a>
|
|
<a class="username" style="color: #505050;float: right;border-right: 0;">{{.URLPrefix}}</a>{{end}}
|
|
</div>{{end}}
|
|
</div>
|
|
{{if not (.CurrentUser.Is_Banned) and (.CurrentUser.Loggedin)}}
|
|
<div class="rowblock">
|
|
<form action="/reply/create/" method="post">
|
|
<input name="tid" value='{{.Something.ID}}' type="hidden" />
|
|
<div class="formrow">
|
|
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
|
|
</div>
|
|
<div class="formrow">
|
|
<div class="formitem"><button name="reply-button" class="formbutton">Create Reply</button></div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
{{template "footer.html" . }} |