added admin control panel for making posts, with basic authentication
This commit is contained in:
10
templates/admin_success_redirect.tmpl
Normal file
10
templates/admin_success_redirect.tmpl
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ template "header.tmpl" . }}
|
||||
{{ if .Success }}
|
||||
<h2>Login was <u>successful</u>!</h2>
|
||||
<p>Click <a href="/admin/post">here</a> to go to the post creation area.</p>
|
||||
{{ else }}
|
||||
<h2>Login was <u>not</u> successful!</h2>
|
||||
<p>Click <a href="/admin/">here</a> to return to the login page to try again.</p>
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<form action="/admin/post" method="POST">
|
||||
<input type="text" placeholder="url" name="url" />
|
||||
<input type="text" placeholder="title" name="title" />
|
||||
<textarea placeholder="post" name="content" />
|
||||
<textarea placeholder="post" name="content"></textarea>
|
||||
<button type="submit">Make post</button>
|
||||
<button type="clear">Clear form</button>
|
||||
</form>
|
||||
|
||||
5
templates/forbidden.tmpl
Normal file
5
templates/forbidden.tmpl
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ template "header.tmpl" . }}
|
||||
<h2>403 You're not allowed here >:(</h2>
|
||||
<p>Click <a href="/">here</a> to return home.</p>
|
||||
</body>
|
||||
</html>
|
||||
11
templates/post_success.tmpl
Normal file
11
templates/post_success.tmpl
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ template "header.tmpl" . }}
|
||||
{{ if .Success }}
|
||||
<h2>Post created successfully!</h2>
|
||||
<p>Click <a href="/blog/post/{{ .Url }}">here</a> to view the post.</p>
|
||||
<p>Click <a href="/admin/post">here</a> to return to the posting page.</p>
|
||||
{{ else }}
|
||||
<h2>Post failed to be created...</h2>
|
||||
<p>Click <a href="/admin/post">here</a> to return to the posting page.</p>
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user