aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorFChannel <>2022-06-04 23:31:12 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commita87235f8b978126c0ca9f9eb252f58e6de17622c (patch)
tree592002dda3ac9f4ca1514eb0f473d31fb62faa84 /views
parente3c83c1ddaea5f42b6fda66d4b86459fd1349b3b (diff)
news CRUD working
Diffstat (limited to 'views')
-rw-r--r--views/admin.html2
-rw-r--r--views/anews.html15
-rw-r--r--views/index.html3
-rw-r--r--views/news.html7
4 files changed, 25 insertions, 2 deletions
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 @@
<div class="box2" style="margin-bottom: 25px; padding: 12px;">
<h3>Create News</h3>
- <form id="news" action="/{{ .page.Key }}/postnews" method="post" enctype="application/x-www-form-urlencoded">
+ <form id="news" action="/{{ .page.Key }}/newspost" method="post" enctype="application/x-www-form-urlencoded">
<label>Title:</label><br>
<input type="text" name="title" placeholder="New Board" required><input type="submit" value="Post"><br>
<label>Content:</label><br>
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 @@
+<div style="text-align: center; max-width: 800px; margin: 0 auto;">
+ <h1>{{ .page.Title }}</h1>
+
+ <div class="newsbox" style="margin-top:50px;padding-top:0;">
+ {{ $page := .page }}
+ {{ range $i, $e := .page.NewsItems }}
+ <div class="newsbox-news">
+ <h3><a href="/news/{{.Time}}">{{unixtoreadable $e.Time}} - {{$e.Title}}</a>{{ if $page.Board.ModCred }} <a href="/{{ $page.Key }}/newsdelete/{{ $e.Time }}">[Delete] </a>{{end}}</h3>
+ <br>
+
+ <p>{{$e.Content}}</p>
+ </div>
+ {{ end }}
+ </div>
+</div>
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 }}
<div class="newsbox" style="margin-top:50px;">
<h2><a href="/news">{{ .page.PreferredUsername }} News</a></h2>
+ {{ $page := .page }}
{{ range $i, $e := .page.NewsItems }}
<div class="newsbox-news">
- <h3><a href="/news/{{.Time}}">{{unixtoreadable $e.Time}} - {{$e.Title}}</a>{{ if $.Board.ModCred }} <a href="/{{ $.Key }}/newsdelete/{{ $e.Time }}">[Delete] </a>{{end}}</h3>
+ <h3><a href="/news/{{.Time}}">{{unixtoreadable $e.Time}} - {{$e.Title}}</a>{{ if $page.Board.ModCred }} <a href="/{{ $page.Key }}/newsdelete/{{ $e.Time }}">[Delete] </a>{{end}}</h3>
<br>
<p>{{$e.Content}}</p>
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 @@
+<div class="newsbox" style="text-align: left; max-width: 800px; margin: 0 auto;margin-top: 50px;padding-top:0;">
+ {{ range .page.NewsItems }}
+ <div class="newsbox-news">
+ <p><h1>{{unixtoreadable .Time}} - {{.Title}}</h1><br>{{.Content}}</p>
+ </div>
+ {{ end }}
+</div>