From a87235f8b978126c0ca9f9eb252f58e6de17622c Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sat, 4 Jun 2022 23:31:12 -0700 Subject: news CRUD working --- views/admin.html | 2 +- views/anews.html | 15 +++++++++++++++ views/index.html | 3 ++- views/news.html | 7 +++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 views/anews.html create mode 100644 views/news.html (limited to 'views') diff --git a/views/admin.html b/views/admin.html index 191444b..8c784b5 100644 --- a/views/admin.html +++ b/views/admin.html @@ -47,7 +47,7 @@

Create News

-
+


diff --git a/views/anews.html b/views/anews.html new file mode 100644 index 0000000..69378d4 --- /dev/null +++ b/views/anews.html @@ -0,0 +1,15 @@ +
+

{{ .page.Title }}

+ +
+ {{ $page := .page }} + {{ range $i, $e := .page.NewsItems }} +
+

{{unixtoreadable $e.Time}} - {{$e.Title}}{{ if $page.Board.ModCred }} [Delete] {{end}}

+
+ +

{{$e.Content}}

+
+ {{ end }} +
+
diff --git a/views/index.html b/views/index.html index 2bfed28..00ebfb9 100644 --- a/views/index.html +++ b/views/index.html @@ -28,9 +28,10 @@ {{ if .page.NewsItems }}

{{ .page.PreferredUsername }} News

+ {{ $page := .page }} {{ range $i, $e := .page.NewsItems }}
-

{{unixtoreadable $e.Time}} - {{$e.Title}}{{ if $.Board.ModCred }} [Delete] {{end}}

+

{{unixtoreadable $e.Time}} - {{$e.Title}}{{ if $page.Board.ModCred }} [Delete] {{end}}


{{$e.Content}}

diff --git a/views/news.html b/views/news.html new file mode 100644 index 0000000..87c40d2 --- /dev/null +++ b/views/news.html @@ -0,0 +1,7 @@ +
+ {{ range .page.NewsItems }} +
+

{{unixtoreadable .Time}} - {{.Title}}


{{.Content}}

+
+ {{ end }} +
-- cgit v1.2.3