mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-27 15:26:25 -07:00
Start making templates more readable
Also change most remaining underscore var names to camelCase
This commit is contained in:
parent
6a96420e3e
commit
267a5eeb6f
16 changed files with 446 additions and 465 deletions
|
@ -2,8 +2,7 @@
|
|||
<header>
|
||||
<h1 id="board-title">/{{$.board.Dir}}/ - {{$.board.Title}}</h1>
|
||||
<span id="board-subtitle">{{$.board.Subtitle}}</span>
|
||||
</header>
|
||||
<hr />
|
||||
</header><hr />
|
||||
<div id="threadlinks-top">
|
||||
<a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/board.html" >Return</a><br />
|
||||
<select id="changepage" onchange="changePage(this)">
|
||||
|
@ -17,23 +16,23 @@
|
|||
<div id="right-sidelinks">
|
||||
<a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/catalog.html">Board catalog</a><br />
|
||||
</div>
|
||||
{{template "postbox.html" .}}
|
||||
<hr />
|
||||
{{template "postbox.html" .}}<hr />
|
||||
<div id="content">
|
||||
<form action="/util" method="POST" id="main-form">
|
||||
<div class="thread" id="{{$.op.ID}}">
|
||||
<div class="op-post" id="op{{.op.ID}}">
|
||||
{{if ne $.op.Filename ""}}
|
||||
{{if ne $.op.Filename "deleted"}}
|
||||
{{- if ne $.op.Filename "deleted" -}}
|
||||
<div class="file-info">File: <a href="../src/{{.op.Filename}}" target="_blank">{{$.op.Filename}}</a> - ({{formatFilesize $.op.Filesize}} , {{$.op.ImageW}}x{{$.op.ImageH}}, {{$.op.FilenameOriginal}})</div>
|
||||
<a class="upload-container" href="{{.config.SiteWebfolder}}{{.board.Dir}}/src/{{.op.Filename}}"><img src="{{.config.SiteWebfolder}}{{.board.Dir}}/thumb/{{getThreadThumbnail .op.Filename}}" alt="{{$.config.SiteWebfolder}}{{$.board.Dir}}/src/{{.op.Filename}}" width="{{.op.ThumbW}}" height="{{.op.ThumbH}}" class="upload" /></a>
|
||||
{{else}}
|
||||
{{- else}}
|
||||
<div class="file-deleted-box" style="text-align:center;">File removed</div>
|
||||
{{end}}{{end}}
|
||||
{{end}}
|
||||
{{end -}}
|
||||
<input type="checkbox" id="check{{.op.ID}}" name="check{{.op.ID}}" /><label class="post-info" for="check{{.op.ID}}"> <span class="subject">{{.op.Subject}}</span> <span class="postername">{{if ne .op.Email ""}}<a href="mailto:{{.op.Email}}">{{end}}{{if ne .op.Name ""}}{{.op.Name}}{{else}}{{if eq .op.Tripcode ""}}{{.board.Anonymous}}{{end}}{{end}}{{if ne .op.Email ""}}</a>{{end}}</span>{{if ne .op.Tripcode ""}}<span class="tripcode">!{{.op.Tripcode}}</span>{{end}} {{formatTimestamp .op.Timestamp}} </label><a href="{{$.config.SiteWebfolder}}{{.board.Dir}}/res/{{.op.ID}}.html#{{.op.ID}}">No.</a> <a href="javascript:quote({{.op.ID}})" class="backlink-click">{{.op.ID}}</a> <span class="post-links"> <span class="thread-ddown">[<a href="javascript:void(0)">▼</a>]</span></span><br />
|
||||
<div class="post-text">{{.op.MessageHTML}}</div>
|
||||
</div>
|
||||
{{range $reply_num,$reply := .posts}}
|
||||
{{range $reply_num,$reply := .posts -}}
|
||||
<div class="reply-container" id="replycontainer{{$reply.ID}}">
|
||||
<a class="anchor" id="{{$reply.ID}}"></a>
|
||||
<div class="reply" id="reply{{$reply.ID}}">
|
||||
|
@ -47,9 +46,9 @@
|
|||
{{end}}{{end}}
|
||||
<div class="post-text">{{$reply.MessageHTML}}</div>
|
||||
</div>
|
||||
</div>{{end}}
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
{{end}}
|
||||
</div><hr />
|
||||
<div id="right-bottom-content">
|
||||
<div id="report-delbox">
|
||||
<input type="hidden" name="board" value="{{.board.Dir}}" />
|
||||
|
@ -64,15 +63,18 @@
|
|||
<table id="pages">
|
||||
<tr>
|
||||
<td><a href="{{.config.SiteWebfolder}}{{.board.Dir}}/">Return</a></td>
|
||||
<td>{{if gt .op.CurrentPage 1}}
|
||||
<td>{{- if gt .op.CurrentPage 1 -}}
|
||||
<form method="GET" action="{{.config.SiteWebfolder}}{{.board.Dir}}/res/{{.op.ID}}p{{subtract .op.CurrentPage 1}}.html">
|
||||
<input type="submit" value="Previous" />
|
||||
</form>
|
||||
{{else}}Previous{{end}}
|
||||
{{- else}}Previous{{end -}}
|
||||
</td>
|
||||
<td>[<a href="{{.config.SiteWebfolder}}{{.board.Dir}}/res/{{.op.ID}}.html">All</a>]
|
||||
{{range $i,$_ := makeLoop .op.NumPages 0}}
|
||||
[{{if eq $i (subtract $.op.CurrentPage 1)}}<b>{{end}}<a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/res/{{$.op.ID}}p{{add $i 1}}.html">{{add $i 1}}</a>{{if eq $i (subtract $.op.CurrentPage 1)}}</b>{{end}}]{{end}}</td>
|
||||
{{- range $i,$_ := makeLoop .op.NumPages 0 -}}
|
||||
[{{if eq $i (subtract $.op.CurrentPage 1)}}<b>{{end}}
|
||||
<a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/res/{{$.op.ID}}p{{add $i 1}}.html">{{add $i 1}}</a>
|
||||
{{if eq $i (subtract $.op.CurrentPage 1)}}</b>{{end}}]
|
||||
{{end}}</td>
|
||||
<td>{{if lt .op.CurrentPage .op.NumPages}}
|
||||
<form method="GET" action="{{.config.SiteWebfolder}}{{.board.Dir}}/res/{{.op.ID}}p{{add .op.CurrentPage 1}}.html">
|
||||
<input type="submit" value="Next" />
|
||||
|
@ -80,7 +82,9 @@
|
|||
{{else}}Next{{end}}</td></tr>
|
||||
</table>
|
||||
<span id="boardmenu-bottom">
|
||||
[{{range $i, $boardlink := .boards}} {{if gt $i 0}}/{{end}} <a href="/{{$boardlink.Dir}}/">{{$boardlink.Dir}}</a> {{end}}]
|
||||
[{{range $i, $boardlink := .boards -}}
|
||||
{{if gt $i 0}}/{{end -}} <a href="/{{$boardlink.Dir}}/">{{$boardlink.Dir}}</a>
|
||||
{{- end}}]
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue