summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/dscuss-web/controller/handle_ban_user.go2
-rw-r--r--cmd/dscuss-web/controller/handle_remove_message.go2
-rw-r--r--cmd/dscuss-web/view/base.go2
-rw-r--r--cmd/dscuss-web/view/board.go54
-rw-r--r--cmd/dscuss-web/view/login.go56
-rw-r--r--cmd/dscuss-web/view/oper_ban.go69
-rw-r--r--cmd/dscuss-web/view/oper_del.go79
-rw-r--r--cmd/dscuss-web/view/oper_list.go39
-rw-r--r--cmd/dscuss-web/view/peer_history.go37
-rw-r--r--cmd/dscuss-web/view/peer_list.go53
-rw-r--r--cmd/dscuss-web/view/profile.go82
-rw-r--r--cmd/dscuss-web/view/thread.go78
-rw-r--r--cmd/dscuss-web/view/thread_create.go52
-rw-r--r--cmd/dscuss-web/view/thread_reply.go71
-rw-r--r--cmd/dscuss-web/view/user.go9
15 files changed, 338 insertions, 347 deletions
diff --git a/cmd/dscuss-web/controller/handle_ban_user.go b/cmd/dscuss-web/controller/handle_ban_user.go
index 82b4cc0..69def9e 100644
--- a/cmd/dscuss-web/controller/handle_ban_user.go
+++ b/cmd/dscuss-web/controller/handle_ban_user.go
@@ -88,7 +88,7 @@ func handleBanUser(w http.ResponseWriter, r *http.Request, l *dscuss.LoginHandle
}
render:
cd := readCommonData(r, s, l)
- cd.PageTitle = "Ban user #" + tg.ShortID
+ cd.PageTitle = "Banning user " + tg.Nickname + "-" + tg.ShortID
view.Render(w, "oper_ban.html", map[string]interface{}{
"Common": cd,
"Target": tg,
diff --git a/cmd/dscuss-web/controller/handle_remove_message.go b/cmd/dscuss-web/controller/handle_remove_message.go
index 13c9d6f..251d2ca 100644
--- a/cmd/dscuss-web/controller/handle_remove_message.go
+++ b/cmd/dscuss-web/controller/handle_remove_message.go
@@ -97,7 +97,7 @@ func handleRemoveMessage(w http.ResponseWriter, r *http.Request, l *dscuss.Login
}
render:
cd := readCommonData(r, s, l)
- cd.PageTitle = "Remove message #" + tg.ShortID
+ cd.PageTitle = "Removing message #" + tg.ShortID
cd.Topic = root.Topic.String()
view.Render(w, "oper_del.html", map[string]interface{}{
"Common": cd,
diff --git a/cmd/dscuss-web/view/base.go b/cmd/dscuss-web/view/base.go
index bde4e9f..8f52192 100644
--- a/cmd/dscuss-web/view/base.go
+++ b/cmd/dscuss-web/view/base.go
@@ -66,4 +66,4 @@ const baseHTML = `
</html>
`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/board.go b/cmd/dscuss-web/view/board.go
index 2ab957f..6c55e95 100644
--- a/cmd/dscuss-web/view/board.go
+++ b/cmd/dscuss-web/view/board.go
@@ -21,42 +21,42 @@ const boardHTML = `
{{ define "content" }}
{{ if .Common.IsWritingPermitted }}
-<div class="btn-row">
- <a class="link-btn" href="/thread/create{{ if $.Common.Topic }}?topic={{ $.Common.Topic }}{{ end }}">Start</a>
-</div>
+ <div class="btn-row">
+ <a class="link-btn" href="/thread/create{{ if $.Common.Topic }}?topic={{ $.Common.Topic }}{{ end }}">Start</a>
+ </div>
{{end}}
<h1> Dscussions in
-{{ if .Common.Topic }}
-topic {{ .Common.Topic }}
-{{ else }}
-all topics
-{{ end }}
+ {{ if .Common.Topic }}
+ topic {{ .Common.Topic }}
+ {{ else }}
+ all topics
+ {{ end }}
</h1>
{{ if .Threads }}
-{{ range .Threads }}
-<hr class="sep">
-<div class="thread-row" id="thread-{{ .ID }}">
- <div>
- <a href="/thread?id={{ .ID }}">{{ .Subject }}</a>
- {{ if not $.Common.Topic }}
- <span class="topic">in <a class="topic" href="/board?topic={{ .Topic }}">{{ .Topic }}</a></span>
- {{ end }}
- </div>
- <div class="message-text">{{ .Text }}</div>
- <div class="dimmed underline">
- by {{ .AuthorName }}-{{ .AuthorShortID }} {{ .DateWritten }}
- </div>
-</div>
-{{ end }}
+ {{ range .Threads }}
+ <hr class="sep">
+ <div class="thread-row" id="thread-{{ .ID }}">
+ <div>
+ <a href="/thread?id={{ .ID }}">{{ .Subject }}</a>
+ {{ if not $.Common.Topic }}
+ <span class="topic">in <a class="topic" href="/board?topic={{ .Topic }}">{{ .Topic }}</a></span>
+ {{ end }}
+ </div>
+ <div class="message-text">{{ .Text }}</div>
+ <div class="dimmed underline">
+ by {{ .AuthorName }}-{{ .AuthorShortID }} {{ .DateWritten }}
+ </div>
+ </div>
+ {{ end }}
{{ else }}
-<div class="row">
- <div class="dimmed">No threads to show.</div>
-</div>
+ <div class="row">
+ <div class="dimmed">No threads to show.</div>
+ </div>
{{ end }}
{{ end }}
`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/login.go b/cmd/dscuss-web/view/login.go
index e9b9811..16ac197 100644
--- a/cmd/dscuss-web/view/login.go
+++ b/cmd/dscuss-web/view/login.go
@@ -20,36 +20,36 @@ package view
const loginHTML = `
{{ define "content" }}
-<h2 class="title">Owner authentication</h2>
+<h1 id="title">{{ .Common.PageTitle }}</h1>
<form action="/login" method="POST">
-<input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
-<input type="hidden" name="next" value="{{ .next }}">
-<table class="form">
- <tr>
- <th>Username:</th>
- <td><input type="text" name="username" required></td>
- </tr>
- <tr>
- <th>Password:</th>
- <td><input type="password" name="password" required></td>
- </tr>
- <tr>
- <th></th>
- <td>How to setup your own Dscuss node: <a href="/help?=setup">Help</a></td>
- </tr>
-{{ if .Message }}
- <tr>
- <th></th>
- <td><span class="alert">{{ .Message }}</span></td>
- </tr>
-{{ end }}
- <tr>
- <th></th>
- <td><input type="submit" value="Login"></td>
- </tr>
-</table>
+ <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
+ <input type="hidden" name="next" value="{{ .next }}">
+ <table class="form">
+ <tr>
+ <th>Username:</th>
+ <td><input type="text" name="username" required></td>
+ </tr>
+ <tr>
+ <th>Password:</th>
+ <td><input type="password" name="password" required></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td>How to setup your own Dscuss node: <a href="/help?=setup">Help</a></td>
+ </tr>
+ {{ if .Message }}
+ <tr>
+ <th></th>
+ <td><span class="alert">{{ .Message }}</span></td>
+ </tr>
+ {{ end }}
+ <tr>
+ <th></th>
+ <td><input type="submit" value="Login"></td>
+ </tr>
+ </table>
</form>
{{ end }}`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/oper_ban.go b/cmd/dscuss-web/view/oper_ban.go
index c6f125d..3e5265e 100644
--- a/cmd/dscuss-web/view/oper_ban.go
+++ b/cmd/dscuss-web/view/oper_ban.go
@@ -20,43 +20,42 @@ package view
const operBanHTML = `
{{ define "content" }}
-<h2 class="title">Banning user {{ .Target.Nickname }}-{{ .Target.ShortID }}</h2>
+<h1 id="title">{{ .Common.PageTitle }}</h1>
<form action="/ban" method="POST" enctype="multipart/form-data">
-<input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
-<input type="hidden" name="id" value="{{ .Target.ID }}">
-<table class="form">
- <tr><th>Full ID</th><td>{{ .Target.ID }}</td></tr>
- <tr><th>Nickname</th><td>{{ .Target.Nickname }}</td></tr>
- <tr><th>Additional info</th><td>{{ .Target.Info }}</td></tr>
- <tr><th>Registration date</th><td>{{ .Target.RegDate }}</td></tr>
- <tr>
- <th>Reason:</th>
- <td>
- <select name="reason" >
- <option value="SPAM">SPAM</option>
- <option value="Offtopic">Off-topic</option>
- <option value="Abuse">Abuse</option>
- <option value="Duplicate">Duplicate</option>
- </select>
- </td>
- </tr>
- <tr>
- <th>Comment:</th>
- <td><textarea name="comment" rows="4" placeholder="Why do you want to do that?">{{ .Reply.Text }}</textarea></td>
- </tr>
- <tr>
- <th></th>
- <td>
- {{ if .Message }}
- <span class="alert">{{ .Message }}</span><br>
- {{ end }}
- <input type="submit" name="action" class="no-double-post" value="Submit reply">
- </td>
- </tr>
-
-</table>
+ <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
+ <input type="hidden" name="id" value="{{ .Target.ID }}">
+ <table class="form">
+ <tr><th>Full ID</th><td>{{ .Target.ID }}</td></tr>
+ <tr><th>Nickname</th><td>{{ .Target.Nickname }}</td></tr>
+ <tr><th>Additional info</th><td>{{ .Target.Info }}</td></tr>
+ <tr><th>Registration date</th><td>{{ .Target.RegDate }}</td></tr>
+ <tr>
+ <th>Reason:</th>
+ <td>
+ <select name="reason" >
+ <option value="SPAM">SPAM</option>
+ <option value="Offtopic">Off-topic</option>
+ <option value="Abuse">Abuse</option>
+ <option value="Duplicate">Duplicate</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>Comment:</th>
+ <td><textarea name="comment" rows="4" placeholder="Why do you want to do that?">{{ .Reply.Text }}</textarea></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td>
+ {{ if .Message }}
+ <span class="alert">{{ .Message }}</span><br>
+ {{ end }}
+ <input type="submit" name="action" class="no-double-post" value="Submit reply">
+ </td>
+ </tr>
+ </table>
</form>
{{ end }}`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/oper_del.go b/cmd/dscuss-web/view/oper_del.go
index 1b26e12..969a5ae 100644
--- a/cmd/dscuss-web/view/oper_del.go
+++ b/cmd/dscuss-web/view/oper_del.go
@@ -20,49 +20,48 @@ package view
const operDelHTML = `
{{ define "content" }}
-<h2 class="title">Removing message {{ .Target.ShortID }}</h2>
+<h1 id="title">{{ .Common.PageTitle }}</h1>
<form action="/oper/del" method="POST" enctype="multipart/form-data">
-<input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
-<input type="hidden" name="id" value="{{ .Target.ID }}">
-<table class="form">
- <tr>
- <td colspan="2">
- <b>{{ .Target.Subject }}</b>
- <div class="message-text">{{ .Target.Text }}</div>
- <div class="dimmed underline">
- by <a href="/user?id={{ .Target.AuthorID }}">{{ .Target.AuthorName }}-{{ .Target.AuthorShortID }}</a>
- {{ .Target.DateWritten }}
- </div>
- </td>
- </tr>
- <tr>
- <th>Reason:</th>
- <td>
- <select name="reason" >
- <option value="SPAM">SPAM</option>
- <option value="Offtopic">Off-topic</option>
- <option value="Abuse">Abuse</option>
- <option value="Duplicate">Duplicate</option>
- </select>
- </td>
- </tr>
- <tr>
- <th>Comment:</th>
- <td><textarea name="comment" rows="4" placeholder="Why do you want to do that?">{{ .Reply.Text }}</textarea></td>
- </tr>
- <tr>
- <th></th>
- <td>
- {{ if .Message }}
- <span class="alert">{{ .Message }}</span><br>
- {{ end }}
- <input type="submit" name="action" class="no-double-post" value="Submit reply">
- </td>
- </tr>
-
+ <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
+ <input type="hidden" name="id" value="{{ .Target.ID }}">
+ <table class="form">
+ <tr>
+ <td colspan="2">
+ <b>{{ .Target.Subject }}</b>
+ <div class="message-text">{{ .Target.Text }}</div>
+ <div class="dimmed underline">
+ by <a href="/user?id={{ .Target.AuthorID }}">{{ .Target.AuthorName }}-{{ .Target.AuthorShortID }}</a>
+ {{ .Target.DateWritten }}
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <th>Reason:</th>
+ <td>
+ <select name="reason" >
+ <option value="SPAM">SPAM</option>
+ <option value="Offtopic">Off-topic</option>
+ <option value="Abuse">Abuse</option>
+ <option value="Duplicate">Duplicate</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>Comment:</th>
+ <td><textarea name="comment" rows="4" placeholder="Why do you want to do that?">{{ .Reply.Text }}</textarea></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td>
+ {{ if .Message }}
+ <span class="alert">{{ .Message }}</span><br>
+ {{ end }}
+ <input type="submit" name="action" class="no-double-post" value="Submit reply">
+ </td>
+ </tr>
</table>
</form>
{{ end }}`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/oper_list.go b/cmd/dscuss-web/view/oper_list.go
index 393558c..3469b6a 100644
--- a/cmd/dscuss-web/view/oper_list.go
+++ b/cmd/dscuss-web/view/oper_list.go
@@ -20,32 +20,31 @@ package view
const operListHTML = `
{{ define "content" }}
-<h1>{{ .Common.PageTitle }}</h1>
-
+<h1 id="title">{{ .Common.PageTitle }}</h1>
{{ if .Operations }}
-{{ range .Operations }}
-<hr class="sep">
-<div class="operation-row" id="operation-{{ .ID }}">
- <div>
- <b>Operation {{ .Type }}</b><br>
- Reason: {{ .Reason }}<br>
- </div>
- {{ if .Comment }}
- <div class="comment">{{ .Comment }}</div>
- {{ end }}
- <div class="dimmed underline">
- by <a href="/user?id={{ .AuthorID }}">{{ .AuthorName }}-{{ .AuthorShortID }}</a>
- {{ .DatePerformed }}
+ {{ range .Operations }}
+ <hr class="sep">
+ <div class="operation-row" id="operation-{{ .ID }}">
+ <div>
+ <b>Operation {{ .Type }}</b><br>
+ Reason: {{ .Reason }}<br>
+ </div>
+ {{ if .Comment }}
+ <div class="comment">{{ .Comment }}</div>
+ {{ end }}
+ <div class="dimmed underline">
+ by <a href="/user?id={{ .AuthorID }}">{{ .AuthorName }}-{{ .AuthorShortID }}</a>
+ {{ .DatePerformed }}
+ </div>
</div>
-</div>
{{ end }}
{{ else }}
-<div class="row">
- <div class="dimmed">No operations to show.</div>
-</div>
+ <div class="row">
+ <div class="dimmed">No operations to show.</div>
+ </div>
{{ end }}
{{ end }}
`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/peer_history.go b/cmd/dscuss-web/view/peer_history.go
index 10eefef..aac9b7e 100644
--- a/cmd/dscuss-web/view/peer_history.go
+++ b/cmd/dscuss-web/view/peer_history.go
@@ -20,29 +20,28 @@ package view
const peerHistoryHTML = `
{{ define "content" }}
-<h1>{{ .Common.PageTitle }}</h1>
-
+<h1 id="title">{{ .Common.PageTitle }}</h1>
{{ if .History }}
-{{ range .History }}
-<hr class="sep">
-<div class="history-row" id="peer-{{ .ID }}">
-<table class="form">
- <tr><th>ID</th><td>{{ .ID }}</td></tr>
- <tr><th>Disconnected</th><td>{{ .Disconnected }}</td></tr>
- <tr>
- <th>Subscriptions</th>
- <td><div class="subs">{{ .Subscriptions }}</div></td>
- </tr>
-</table>
-</div>
-{{ end }}
+ {{ range .History }}
+ <hr class="sep">
+ <div class="history-row" id="peer-{{ .ID }}">
+ <table class="form">
+ <tr><th>ID</th><td>{{ .ID }}</td></tr>
+ <tr><th>Disconnected</th><td>{{ .Disconnected }}</td></tr>
+ <tr>
+ <th>Subscriptions</th>
+ <td><div class="subs">{{ .Subscriptions }}</div></td>
+ </tr>
+ </table>
+ </div>
+ {{ end }}
{{ else }}
-<div class="row">
- <div class="dimmed">There are no history records.</div>
-</div>
+ <div class="row">
+ <div class="dimmed">There are no history records.</div>
+ </div>
{{ end }}
{{ end }}
`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/peer_list.go b/cmd/dscuss-web/view/peer_list.go
index 8406c73..2027e62 100644
--- a/cmd/dscuss-web/view/peer_list.go
+++ b/cmd/dscuss-web/view/peer_list.go
@@ -20,36 +20,35 @@ package view
const peerListHTML = `
{{ define "content" }}
-<h1>{{ .Common.PageTitle }}</h1>
-
+<h1 id="title">{{ .Common.PageTitle }}</h1>
{{ if .Peers }}
-{{ range .Peers }}
-<hr class="sep">
-<div class="peer-row" id="peer-{{ .ID }}">
-<table class="form">
- <tr><th>Nickname</th><td>{{ .Nickname }}</td></tr>
- <tr><th>ID</th><td>{{ .ID }}</td></tr>
- <tr><th>State</th><td>{{ .State }}</td></tr>
- <tr><th>Local address</th><td>{{ .LocalAddr }}</td></tr>
- <tr><th>Remove address</th><td>{{ .RemoteAddr }}</td></tr>
- <tr><th>Associated addresses</th><td>{{ .AssociatedAddrs }}</td></tr>
- <tr>
- <th>Subscriptions</th>
- <td><div class="subs">{{ .Subscriptions }}</div></td>
- </tr>
-</table>
-</div>
-{{ end }}
+ {{ range .Peers }}
+ <hr class="sep">
+ <div class="peer-row" id="peer-{{ .ID }}">
+ <table class="form">
+ <tr><th>Nickname</th><td>{{ .Nickname }}</td></tr>
+ <tr><th>ID</th><td>{{ .ID }}</td></tr>
+ <tr><th>State</th><td>{{ .State }}</td></tr>
+ <tr><th>Local address</th><td>{{ .LocalAddr }}</td></tr>
+ <tr><th>Remove address</th><td>{{ .RemoteAddr }}</td></tr>
+ <tr><th>Associated addresses</th><td>{{ .AssociatedAddrs }}</td></tr>
+ <tr>
+ <th>Subscriptions</th>
+ <td><div class="subs">{{ .Subscriptions }}</div></td>
+ </tr>
+ </table>
+ </div>
+ {{ end }}
{{ else }}
-<div class="row">
- <div class="dimmed">There are no peers connected.</div>
-</div>
+ <div class="row">
+ <div class="dimmed">There are no peers connected.</div>
+ </div>
{{ end }}
-<div>
- <hr class="sep">
- <a href="/peer/history">Show peer history</a>.
-</div>
+ <div>
+ <hr class="sep">
+ <a href="/peer/history">Show peer history</a>.
+ </div>
{{ end }}
`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/profile.go b/cmd/dscuss-web/view/profile.go
index f2d60ea..91d677e 100644
--- a/cmd/dscuss-web/view/profile.go
+++ b/cmd/dscuss-web/view/profile.go
@@ -20,7 +20,7 @@ package view
const profileHTML = `
{{ define "content" }}
-<h2 class="title">Node owner's profile</h1>
+<h1 id="title">{{ .Common.PageTitle }}</h1>
<div class="profile-block">
<table class="form">
<tr><th>Full ID</th><td>{{ .Common.Owner.ID }}</td></tr>
@@ -33,54 +33,48 @@ const profileHTML = `
<hr class="sep">
<span class="subtitle">Subscriptions</span>
<form action="/sub/add" method="POST" enctype="multipart/form-data">
- <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
- <table>
- <tr>
- <th>Topic</th>
- <th>Action</th>
- </tr>
- {{ range .Subscriptions }}
- <tr>
- <td>{{ . }}</td>
- <td><a href="/sub/del?topic={{ . }}">Remove</a></td>
- </tr>
- {{ end }}
- <tr>
- <th>
- <input type="text" name="topic" placeholder="Enter new topic...">
- </th>
- <th>
- <input type="submit" name="action" class="no-double-post" value="Subscribe">
- </th>
- </tr>
- </table>
+ <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
+ <table>
+ <tr><th>Topic</th><th>Action</th></tr>
+ {{ range .Subscriptions }}
+ <tr>
+ <td>{{ . }}</td>
+ <td><a href="/sub/del?topic={{ . }}">Remove</a></td>
+ </tr>
+ {{ end }}
+ <tr>
+ <th>
+ <input type="text" name="topic" placeholder="Enter new topic...">
+ </th>
+ <th>
+ <input type="submit" name="action" class="no-double-post" value="Subscribe">
+ </th>
+ </tr>
+ </table>
</form>
</div>
<div class="profile-block">
<hr class="sep">
<span class="subtitle">Moderators</span>
<form action="/moder/add" method="POST" enctype="multipart/form-data">
- <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
- <table>
- <tr>
- <th>User</th>
- <th>Action</th>
- </tr>
- {{ range .Moderators }}
- <tr>
- <td><a href="/user?id={{ .ID }}">{{ .Nickname }}-{{ .ShortID }}</a></td>
- <td><a href="/moder/del?id={{ .ID }}">Remove</a></td>
- </tr>
- {{ end }}
- <tr>
- <td>
- <input type="text" name="id" placeholder="Enter new full ID...">
- </td>
- <td>
- <input type="submit" name="action" class="no-double-post" value="Add">
- </td>
- </tr>
- </table>
+ <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
+ <table>
+ <tr><th>User</th><th>Action</th></tr>
+ {{ range .Moderators }}
+ <tr>
+ <td><a href="/user?id={{ .ID }}">{{ .Nickname }}-{{ .ShortID }}</a></td>
+ <td><a href="/moder/del?id={{ .ID }}">Remove</a></td>
+ </tr>
+ {{ end }}
+ <tr>
+ <td>
+ <input type="text" name="id" placeholder="Enter new full ID...">
+ </td>
+ <td>
+ <input type="submit" name="action" class="no-double-post" value="Add">
+ </td>
+ </tr>
+ </table>
</form>
</div>
{{ if .Message }}
@@ -88,4 +82,4 @@ const profileHTML = `
{{ end }}
{{ end }}`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/thread.go b/cmd/dscuss-web/view/thread.go
index 2dd502a..98dab79 100644
--- a/cmd/dscuss-web/view/thread.go
+++ b/cmd/dscuss-web/view/thread.go
@@ -21,56 +21,56 @@ const threadHTML = `
{{ define "content" }}
{{ if .Common.IsWritingPermitted }}
-<div class="btn-row">
- <a class="link-btn" href="/thread/reply?id={{ .ID }}">Reply</a>
-</div>
+ <div class="btn-row">
+ <a class="link-btn" href="/thread/reply?id={{ .ID }}">Reply</a>
+ </div>
{{end}}
{{ if .IsFound }}
-<h2 class="title"><a href="/thread?id={{ .ID }}">{{ .Subject }}</a></h2>
-<div class="message-row">
- <div class="message-text">{{ .Text }}</div>
- <div class="dimmed underline">
- by <a href="/user?id={{ .AuthorID }}">{{ .AuthorName }}-{{ .AuthorShortID }}</a> {{ .DateWritten }}
- {{ if .Common.IsWritingPermitted }}
- | <a href="/thread/reply?id={{ .ID }}">reply</a>
- | <a href="/oper/ban?id={{ .AuthorID }}">ban</a>
- | <a href="/oper/del?id={{ .ID }}">delete</a>
- | <a href="/oper/list?type=msg&id={{ .ID }}">operations</a>
- {{ end }}
+ <h1 id="title"><a href="/thread?id={{ .ID }}">{{ .Subject }}</a></h1>
+ <div class="message-row">
+ <div class="message-text">{{ .Text }}</div>
+ <div class="dimmed underline">
+ by <a href="/user?id={{ .AuthorID }}">{{ .AuthorName }}-{{ .AuthorShortID }}</a> {{ .DateWritten }}
+ {{ if .Common.IsWritingPermitted }}
+ | <a href="/thread/reply?id={{ .ID }}">reply</a>
+ | <a href="/oper/ban?id={{ .AuthorID }}">ban</a>
+ | <a href="/oper/del?id={{ .ID }}">delete</a>
+ | <a href="/oper/list?type=msg&id={{ .ID }}">operations</a>
+ {{ end }}
+ </div>
</div>
-</div>
{{ else }}
-<div class="row">
+ <div class="row">
<div class="alert">Requested thread was not found.</div>
- <a href="/oper/list?id={{ .ID }}">View operations</a> on this thread.
-</div>
+ <a href="/oper/list?id={{ .ID }}">View operations</a> on this thread.
+ </div>
{{ end }}
{{ if .Replies }}
-{{ range .Replies }}
-<hr class="sep">
-<div class="message-row" id="message-{{ .ID }}">
- <b>{{ .Subject }}</b>
- <div class="message-text">{{ .Text }}</div>
- <div class="dimmed underline">
- by <a href="/user?id={{ .AuthorID }}">{{ .AuthorName }}-{{ .AuthorShortID }}</a>
- {{ .DateWritten }}
- {{ if $.Common.IsWritingPermitted }}
- | <a href="/thread/reply?id={{ .ID }}">reply</a>
- | <a href="/oper/ban?id={{ .AuthorID }}">ban</a>
- | <a href="/oper/del?id={{ .ID }}">delete</a>
- | <a href="/oper/list?type=msg&id={{ .ID }}">operations</a>
- {{ end }}
- </div>
-</div>
-{{ end }}
+ {{ range .Replies }}
+ <hr class="sep">
+ <div class="message-row" id="message-{{ .ID }}">
+ <b>{{ .Subject }}</b>
+ <div class="message-text">{{ .Text }}</div>
+ <div class="dimmed underline">
+ by <a href="/user?id={{ .AuthorID }}">{{ .AuthorName }}-{{ .AuthorShortID }}</a>
+ {{ .DateWritten }}
+ {{ if $.Common.IsWritingPermitted }}
+ | <a href="/thread/reply?id={{ .ID }}">reply</a>
+ | <a href="/oper/ban?id={{ .AuthorID }}">ban</a>
+ | <a href="/oper/del?id={{ .ID }}">delete</a>
+ | <a href="/oper/list?type=msg&id={{ .ID }}">operations</a>
+ {{ end }}
+ </div>
+ </div>
+ {{ end }}
{{ else }}
-<div class="row">
- <div class="dimmed">No replies to show.</div>
-</div>
+ <div class="row">
+ <div class="dimmed">No replies to show.</div>
+ </div>
{{ end }}
{{ end }}`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/thread_create.go b/cmd/dscuss-web/view/thread_create.go
index 36ffd5b..c22cccd 100644
--- a/cmd/dscuss-web/view/thread_create.go
+++ b/cmd/dscuss-web/view/thread_create.go
@@ -20,34 +20,34 @@ package view
const threadCreateHTML = `
{{ define "content" }}
-<h2 class="title">Start new dscussion</h2>
+<h1 id="title">{{ .Common.PageTitle }}</h1>
<form action="/thread/create" method="POST" enctype="multipart/form-data">
-<input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
-<table class="form">
- <tr>
- <th>Topic:</th>
- <td><input type="text" name="topic" value="{{ .Common.Topic }}"></td>
- </tr>
- <tr>
- <th>Subject:</th>
- <td><input type="text" name="subject" value="{{ .Subject }}"></td>
- </tr>
- <tr>
- <th>Text:</th>
- <td><textarea name="text" rows="12">{{ .Text }}</textarea></td>
- </tr>
- <tr>
- <th></th>
- <td>
- {{ if .Message }}
- <span class="alert">{{ .Message }}</span><br>
- {{ end }}
- <input type="submit" name="action" class="no-double-post" value="Start dscussion">
- </td>
- </tr>
-</table>
+ <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
+ <table class="form">
+ <tr>
+ <th>Topic:</th>
+ <td><input type="text" name="topic" value="{{ .Common.Topic }}"></td>
+ </tr>
+ <tr>
+ <th>Subject:</th>
+ <td><input type="text" name="subject" value="{{ .Subject }}"></td>
+ </tr>
+ <tr>
+ <th>Text:</th>
+ <td><textarea name="text" rows="12">{{ .Text }}</textarea></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td>
+ {{ if .Message }}
+ <span class="alert">{{ .Message }}</span><br>
+ {{ end }}
+ <input type="submit" name="action" class="no-double-post" value="Start dscussion">
+ </td>
+ </tr>
+ </table>
</form>
{{ end }}`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/thread_reply.go b/cmd/dscuss-web/view/thread_reply.go
index 80d2ef0..495dd92 100644
--- a/cmd/dscuss-web/view/thread_reply.go
+++ b/cmd/dscuss-web/view/thread_reply.go
@@ -20,44 +20,43 @@ package view
const threadReplyHTML = `
{{ define "content" }}
-<h2 class="title">Reply in dscussion <a href="/thread?id={{ .Thread.ID }}">{{ .Thread.Subject }}</a></h2>
+<h1 id="title">Reply in dscussion <a href="/thread?id={{ .Thread.ID }}">{{ .Thread.Subject }}</a></h1>
<form action="/thread/reply" method="POST" enctype="multipart/form-data">
-<input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
-<input type="hidden" name="id" value="{{ .Parent.ID }}">
-<table class="form">
- <tr>
- <td colspan="2">
- {{ if .ShowParentSubject }}
- <b>{{ .Parent.Subject }}</b>
- {{ end }}
- <div class="message-text">{{ .Parent.Text }}</div>
- <div class="dimmed underline">
- by <a href="/user?id={{ .Parent.AuthorID }}">{{ .Parent.AuthorName }}-{{ .Parent.AuthorShortID }}</a>
- {{ .Parent.DateWritten }}
- </div>
- </td>
- </tr>
- <tr>
- <th>Subject:</th>
- <td><input type="text" name="subject" value="{{ .Reply.Subject }}" placeholder="Re: {{.Parent.Subject}}"></td>
- </tr>
- <tr>
- <th>Text:</th>
- <td><textarea name="text" rows="12">{{ .Reply.Text }}</textarea></td>
- </tr>
- <tr>
- <th></th>
- <td>
- {{ if .Message }}
- <span class="alert">{{ .Message }}</span><br>
- {{ end }}
- <input type="submit" name="action" class="no-double-post" value="Submit reply">
- </td>
- </tr>
-
-</table>
+ <input type="hidden" name="csrf" value="{{ .Common.CSRF }}">
+ <input type="hidden" name="id" value="{{ .Parent.ID }}">
+ <table class="form">
+ <tr>
+ <td colspan="2">
+ {{ if .ShowParentSubject }}
+ <b>{{ .Parent.Subject }}</b>
+ {{ end }}
+ <div class="message-text">{{ .Parent.Text }}</div>
+ <div class="dimmed underline">
+ by <a href="/user?id={{ .Parent.AuthorID }}">{{ .Parent.AuthorName }}-{{ .Parent.AuthorShortID }}</a>
+ {{ .Parent.DateWritten }}
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <th>Subject:</th>
+ <td><input type="text" name="subject" value="{{ .Reply.Subject }}" placeholder="Re: {{.Parent.Subject}}"></td>
+ </tr>
+ <tr>
+ <th>Text:</th>
+ <td><textarea name="text" rows="12">{{ .Reply.Text }}</textarea></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td>
+ {{ if .Message }}
+ <span class="alert">{{ .Message }}</span><br>
+ {{ end }}
+ <input type="submit" name="action" class="no-double-post" value="Submit reply">
+ </td>
+ </tr>
+ </table>
</form>
{{ end }}`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */
diff --git a/cmd/dscuss-web/view/user.go b/cmd/dscuss-web/view/user.go
index 9cbacf5..8eb2068 100644
--- a/cmd/dscuss-web/view/user.go
+++ b/cmd/dscuss-web/view/user.go
@@ -20,7 +20,7 @@ package view
const userHTML = `
{{ define "content" }}
-<h2 class="title">Profile of {{ .User.Nickname }}-{{ .User.ShortID }}</h1>
+<h1 id="title">{{ .Common.PageTitle }}</h1>
<table class="form">
<tr><th>Full ID</th><td>{{ .User.ID }}</td></tr>
<tr><th>Nickname</th><td>{{ .User.Nickname }}</td></tr>
@@ -28,7 +28,10 @@ const userHTML = `
<tr><th>Registration date</th><td>{{ .User.RegDate }}</td></tr>
</table>
<hr class="sep">
-<div><a href="/oper/list?type=user&id={{ .User.ID }}">Show operations</a> on this user.</div>
+<div>
+ <a href="/oper/list?type=user&id={{ .User.ID }}">Show operations</a> on this user.
+</div>
+
{{ end }}`
-/* vim: set filetype=html: */
+/* vim: set filetype=html tabstop=2: */