diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/archive.html | 60 | ||||
-rw-r--r-- | views/catalog.html | 2 | ||||
-rw-r--r-- | views/npost.html | 4 | ||||
-rw-r--r-- | views/nposts.html | 4 | ||||
-rw-r--r-- | views/partials/post_nav.html | 12 | ||||
-rw-r--r-- | views/partials/top.html | 4 |
6 files changed, 74 insertions, 12 deletions
diff --git a/views/archive.html b/views/archive.html new file mode 100644 index 0000000..a5184a4 --- /dev/null +++ b/views/archive.html @@ -0,0 +1,60 @@ +{{ template "partials/top" .page }} + +{{ $board := .page.Board }} + +<hr> +<ul id="navlinks"> + <li>[<a href="/{{ $board.Name }}">Return</a>]</li> + {{ template "partials/post_nav" .page }} + <li>[<a href="#bottom" id="top">Bottom</a>]</li> +</ul> +<hr> + +{{ if .page.Posts }} +<table align="center" style="table-layout:fixed; width:90%;"> + <tr> + {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + <th style="width: 45px;"></th> + {{ end }} + <th style="width: 110px">No.</th> + <th>Excerpt</th> + <th style="width: 60px;"></th> + </tr> + {{ range $i, $e := .page.Posts }} + {{ if mod $i 2 }} + <tr class="box-alt"> + {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + <td>[<a href="/poparchive?id={{ $e.Id }}&board={{ $board.Name }}">Pop</a>]</td> + {{ end }} + <td>{{ shortURL $board.Actor.Outbox $e.Id }}</td> + <td style="overflow: hidden; word-wrap: break-word; text-overflow: ellipsis;">{{ shortExcerpt $e }}</td> + <td style="text-align: center;">[<a href="/{{ $board.Actor.Name }}/{{ shortURL $board.Actor.Outbox $e.Id }}">View</a>]</td> + </tr> + {{ else }} + <tr class="box"> + {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + <td>[<a href="/poparchive?id={{ $e.Id }}">Pop</a>]</td> + {{ end }} + <td>{{ shortURL $board.Actor.Outbox $e.Id }}</td> + <td style="overflow: hidden; word-wrap: break-word; text-overflow: ellipsis;">{{ shortExcerpt $e }}</td> + <td style="text-align: center;">[<a href="/{{ $board.Actor.Name }}/{{ shortURL $board.Actor.Outbox $e.Id }}">View</a>]</td> + </tr> + {{ end }} + {{ end }} +</table> +{{ end }} + +<hr> + +<ul id="navlinks"> + <li>[<a href="/{{ $board.Name }}">Return</a>]</li> + {{ template "partials/post_nav" .page }} + <li>[<a href="#top" id="bottom">Top</a>]</li> +</ul> + +<hr> + +{{ template "partials/bottom" .page }} +{{ template "partials/footer" .page }} +{{ template "partials/general_scripts" .page }} +{{ template "partials/post_scripts" .page }} diff --git a/views/catalog.html b/views/catalog.html index d4ec009..6a99d8f 100644 --- a/views/catalog.html +++ b/views/catalog.html @@ -6,6 +6,7 @@ <ul id="navlinks"> <li>[<a href="/{{ .page.Board.Name }}">Return</a>]</li> {{ template "partials/post_nav" .page }} + <li>[<a href="#bottom" id="top">Bottom</a>]</li> </ul> <hr> @@ -81,6 +82,7 @@ <ul id="navlinks"> <li>[<a href="/{{ .page.Board.Name }}">Return</a>]</li> {{ template "partials/post_nav" .page }} + <li>[<a href="#top" id="bottom">Top</a>]</li> </ul> <hr> diff --git a/views/npost.html b/views/npost.html index 07de021..7c22b9b 100644 --- a/views/npost.html +++ b/views/npost.html @@ -4,8 +4,8 @@ <ul id="navlinks"> <li>[<a href="/{{ .page.Board.Name }}">Return</a>]</li> - <li>[<a href="/{{ .page.Board.Name }}/catalog">Catalog</a>]</li> {{ template "partials/post_nav" .page }} + <li>[<a href="#bottom" id="top">Bottom</a>]</li> </ul> <hr> @@ -19,8 +19,8 @@ <td> <ul id="navlinks"> <li>[<a href="/{{ .page.Board.Name }}">Return</a>]</li> - <li>[<a href="/{{ .page.Board.Name }}/catalog">Catalog</a>]</li> {{ template "partials/post_nav" .page }} + <li>[<a href="#top" id="bottom">Top</a>]</li> <li><input id="autoreload-checkbox" type="checkbox" onclick="autoTimer()"> Auto refresh <span id="autoreload-countdown" style="visibility: hidden;">0</span></li> </ul> </td> diff --git a/views/nposts.html b/views/nposts.html index 567b945..9ce120b 100644 --- a/views/nposts.html +++ b/views/nposts.html @@ -4,8 +4,8 @@ <hr> <ul id="navlinks"> - <li>[<a href="/{{ .page.Board.Name }}/catalog">Catalog</a>]</li> {{ template "partials/post_nav" .page }} + <li>[<a href="#bottom" id="top">Bottom</a>]</li> </ul> {{ template "partials/posts" .page }} @@ -14,8 +14,8 @@ <ul id="navlinks"> - <li>[<a href="/{{ .page.Board.Name }}/catalog">Catalog</a>]</li> {{ template "partials/post_nav" .page }} + <li>[<a href="#top" id="bottom">Top</a>]</li> </ul> <hr> diff --git a/views/partials/post_nav.html b/views/partials/post_nav.html index eab52d1..d999c35 100644 --- a/views/partials/post_nav.html +++ b/views/partials/post_nav.html @@ -1,7 +1,7 @@ -<!-- TODO: showArchive function needs to be fixed - \{\{ if showArchive }} - <li>[<a href="/{{ .Board.Name }}/archive">Archive</a>]</li> - \{\{ end }} - --> -<li>[<a href="#top" id="bottom">Top</a>]</li> +{{ if ne .ReturnTo "catalog" }} +<li>[<a href="/{{ .Board.Name }}/catalog">Catalog</a>]</li> +{{ end }} +{{ if and (ne .ReturnTo "archive") (showArchive .Board.Actor) }} +<li>[<a href="/{{ .Board.Name }}/archive">Archive</a>]</li> +{{ end }} <li>[<a href="javascript:location.reload()">Refresh</a>]</li> diff --git a/views/partials/top.html b/views/partials/top.html index 6e3bc4b..dddb206 100644 --- a/views/partials/top.html +++ b/views/partials/top.html @@ -3,9 +3,9 @@ <p style="text-align: center;">{{ .Board.Summary }}</p> {{ $len := len .Posts }} {{ if eq $len 0 }} - {{ if .Board.InReplyTo }} + {{ if eq .PostType "reply" }} <h3 id="newpostbtn" state="0" style="display: none; margin-bottom:100px;">[<a href="javascript:startNewPost()">Post a Reply</a>]</h3> - {{ else }} + {{ else if eq .PostType "new" }} <h3 id="newpostbtn" state="0" style="display: none; margin-bottom:100px;">[<a href="javascript:startNewPost()">Start a New Thread</a>]</h3> {{ end }} <!-- end if inreplyto--> <div id="newpost"> |