mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-04 03:56:24 -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
|
@ -1,82 +1,85 @@
|
|||
{{template "page_header.html" .}}
|
||||
<header>
|
||||
<h1 id="board-title">/{{$.board.Dir}}/ - {{$.board.Title}}</h1>
|
||||
<span id="board-subtitle">{{$.board.Subtitle}}</span>
|
||||
</header>
|
||||
<hr />
|
||||
<div id="right-sidelinks">
|
||||
<a href="{{.config.SiteWebfolder}}{{.board.Dir}}/catalog.html">Board catalog</a><br />
|
||||
</div>
|
||||
{{template "postbox.html" .}}
|
||||
<hr />
|
||||
<div id="content">
|
||||
<form action="/util" method="POST" id="main-form">
|
||||
{{range $t, $thread := .threads}}
|
||||
{{$op := $thread.OP}}
|
||||
<div class="thread">
|
||||
<div class="op-post" id="op{{$op.ID}}">
|
||||
{{if ne $op.Filename ""}}
|
||||
{{if ne $op.Filename "deleted"}}
|
||||
<div class="file-info">File: <a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/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}}
|
||||
<div class="file-deleted-box" style="text-align:center;">File removed</div>
|
||||
{{end}}
|
||||
<header>
|
||||
<h1 id="board-title">/{{$.board.Dir}}/ - {{$.board.Title}}</h1>
|
||||
<span id="board-subtitle">{{$.board.Subtitle}}</span>
|
||||
</header><hr />
|
||||
<div id="right-sidelinks">
|
||||
<a href="{{.config.SiteWebfolder}}{{.board.Dir}}/catalog.html">Board catalog</a><br />
|
||||
</div>
|
||||
{{- template "postbox.html" .}}
|
||||
<hr />
|
||||
<div id="content">
|
||||
<form action="/util" method="POST" id="main-form">
|
||||
{{- range $t, $thread := .threads}}{{$op := $thread.OP}}
|
||||
<div class="thread">
|
||||
<div class="op-post" id="op{{$op.ID}}">
|
||||
{{- if ne $op.Filename "" -}}
|
||||
{{- if ne $op.Filename "deleted"}}
|
||||
<div class="file-info">File: <a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/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}}
|
||||
<div class="file-deleted-box" style="text-align:center;">File removed</div>
|
||||
{{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>[<a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/res/{{$op.ID}}.html">View</a>]</span></span><br />
|
||||
<div class="post-text">{{truncateMessage $op.MessageHTML 2222 18}}</div>
|
||||
{{- if gt $thread.NumReplies 3}}
|
||||
<b>{{subtract $thread.NumReplies 3}} post{{if gt $thread.NumReplies 4}}s{{end}} omitted</b>
|
||||
{{end}}
|
||||
</div>
|
||||
{{- range $reply_num,$reply := $thread.BoardReplies}}
|
||||
<div class="reply-container" id="replycontainer{{$reply.ID}}">
|
||||
<a class="anchor" id="{{$reply.ID}}"></a>
|
||||
<div class="reply" id="reply{{$reply.ID}}">
|
||||
<input type="checkbox" id="check{{$reply.ID}}" name="check{{$reply.ID}}" /> <label class="post-info" for="check{{$reply.ID}}"> <span class="subject">{{$reply.Subject}}</span> <span class="postername">{{if ne $reply.Email ""}}<a href="mailto:{{$reply.Email}}">{{end}}{{if ne $reply.Name ""}}{{$reply.Name}}{{else}}{{if eq $reply.Tripcode ""}}{{$.board.Anonymous}}{{end}}{{end}}{{if ne $reply.Email ""}}</a>{{end}}</span>{{if ne $reply.Tripcode ""}}<span class="tripcode">!{{$reply.Tripcode}}</span>{{end}} {{formatTimestamp $reply.Timestamp}} </label><a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/res/{{$op.ID}}.html#{{$reply.ID}}">No.</a> <a href="javascript:quote({{$reply.ID}})" class="backlink-click">{{$reply.ID}}</a> <span class="post-links"><span class="thread-ddown">[<a href="javascript:void(0)">▼</a>]</span></span><br />
|
||||
{{if ne $reply.Filename ""}}
|
||||
{{if ne $reply.Filename "deleted" -}}
|
||||
<span class="file-info">File: <a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/src/{{$reply.Filename}}" target="_blank">{{$reply.Filename}}</a> - ({{formatFilesize $reply.Filesize}} , {{$reply.ImageW}}x{{$reply.ImageH}}, {{$reply.FilenameOriginal}})</span><br />
|
||||
<a class="upload-container" href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/src/{{$reply.Filename}}"><img src="{{$.config.SiteWebfolder}}{{$.board.Dir}}/thumb/{{getThreadThumbnail $reply.Filename}}" alt="{{$.config.SiteWebfolder}}{{$.board.Dir}}/src/{{$reply.Filename}}" width="{{$reply.ThumbW}}" height="{{$reply.ThumbH}}" class="upload" /></a>
|
||||
{{else}}
|
||||
<div class="file-deleted-box" style="text-align:center;">File removed</div>
|
||||
{{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>[<a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/res/{{$op.ID}}.html">View</a>]</span></span><br />
|
||||
<div class="post-text">{{truncateMessage $op.MessageHTML 2222 18}}</div>
|
||||
{{if gt $thread.NumReplies 3}}
|
||||
<b>{{subtract $thread.NumReplies 3}} post{{if gt $thread.NumReplies 4}}s{{end}} omitted</b>
|
||||
{{end}}
|
||||
</div>
|
||||
{{range $reply_num,$reply := $thread.BoardReplies}}
|
||||
<div class="reply-container" id="replycontainer{{$reply.ID}}">
|
||||
<a class="anchor" id="{{$reply.ID}}"></a>
|
||||
<div class="reply" id="reply{{$reply.ID}}">
|
||||
<input type="checkbox" id="check{{$reply.ID}}" name="check{{$reply.ID}}" /> <label class="post-info" for="check{{$reply.ID}}"> <span class="subject">{{$reply.Subject}}</span> <span class="postername">{{if ne $reply.Email ""}}<a href="mailto:{{$reply.Email}}">{{end}}{{if ne $reply.Name ""}}{{$reply.Name}}{{else}}{{if eq $reply.Tripcode ""}}{{$.board.Anonymous}}{{end}}{{end}}{{if ne $reply.Email ""}}</a>{{end}}</span>{{if ne $reply.Tripcode ""}}<span class="tripcode">!{{$reply.Tripcode}}</span>{{end}} {{formatTimestamp $reply.Timestamp}} </label><a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/res/{{$op.ID}}.html#{{$reply.ID}}">No.</a> <a href="javascript:quote({{$reply.ID}})" class="backlink-click">{{$reply.ID}}</a> <span class="post-links"><span class="thread-ddown">[<a href="javascript:void(0)">▼</a>]</span></span><br />
|
||||
{{if ne $reply.Filename ""}}
|
||||
{{if ne $reply.Filename "deleted"}}
|
||||
<span class="file-info">File: <a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/src/{{$reply.Filename}}" target="_blank">{{$reply.Filename}}</a> - ({{formatFilesize $reply.Filesize}} , {{$reply.ImageW}}x{{$reply.ImageH}}, {{$reply.FilenameOriginal}})</span><br />
|
||||
<a class="upload-container" href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/src/{{$reply.Filename}}"><img src="{{$.config.SiteWebfolder}}{{$.board.Dir}}/thumb/{{getThreadThumbnail $reply.Filename}}" alt="{{$.config.SiteWebfolder}}{{$.board.Dir}}/src/{{$reply.Filename}}" width="{{$reply.ThumbW}}" height="{{$reply.ThumbH}}" class="upload" /></a>
|
||||
{{else}}
|
||||
<div class="file-deleted-box" style="text-align:center;">File removed</div>
|
||||
{{end}}{{end}}
|
||||
<div class="post-text">{{$reply.MessageHTML}}</div>
|
||||
</div>
|
||||
</div>{{end}}
|
||||
</div>
|
||||
<hr />{{end}}
|
||||
<div id="right-bottom-content">
|
||||
<div id="report-delbox">
|
||||
<input type="hidden" name="board" value="{{.board.Dir}}" />
|
||||
<input type="hidden" name="boardid" value="{{.board.ID}}" />
|
||||
<label>[<input type="checkbox" name="fileonly"/>File only]</label> <input type="password" size="10" name="password" id="delete-password" /> <input type="submit" name="delete_btn" value="Delete" onclick="return confirm('Are you sure you want to delete these posts?')" /><br />
|
||||
Reason: <input type="text" size="10" name="reason" id="reason" /> <input type="submit" name="report_btn" value="Report" /><br />
|
||||
Edit post <input type="submit" name="edit_btn" value="Edit" />
|
||||
{{end -}}
|
||||
<div class="post-text">{{$reply.MessageHTML}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id="left-bottom-content">
|
||||
<table id="pages">
|
||||
<tr><td>{{if gt .board.CurrentPage 2}}
|
||||
<form method="GET" action="{{.config.SiteWebfolder}}{{.board.Dir}}/{{subtract .board.CurrentPage 1}}.html">
|
||||
<input type="submit" value="Previous" />
|
||||
</form>
|
||||
{{else if intEq .board.CurrentPage 2}}
|
||||
<form method="GET" action="{{.config.SiteWebfolder}}{{.board.Dir}}/board.html">
|
||||
<input type="submit" value="Previous" />
|
||||
</form>
|
||||
{{else}}Previous{{end}}</td>
|
||||
<td>{{range $_,$i := makeLoop .board.NumPages 1}} [{{if eq $i $.board.CurrentPage}}<b>{{end}}<a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/{{if intEq $i 1}}board{{else}}{{$i}}{{end}}.html">{{$i}}</a>{{if eq $i $.board.CurrentPage}}</b>{{end}}]{{end}}</td>
|
||||
<td>{{if lt .board.CurrentPage .board.NumPages}}
|
||||
<form method="GET" action="{{.config.SiteWebfolder}}{{.board.Dir}}/{{add .board.CurrentPage 1}}.html">
|
||||
<input type="submit" value="Next" />
|
||||
</form>
|
||||
{{else}}Next{{end}}</td></tr>
|
||||
</table>
|
||||
<span id="boardmenu-bottom">
|
||||
[{{range $i, $boardlink := $.boards}}{{if gt $i 0}}/{{end}} <a href="{{$.config.SiteWebfolder}}{{$boardlink.Dir}}/">{{$boardlink.Dir}}</a> {{end}}]
|
||||
</span>
|
||||
{{end -}}
|
||||
</div><hr />
|
||||
{{- end}}
|
||||
<div id="right-bottom-content">
|
||||
<div id="report-delbox">
|
||||
<input type="hidden" name="board" value="{{.board.Dir}}" />
|
||||
<input type="hidden" name="boardid" value="{{.board.ID}}" />
|
||||
<label>[<input type="checkbox" name="fileonly"/>File only]</label> <input type="password" size="10" name="password" id="delete-password" /> <input type="submit" name="delete_btn" value="Delete" onclick="return confirm('Are you sure you want to delete these posts?')" /><br />
|
||||
Reason: <input type="text" size="10" name="reason" id="reason" /> <input type="submit" name="report_btn" value="Report" /><br />
|
||||
Edit post <input type="submit" name="edit_btn" value="Edit" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id="left-bottom-content">
|
||||
<table id="pages">
|
||||
<tr>
|
||||
<td>{{if gt .board.CurrentPage 2}}
|
||||
<form method="GET" action="{{.config.SiteWebfolder}}{{.board.Dir}}/{{subtract .board.CurrentPage 1}}.html">
|
||||
<input type="submit" value="Previous" />
|
||||
</form>
|
||||
{{else if intEq .board.CurrentPage 2}}
|
||||
<form method="GET" action="{{.config.SiteWebfolder}}{{.board.Dir}}/board.html">
|
||||
<input type="submit" value="Previous" />
|
||||
</form>
|
||||
{{else}}Previous{{end}}</td>
|
||||
<td>{{range $_,$i := makeLoop .board.NumPages 1}} [{{if eq $i $.board.CurrentPage}}<b>{{end}}<a href="{{$.config.SiteWebfolder}}{{$.board.Dir}}/{{if intEq $i 1}}board{{else}}{{$i}}{{end}}.html">{{$i}}</a>{{if eq $i $.board.CurrentPage}}</b>{{end}}]{{end}}</td>
|
||||
<td>{{if lt .board.CurrentPage .board.NumPages}}
|
||||
<form method="GET" action="{{.config.SiteWebfolder}}{{.board.Dir}}/{{add .board.CurrentPage 1}}.html">
|
||||
<input type="submit" value="Next" />
|
||||
</form>
|
||||
{{else}}Next{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<span id="boardmenu-bottom">
|
||||
[{{range $i, $boardlink := $.boards}}{{if gt $i 0}}/{{end}} <a href="{{$.config.SiteWebfolder}}{{$boardlink.Dir}}/">{{$boardlink.Dir}}</a> {{end}}]
|
||||
</span>
|
||||
</div>
|
||||
{{template "page_footer.html" .}}
|
||||
</div>
|
||||
{{template "page_footer.html" .}}
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
This will be used for storing configuration-dependent JS variables,
|
||||
instead of loading them on every HTML page.
|
||||
*/ -}}
|
||||
var styles = [{{range $ii, $style := .Styles -}}
|
||||
{{if gt $ii 0}}, {{end -}}
|
||||
{Name: "{{js $style.Name}}", Filename: "{{js $style.Filename}}"}
|
||||
{{- end}}];
|
||||
var styles = [
|
||||
{{- range $ii, $style := .Styles -}}
|
||||
{{if gt $ii 0}},{{end -}}
|
||||
{Name: "{{js $style.Name}}", Filename: "{{js $style.Filename}}"}
|
||||
{{- end -}}
|
||||
];
|
||||
var defaultStyle = "{{.DefaultStyle}}";
|
||||
var webroot = "{{.SiteWebfolder}}";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{template "page_header.html" .}}
|
||||
{{- template "page_header.html" .}}
|
||||
<div id="top-pane">
|
||||
<span id="site-title">{{.config.SiteName}}</span><br />
|
||||
<span id="site-slogan">{{.config.SiteSlogan}}</span>
|
||||
|
@ -12,26 +12,37 @@
|
|||
<div class="section-block">
|
||||
<div class="section-title-block"><b>Boards</b></div>
|
||||
<div class="section-body">
|
||||
{{range $_, $section := .sections}}{{if not $section.Hidden}}<ul style="float:left; list-style: none">
|
||||
<li style="text-align: center; font-weight: bold"><b><u>{{$section.Name}}</u></b></li>
|
||||
{{range $_, $board := $.boards}}{{if and (eq $board.Section $section.ID) (ne $board.Dir $.config.Modboard)}}
|
||||
<li><a href="{{$.config.SiteWebfolder}}{{$board.Dir}}/" title="{{$board.Description}}">/{{$board.Dir}}/</a> — {{$board.Title}}</li>
|
||||
{{end}}{{end}}
|
||||
</ul>{{end}}{{end}}
|
||||
{{- range $_, $section := .sections -}}
|
||||
{{if not $section.Hidden}}
|
||||
<ul style="float:left; list-style: none">
|
||||
<li style="text-align: center; font-weight: bold"><b><u>{{$section.Name}}</u></b></li>
|
||||
{{range $_, $board := $.boards}}
|
||||
{{if and (eq $board.Section $section.ID) (ne $board.Dir $.config.Modboard)}}
|
||||
<li><a href="{{$.config.SiteWebfolder}}{{$board.Dir}}/" title="{{$board.Description}}">/{{$board.Dir}}/</a> — {{$board.Title}}</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{if gt .config.MaxRecentPosts 0}}
|
||||
{{- if gt .config.MaxRecentPosts 0}}
|
||||
<div class="section-block">
|
||||
<div class="section-title-block"><b>Recent Posts</b></div>
|
||||
<div class="section-body">
|
||||
<div id="recent-posts">
|
||||
{{range $i, $post := $.recent_posts}}{{$postURL := getPostURL $post "recent" false}}
|
||||
{{- range $i, $post := $.recent_posts}}{{$postURL := getPostURL $post "recent" false}}
|
||||
<div class="recent-post">
|
||||
{{if and (ne $post.Filename "deleted") (ne $post.Filename "")}}<a href="{{$postURL}}" class="front-reply" target="_blank"><img src="{{$.config.SiteWebfolder}}{{$post.BoardName}}/thumb/{{getThreadThumbnail $post.Filename}}" alt="post thumbnail"/></a><br />
|
||||
{{else}}<div class="file-deleted-box" style="text-align:center; float:none;"><a href="{{$postURL}}" class="front-reply" target="_blank">No file</a></div>{{end}}<br />
|
||||
<a href="{{$.config.SiteWebfolder}}{{$post.BoardName}}/">/{{$post.BoardName}}/</a>
|
||||
<hr />
|
||||
{{truncateMessage (stripHTML $post.Message) 40 4}}</div>{{end}}</div>
|
||||
</div>{{end}}</div>
|
||||
{{if and (ne $post.Filename "deleted") (ne $post.Filename "") -}}
|
||||
<a href="{{$postURL}}" class="front-reply" target="_blank"><img src="{{$.config.SiteWebfolder}}{{$post.BoardName}}/thumb/{{getThreadThumbnail $post.Filename}}" alt="post thumbnail"/></a><br />
|
||||
{{else}}
|
||||
<div class="file-deleted-box" style="text-align:center; float:none;"><a href="{{$postURL}}" class="front-reply" target="_blank">No file</a></div>
|
||||
{{- end}}<br />
|
||||
<a href="{{$.config.SiteWebfolder}}{{$post.BoardName}}/">/{{$post.BoardName}}/</a><hr />
|
||||
{{truncateMessage (stripHTML $post.Message) 40 4}}
|
||||
</div>{{end}}
|
||||
</div>
|
||||
</div>{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "page_footer.html" .}}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div id="footer">
|
||||
<a href="{{$.config.SiteWebfolder}}">Home</a> | <a href="{{$.config.SiteWebfolder}}#boards">Boards</a> | <a href="{{$.config.SiteWebfolder}}#rules">Rules</a> | <a href="{{$.config.SiteWebfolder}}#faq">FAQ</a><br />
|
||||
Powered by <a href="http://github.com/eggbertx/gochan/">Gochan {{version}}</a><br />
|
||||
</div>
|
||||
<a href="{{$.config.SiteWebfolder}}">Home</a> | <a href="{{$.config.SiteWebfolder}}#boards">Boards</a> | <a href="{{$.config.SiteWebfolder}}#rules">Rules</a> | <a href="{{$.config.SiteWebfolder}}#faq">FAQ</a><br />
|
||||
Powered by <a href="http://github.com/eggbertx/gochan/">Gochan {{version}}</a><br />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
{{with .board}}
|
||||
{{with $.op}}
|
||||
{{if ne $.op.Subject ""}}<title>/{{$.board.Dir}}/ - {{truncateString $.op.Subject 20 true}}</title>
|
||||
{{else if ne $.op.MessageHTML ""}}<title>/{{$.board.Dir}}/ - {{truncateString $.op.MessageText 20 true}}</title>
|
||||
{{else}}<title>/{{$.board.Dir}}/ - #{{$.op.ID}}</title>{{end}}
|
||||
{{else}}<title>/{{$.board.Dir}}/ - {{$.board.Title}}</title>{{end}}
|
||||
{{else}}<title>{{.config.SiteName}}</title>{{end}}
|
||||
{{with .board -}}
|
||||
{{with $.op -}}
|
||||
{{if ne $.op.Subject "" -}}<title>/{{$.board.Dir}}/ - {{truncateString $.op.Subject 20 true}}</title>
|
||||
{{- else if ne $.op.MessageHTML "" -}}<title>/{{$.board.Dir}}/ - {{truncateString $.op.MessageText 20 true}}</title>
|
||||
{{- else}}<title>/{{$.board.Dir}}/ - #{{$.op.ID}}</title>{{end}}
|
||||
{{- else}}<title>/{{$.board.Dir}}/ - {{$.board.Title}}</title>{{end}}
|
||||
{{- else}}<title>{{.config.SiteName}}</title>{{end}}
|
||||
<link rel="stylesheet" href="{{.config.SiteWebfolder}}css/global.css" />
|
||||
<link id="theme" rel="stylesheet" href="{{.config.SiteWebfolder}}css/{{.config.DefaultStyle}}" />
|
||||
<link rel="shortcut icon" href="{{.config.SiteWebfolder}}favicon.png">
|
||||
|
@ -19,6 +19,6 @@
|
|||
<script type="text/javascript" src="{{$.config.SiteWebfolder}}javascript/manage.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="topbar">
|
||||
{{range $i, $board := .boards}}<a href="{{$.config.SiteWebfolder}}{{$board.Dir}}/" class="topbar-item">/{{$board.Dir}}/</a>{{end}}
|
||||
</div>
|
||||
<div id="topbar">
|
||||
{{range $i, $board := .boards}}<a href="{{$.config.SiteWebfolder}}{{$board.Dir}}/" class="topbar-item">/{{$board.Dir}}/</a>{{end}}
|
||||
</div>
|
|
@ -1,10 +1,13 @@
|
|||
{{define "postbox.html"}}
|
||||
<div id="postbox-area">
|
||||
<form id="postform" name="postform" action="/post" method="POST" enctype="multipart/form-data">
|
||||
{{with .op}}<input type="hidden" name="threadid" value="{{$.op.ID}}" />
|
||||
{{- with .op}}
|
||||
<input type="hidden" name="threadid" value="{{$.op.ID}}" />
|
||||
<input type="hidden" name="boardid" value="{{$.board.ID}}" />
|
||||
{{else}}<input type="hidden" name="threadid" value="0" />
|
||||
<input type="hidden" name="boardid" value="{{$.board.ID}}" />{{end}}
|
||||
{{- else -}}
|
||||
<input type="hidden" name="threadid" value="0" />
|
||||
<input type="hidden" name="boardid" value="{{$.board.ID}}" />
|
||||
{{- end}}
|
||||
<table id="postbox-static">
|
||||
<tr><th class="postblock">Name</th><td><input type="text" name="postname" maxlength="100" size="28" /></td></tr>
|
||||
<tr><th class="postblock">Email</th><td><input type="text" name="postemail" maxlength="100" size="28" /></td></tr>
|
||||
|
@ -13,8 +16,7 @@
|
|||
<input type="submit" value="{{with .op}}Reply{{else}}Post{{end}}"/></td></tr>
|
||||
<tr><th class="postblock">Message</th><td><textarea rows="4" cols="48" name="postmsg" id="postmsg"></textarea></td></tr>
|
||||
<tr><th class="postblock">File</th><td><input name="imagefile" type="file"><input type="checkbox" id="spoiler" name="spoiler"/><label for="spoiler">Spoiler</label></td></tr>
|
||||
<input type="password" name="dummy2" style="display:none"/>
|
||||
<tr><th class="postblock">Password</th><td><input type="password" id="postpassword" name="postpassword" size="14" /> (for post/file deletion)</td></tr>
|
||||
</table>
|
||||
</table><input type="password" name="dummy2" style="display:none"/>
|
||||
</form>
|
||||
</div>{{end}}
|
|
@ -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