summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorNicolas Sterchele <nicolas@sterchelen.net>2022-08-31 23:08:52 +0200
committerNicolas Sterchele <nicolas@sterchelen.net>2022-08-31 23:19:58 +0200
commitb9281c89737419216b710a87c31686d21adf86bc (patch)
treebc2b2c73b35ead61bee37b75aec1eee2d78c6ef4 /views
initial commit
Thanks to Ted Unangst for its work. Originally available here https://humungus.tedunangst.com/r/inks
Diffstat (limited to 'views')
-rwxr-xr-xviews/addlink.html18
-rwxr-xr-xviews/header.html23
-rwxr-xr-xviews/inks.html38
-rwxr-xr-xviews/login.html10
-rwxr-xr-xviews/sources.html22
-rwxr-xr-xviews/style.css112
-rwxr-xr-xviews/tags.html17
7 files changed, 240 insertions, 0 deletions
diff --git a/views/addlink.html b/views/addlink.html
new file mode 100755
index 0000000..2a0031c
--- /dev/null
+++ b/views/addlink.html
@@ -0,0 +1,18 @@
+{{ template "header.html" . }}
+<main>
+<form action="/savelink" method="POST" class="link">
+<input type="hidden" name="CSRF" value="{{ .SaveCSRF }}">
+{{ with .Link }}
+<input type="hidden" name="linkid" value="{{ .ID }}">
+<p><input tabindex=1 type="text" name="url" value="{{ .URL }}" autocomplete=off> - url
+<p><input tabindex=1 type="text" name="title" value="{{ .Title }}" autocomplete=off> - title
+<p>
+<textarea tabindex=1 name="summary">{{ .PlainSummary }}</textarea>
+<p><input tabindex=1 type="text" name="tags" value="{{ range .Tags }}{{.}} {{ end }}" autocomplete=off> - tags
+<p><input tabindex=1 type="text" name="source" value="{{ .Source }}" autocomplete=off> - source
+{{ end }}
+<p><input tabindex=1 type="submit" name="submit" value="submit">
+</form>
+</main>
+</body>
+</html>
diff --git a/views/header.html b/views/header.html
new file mode 100755
index 0000000..7cf03f3
--- /dev/null
+++ b/views/header.html
@@ -0,0 +1,23 @@
+<head>
+<title>inks</title>
+<link href="/style.css{{ .StyleParam }}" rel="stylesheet">
+<link href="/rss" rel="alternate" type="application/rss+xml" title="inks rss">
+<link href="/icon.png" rel="icon">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
+<body>
+<header>
+<span><a href="/" title="follow via activitypub">@inks@{{ .ServerName }}</a></span>
+<span><a href="/tags">tags</a></span>
+<span><a href="/sources">sources</a></span>
+<span><a href="/random">random</a></span>
+{{ if .UserInfo }}
+<span><a href="/addlink">add link</a></span>
+<span><a href="/logout?CSRF={{ .LogoutCSRF }}">logout</a></span>
+{{ else }}
+<span><a href="/rss">rss</a></span>
+{{ end }}
+<form action="/search" method="GET">
+<input tabindex=10 type="text" name="q" autocomplete=off size=18 placeholder="search">
+</form>
+</header>
diff --git a/views/inks.html b/views/inks.html
new file mode 100755
index 0000000..e3e61b0
--- /dev/null
+++ b/views/inks.html
@@ -0,0 +1,38 @@
+{{ template "header.html" . }}
+<main>
+{{ if .PageInfo }}
+<div class="link">
+<div class="summary">
+<p>{{ .PageInfo }}
+</div>
+</div>
+{{ end }}
+{{ $csrf := .SaveCSRF }}
+{{ range .Links }}
+<article class="link">
+<p class="title">{{ .Title }}
+<p class="url"><a href="{{ .URL }}">{{ .URL }}</a> [<a href="/site/{{ .Site }}">{{ .Site }}</a>]
+<p>{{ .Posted.Format "2006-01-02 15:04" }}
+<p class="tags">tags:
+{{ range .Tags }}
+<a class="tag" href="/tag/{{ . }}">{{ . }}</a>
+{{ end }}
+<div class="summary">
+<p>
+{{ .Summary }}
+{{ if .Source }}
+<p>source: <a href="/source/{{ .Source }}">{{ .Source }}</a>
+{{ end }}
+</div>
+<div class="tail">
+<a href="/l/{{ .ID }}">#</a>
+{{ if $csrf }}
+<span style="margin-left:0.75em"><a href="/edit/{{ .ID }}">edit</a>
+</span>
+{{ end }}
+</div>
+</article>
+{{ end }}
+</main>
+</body>
+</html>
diff --git a/views/login.html b/views/login.html
new file mode 100755
index 0000000..e9eb564
--- /dev/null
+++ b/views/login.html
@@ -0,0 +1,10 @@
+{{ template "header.html" . }}
+<main>
+<form action="/dologin" method="POST" class="link">
+<p><input tabindex=1 type="text" name="username" autocomplete=off> - username
+<p><input tabindex=1 type="password" name="password"> - password
+<p><input tabindex=1 type="submit" name="login" value="login">
+</form>
+</main>
+</body>
+</html>
diff --git a/views/sources.html b/views/sources.html
new file mode 100755
index 0000000..9997209
--- /dev/null
+++ b/views/sources.html
@@ -0,0 +1,22 @@
+{{ template "header.html" . }}
+<main>
+{{ $csrf := .SaveCSRF }}
+<table>
+{{ range .Sources }}
+<tr class="link">
+{{ if $csrf }}
+<form action="/savesource" method="POST" class="link">
+<input type="hidden" name="CSRF" value="{{ $csrf }}">
+<input type="hidden" name="sourcename" value="{{ .Name }}" autocomplete=off>
+<td><a href="/source/{{ .Name }}">{{ .Name }}</a>
+<td><input tabindex=1 type="text" name="sourcenotes" value="{{ .Notes }}" autocomplete=off>
+<td><input tabindex=1 type="submit" name="submit" value="submit">
+</form>
+{{ else }}
+<td><a href="/source/{{ .Name }}">{{ .Name }}</a>{{ with .Info }} - {{ . }}{{ end }}
+{{ end }}
+{{ end }}
+</table>
+</main>
+</body>
+</html>
diff --git a/views/style.css b/views/style.css
new file mode 100755
index 0000000..d5ccf19
--- /dev/null
+++ b/views/style.css
@@ -0,0 +1,112 @@
+body {
+ background: #121;
+ font-size: 18px;
+ font-family: monospace;
+ margin: 2em;
+ word-break: break-word;
+}
+:focus {
+ outline: 2px solid #aea;
+}
+a {
+ color: #aea;
+}
+main, header {
+ max-width: 1260px;
+ margin: auto;
+}
+header {
+ margin-bottom: 2em;
+}
+header form {
+ display: inline;
+}
+header span, header form {
+ margin-right: 1em;
+ white-space: nowrap;
+}
+blockquote {
+ margin-left: 1.5em;
+ padding-left: 0.5em;
+ margin-right: 2em;
+ border-left: 1px solid #474;
+}
+.link {
+ padding: 0em;
+ color: #8d8;
+ background: #121;
+ border: 2px solid #474;
+ margin-bottom: 2em;
+}
+
+article.link p {
+ margin: 0;
+ margin-left: 2em;
+ margin-right: 2em;
+}
+.link .title {
+ font-size: 1.5em;
+ margin-left: 0em;
+ margin-bottom: 0.5em;
+}
+.link .summary p {
+ margin-top: 1em;
+}
+.link .tail {
+ margin-top: 1em;
+}
+
+form.link {
+ padding: 1em;
+ padding-top: 0em;
+ padding-bottom: 0em;
+ font-size: 1.0em;
+ margin: 0em;
+ border: 2px solid #aea;
+}
+tr.link td {
+ padding: 1em;
+ font-size: 1.5em;
+ margin: 1em;
+ border: 2px solid #aea;
+}
+input, textarea {
+ background: #121;
+ color: #aea;
+ font-size: 0.9em;
+ font-family: monospace;
+ border: 2px solid #474;
+}
+form.link input {
+ width: 85%;
+}
+form.link textarea {
+ height: 12em;
+ width: 85%;
+}
+@media screen and (max-width: 740px) {
+ body {
+ margin: 0.5em;
+ }
+ header {
+ margin: 1.0em;
+ line-height: 2;
+ }
+ header form {
+ display: block;
+ }
+ .link .title {
+ font-size: 1.3em;
+ }
+ article.link p {
+ margin-left: 1em;
+ margin-right: 1em;
+ }
+ blockquote {
+ margin-left: 0.5em;
+ margin-right: 1.0em;
+ }
+ form.link input, form.link textarea {
+ width: 100%;
+ }
+}
diff --git a/views/tags.html b/views/tags.html
new file mode 100755
index 0000000..0273065
--- /dev/null
+++ b/views/tags.html
@@ -0,0 +1,17 @@
+{{ template "header.html" . }}
+<main>
+{{ $letter := 0 }}
+<div class=link>
+<ul>
+{{ range .Tags }}
+{{ if not (eq $letter (index .Name 0)) }}
+{{ $letter = (index .Name 0) }}
+<li><p>
+{{ end }}
+<a href="/tag/{{ .Name }}">{{ .Name }}</a> ({{ .Count }})
+{{ end }}
+</ul>
+</div>
+</main>
+</body>
+</html>