diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/catalog.html | 39 | ||||
-rw-r--r-- | views/index.html | 6 | ||||
-rw-r--r-- | views/layouts/main.html | 26 | ||||
-rw-r--r-- | views/npost.html | 80 | ||||
-rw-r--r-- | views/nposts.html | 43 | ||||
-rw-r--r-- | views/partials/general_scripts.html | 1 | ||||
-rw-r--r-- | views/partials/post_nav.html | 7 | ||||
-rw-r--r-- | views/partials/post_scripts.html (renamed from views/partials/postscripts.html) | 1 | ||||
-rw-r--r-- | views/partials/top.html | 2 |
9 files changed, 82 insertions, 123 deletions
diff --git a/views/catalog.html b/views/catalog.html index c70471e..d4ec009 100644 --- a/views/catalog.html +++ b/views/catalog.html @@ -1,30 +1,11 @@ -{{ define "header" }} -<title>/{{ .page.Board.Name }}/ - catalog</title> -<meta name="description" content="{{ .page.Board.Summary }}"> -<meta property="og:url" content="{{ .page.Board.Actor.Id }}"> -<meta property="og:site_name" content="{{ .page.Instance.PreferredUsername }}" /> - -<meta property="og:title" content="{{ .page.Title }}"> -<meta property="og:description" content="{{ .page.Board.Summary }}"> - -<meta name="twitter:title" content="{{ .page.Title }}"> -<meta name="twitter:description" content="{{ .page.Board.Summary }}"> -<meta name="twitter:card" content="summary_large_image"> - -<script src="/static/js/posts.js"></script> -{{ end }} +{{ template "partials/top" .page }} {{ $board := .page.Board }} <hr> <ul id="navlinks"> - <li>[<a href="/{{ $board.Name }}/">Return</a>]</li> - <!-- TODO: Implement showArchive --> - <!-- \{\{ if showArchive }} --> - <!-- <li>[<a href="/{{ $board.Name }}/archive">Archive</a>]</li> --> - <!-- \{\{ end }} --> - <li>[<a href="#bottom">Bottom</a>]</li> - <li>[<a href="javascript:location.reload()">Refresh</a>]</li> + <li>[<a href="/{{ .page.Board.Name }}">Return</a>]</li> + {{ template "partials/post_nav" .page }} </ul> <hr> @@ -94,16 +75,16 @@ </div> {{ end }} </div> + <hr> <ul id="navlinks"> - <li>[<a href="/{{ $board.Name }}/">Return</a>]</li> - <!-- TODO: Implement showArchive --> - <!-- \{\{ if showArchive }} --> - <!-- <li>[<a href="/{{ $board.Name }}/archive">Archive</a>]</li> --> - <!-- \{\{ end }} --> - <li>[<a href="#top">Top</a>]</li> - <li>[<a href="javascript:location.reload()">Refresh</a>]</li> + <li>[<a href="/{{ .page.Board.Name }}">Return</a>]</li> + {{ template "partials/post_nav" .page }} </ul> <hr> + +{{ template "partials/footer" .page }} +{{ template "partials/general_scripts" .page }} +{{ template "partials/post_scripts" .page }} diff --git a/views/index.html b/views/index.html index e928ace..2bfed28 100644 --- a/views/index.html +++ b/views/index.html @@ -1,6 +1,3 @@ -{{ define "header" }} -<title>{{ .page.Title }}</title> -{{ end }} <div style="text-align: center; max-width: 800px; margin: 0 auto;"> <h1>{{ .page.Title }}</h1> <p style="text-align: justify">{{ .page.PreferredUsername }} is a federated image board based on <a href="https://activitypub.rocks/">ActivityPub</a>. The current version of the code running on the server is still a work-in-progress product, expect a bumpy ride for the time being. Get the server code here: <a href="https://github.com/FChannel0">https://github.com/FChannel0</a>.</p> @@ -54,3 +51,6 @@ </table> </div> </div> + +{{ template "partials/footer" .page }} +{{ template "partials/general_scripts" .page }} diff --git a/views/layouts/main.html b/views/layouts/main.html index 41e3412..74b86e4 100644 --- a/views/layouts/main.html +++ b/views/layouts/main.html @@ -1,12 +1,32 @@ <!DOCTYPE html> <html> <head> + <title>{{ .page.Title }}</title> <meta charset="UTF-8"> + <meta name='robots' content='noindex, nofollow'/> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="keywords" content="Federated Imageboard based on Activtypub"> + <meta name="description" content="{{ .page.Meta.Description }}"> + <meta property="og:url" content="{{ .page.Meta.Url }}"> + <meta property="og:site_name" content="{{ .page.Instance.PreferredUsername }}" /> + + <meta property="og:title" content="{{ .page.Meta.Title }}"> + <meta property="og:description" content="{{ .page.Meta.Description }}"> + <meta property="og:locale" content="en_US" /> <meta property="og:type" content="website" /> + + <meta name="twitter:title" content="{{ .page.Meta.Title }}"> + <meta name="twitter:description" content="{{ .page.Meta.Description }}"> + <meta name="twitter:card" content="summary_large_image"> + + {{ if not (eq .page.Meta.Preview "") }} + <meta property="og:image" content="{{ .page.Meta.Preview }}" /> + <meta name="twitter:image" content="{{ .page.Meta.Preview }}" /> + {{ end }} + <link rel="icon" type="image/png" href="/static/favicon.png"> + {{ if gt (len .page.ThemeCookie) 0 }} <link rel="stylesheet" type="text/css" href="/static/css/themes/{{.page.ThemeCookie}}.css" title="selected theme"> {{ else }} @@ -15,8 +35,6 @@ {{ range .page.Themes }} <link rel="alternate stylesheet" type="text/css" href="/static/css/themes/{{.}}.css" title="{{.}}" disabled> {{ end }} - - {{ template "header" .page }} </head> <body {{ if not .page.Board.Restricted }}class="nsfw"{{ end }} onload="applyTheme()"> <ul id="boardlinks"> @@ -41,9 +59,5 @@ {{ end }} {{ embed }} - - {{ template "partials/footer" .page }} - - <script src="/static/js/themes.js"></script> </body> </html> diff --git a/views/npost.html b/views/npost.html index 5a382ed..07de021 100644 --- a/views/npost.html +++ b/views/npost.html @@ -1,33 +1,13 @@ -{{ define "header" }} -<title>/{{ .Board.Name }}/ - {{ .PostId }}</title> -<meta name="description" content="{{ (index .Posts 0).Content }}"> -<meta property="og:url" content="{{ (index .Posts 0).Id }}"> -<meta property="og:site_name" content="{{ .Instance.PreferredUsername }}" /> - -<meta property="og:title" content="{{ (index .Posts 0).Name }}"> -<meta property="og:description" content="{{ (index .Posts 0).Content }}"> - -<meta name="twitter:title" content="{{ (index .Posts 0).Name }}"> -<meta name="twitter:description" content="{{ (index .Posts 0).Content }}"> -<meta name="twitter:card" content="summary_large_image"> - -{{ if (index .Posts 0).Preview }} -<meta property="og:image" content="{{ (index .Posts 0).Preview.Href }}" /> -<meta name="twitter:image" content="{{ (index .Posts 0).Preview.Href }}" /> -{{ end }} -{{ end }} - {{ template "partials/top" .page }} -{{ $board := .Board }} - <hr> + <ul id="navlinks"> - <li>[<a href="/{{ $board.Name }}">Return</a>]</li> - <li>[<a href="/{{ $board.Name }}/catalog">Catalog</a>]</li> - <li>[<a href="#bottom">Bottom</a>]</li> - <li>[<a href="javascript:location.reload()">Refresh</a>]</li> + <li>[<a href="/{{ .page.Board.Name }}">Return</a>]</li> + <li>[<a href="/{{ .page.Board.Name }}/catalog">Catalog</a>]</li> + {{ template "partials/post_nav" .page }} </ul> + <hr> {{ template "partials/posts" .page }} @@ -35,32 +15,34 @@ <hr> <table id="threadfooter"><tr> - <td> - <ul id="navlinks"> - <li>[<a href="/{{ $board.Name }}">Return</a>]</li> - <li>[<a href="/{{ $board.Name }}/catalog">Catalog</a>]</li> - <li>[<a id="bottom" href="#top">Top</a>]</li> - <li>[<a href="javascript:location.reload()">Refresh</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> - - {{ if eq (index .page.Posts 0).Type "Note" }} - <td style="text-align: center;"> - <span>[<a id="reply-content" href="javascript:quote('{{ $board.Actor.Id }}', '{{ (index .page.Posts 0).Id }}', 'reply')">Post a Reply</a>]</span> - </td> - {{ end }} - - <td> - {{ $replies := (index .page.Posts 0).Replies }} - <span id="threadStats" data-total="{{ $replies.TotalItems }}" data-imgs="{{ $replies.TotalImgs }}">{{ $replies.TotalItems }} / {{ $replies.TotalImgs }}</span> - </td> -</tr></table> + <tr> + <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><input id="autoreload-checkbox" type="checkbox" onclick="autoTimer()"> Auto refresh <span id="autoreload-countdown" style="visibility: hidden;">0</span></li> + </ul> + </td> + + {{ if eq (index .page.Posts 0).Type "Note" }} + <td style="text-align: center;"> + <span>[<a id="reply-content" href="javascript:quote('{{ .page.Board.Actor.Id }}', '{{ (index .page.Posts 0).Id }}', 'reply')">Post a Reply</a>]</span> + </td> + {{ end }} + + <td> + {{ $replies := (index .page.Posts 0).Replies }} + <span id="threadStats" data-total="{{ $replies.TotalItems }}" data-imgs="{{ $replies.TotalImgs }}">{{ $replies.TotalItems }} / {{ $replies.TotalImgs }}</span> + </td> + </tr> +</table> <hr> {{ template "partials/bottom" .page }} +{{ template "partials/footer" .page }} +{{ template "partials/general_scripts" .page }} +{{ template "partials/post_scripts" .page }} -{{ define "scripts" }} -{{ template "partials/postscripts" . }} -{{ end }} +<script src="/static/js/timer.js"></script> diff --git a/views/nposts.html b/views/nposts.html index ae5a9b6..567b945 100644 --- a/views/nposts.html +++ b/views/nposts.html @@ -1,45 +1,21 @@ -{{ define "header" }} -<title>{{ .Title }}</title> -<meta name="description" content="{{ .Board.Summary }}"> -<meta property="og:url" content="{{ .Board.Actor.Id }}"> -<meta property="og:site_name" content="{{ .Instance.PreferredUsername }}" /> - -<meta property="og:title" content="{{ .Title }}"> -<meta property="og:description" content="{{ .Board.Summary }}"> - -<meta name="twitter:title" content="{{ .Title }}"> -<meta name="twitter:description" content="{{ .Board.Summary }}"> -<meta name="twitter:card" content="summary_large_image"> -{{ end }} - {{ template "partials/top" .page }} {{ $board := .page.Board }} <hr> + <ul id="navlinks"> - <li>[<a href="/{{ $board.Name }}/catalog">Catalog</a>]</li> - <!-- TODO: showArchive function needs to be fixed - \{\{ if showArchive }} - <li>[<a href="/{{ $board.Name }}/archive">Archive</a>]</li> - \{\{ end }} - --> - <li>[<a href="#bottom">Bottom</a>]</li> - <li>[<a href="javascript:location.reload()">Refresh</a>]</li> + <li>[<a href="/{{ .page.Board.Name }}/catalog">Catalog</a>]</li> + {{ template "partials/post_nav" .page }} </ul> {{ template "partials/posts" .page }} <hr> + <ul id="navlinks"> - <li>[<a href="/{{ $board.Name }}/catalog">Catalog</a>]</li> - <!-- 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> - <li>[<a href="javascript:location.reload()">Refresh</a>]</li> + <li>[<a href="/{{ .page.Board.Name }}/catalog">Catalog</a>]</li> + {{ template "partials/post_nav" .page }} </ul> <hr> @@ -64,7 +40,6 @@ {{ end }} {{ template "partials/bottom" .page }} - -{{ define "scripts" }} -{{ template "partials/postscripts" . }} -{{ end }} +{{ template "partials/footer" .page }} +{{ template "partials/general_scripts" .page }} +{{ template "partials/post_scripts" .page }} diff --git a/views/partials/general_scripts.html b/views/partials/general_scripts.html new file mode 100644 index 0000000..d59309e --- /dev/null +++ b/views/partials/general_scripts.html @@ -0,0 +1 @@ +<script src="/static/js/themes.js"></script> diff --git a/views/partials/post_nav.html b/views/partials/post_nav.html new file mode 100644 index 0000000..eab52d1 --- /dev/null +++ b/views/partials/post_nav.html @@ -0,0 +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> +<li>[<a href="javascript:location.reload()">Refresh</a>]</li> diff --git a/views/partials/postscripts.html b/views/partials/post_scripts.html index f26e354..f23255c 100644 --- a/views/partials/postscripts.html +++ b/views/partials/post_scripts.html @@ -1,3 +1,2 @@ <script src="/static/js/posts.js"></script> <script src="/static/js/footerscript.js"></script> -<script src="/static/js/timer.js"></script> diff --git a/views/partials/top.html b/views/partials/top.html index 7c03c36..032e86b 100644 --- a/views/partials/top.html +++ b/views/partials/top.html @@ -1,4 +1,4 @@ -<div style="margin: 0 auto; width: 700px;"> +<div style="max-width: 800px; margin: 0 auto;"> <h1 style="text-align: center;">/{{ .Board.Name }}/ - {{ .Board.PrefName }}</h1> <p style="text-align: center;">{{ .Board.Summary }}</p> {{ $len := len .Posts }} |