aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-13 18:08:26 +0000
committerr <r@freesoftwareextremist.com>2019-12-13 18:26:24 +0000
commit5e4da01c3ae3ae2e870faba9085d9d9213c01c29 (patch)
tree39d6f1e76b901549f194ddbac3c6cb82e0abd019 /templates
downloadbloat-5e4da01c3ae3ae2e870faba9085d9d9213c01c29.tar.gz
bloat-5e4da01c3ae3ae2e870faba9085d9d9213c01c29.zip
Initial commit
Diffstat (limited to 'templates')
-rw-r--r--templates/error.tmpl6
-rw-r--r--templates/footer.tmpl2
-rw-r--r--templates/header.tmpl10
-rw-r--r--templates/homepage.tmpl4
-rw-r--r--templates/signin.tmpl9
-rw-r--r--templates/status.tmpl43
-rw-r--r--templates/thread.tmpl24
-rw-r--r--templates/timeline.tmpl22
8 files changed, 120 insertions, 0 deletions
diff --git a/templates/error.tmpl b/templates/error.tmpl
new file mode 100644
index 0000000..b6943be
--- /dev/null
+++ b/templates/error.tmpl
@@ -0,0 +1,6 @@
+{{template "header.tmpl"}}
+<h1> Error </h1>
+<div> {{.}} </div>
+<a href="/timeline"> Home </a>
+{{template "footer.tmpl"}}
+
diff --git a/templates/footer.tmpl b/templates/footer.tmpl
new file mode 100644
index 0000000..308b1d0
--- /dev/null
+++ b/templates/footer.tmpl
@@ -0,0 +1,2 @@
+</body>
+</html>
diff --git a/templates/header.tmpl b/templates/header.tmpl
new file mode 100644
index 0000000..970aca4
--- /dev/null
+++ b/templates/header.tmpl
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset='utf-8'>
+ <meta content='width=device-width, initial-scale=1' name='viewport'>
+ <title> Web </title>
+ <link rel="stylesheet" href="/static/main.css" />
+ <link rel="stylesheet" href="/static/fonts/fonts.css">
+</head>
+<body>
diff --git a/templates/homepage.tmpl b/templates/homepage.tmpl
new file mode 100644
index 0000000..256bb29
--- /dev/null
+++ b/templates/homepage.tmpl
@@ -0,0 +1,4 @@
+{{template "header.tmpl"}}
+<h1> HOME </h1>
+<a href="/signin"> Signin </a>
+{{template "footer.tmpl"}}
diff --git a/templates/signin.tmpl b/templates/signin.tmpl
new file mode 100644
index 0000000..07bc132
--- /dev/null
+++ b/templates/signin.tmpl
@@ -0,0 +1,9 @@
+{{template "header.tmpl"}}
+<h3> Signin </h3>
+<a href="/"> Home </a>
+<form action="/signin" method="post">
+ <input type="text" name="instance" placeholder="instance">
+ <br>
+ <button type="submit"> Submit </button>
+</form>
+{{template "footer.tmpl"}}
diff --git a/templates/status.tmpl b/templates/status.tmpl
new file mode 100644
index 0000000..47ff6e4
--- /dev/null
+++ b/templates/status.tmpl
@@ -0,0 +1,43 @@
+<div class="status-container">
+ <div>
+ <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
+ </div>
+ <div class="status">
+ <div class="status-name">
+ <span class="status-dname"> {{WithEmojis .Account.DisplayName .Account.Emojis}} </span>
+ <span class="status-uname"> {{.Account.Acct}} </span>
+ </div>
+ <div class="status-content"> {{WithEmojis .Content .Emojis}} </div>
+ <div class="status-action">
+ <a class="status-you" href="/thread/{{.ID}}?reply=true" title="reply">
+ <span class="icon dripicons-reply"></span>
+ <span> {{DisplayInteractionCount .RepliesCount}} </span>
+ </a>
+ {{if .Reblogged}}
+ <a class="status-retweet" href="/unretweet/{{.ID}}" title="undo repost">
+ <span class="icon dripicons-retweet retweeted"></span>
+ <span> {{DisplayInteractionCount .ReblogsCount}} </span>
+ </a>
+ {{else}}
+ <a class="status-retweet" href="/retweet/{{.ID}}" title="repost">
+ <span class="icon dripicons-retweet"></span>
+ <span> {{DisplayInteractionCount .ReblogsCount}} </span>
+ </a>
+ {{end}}
+ {{if .Favourited}}
+ <a class="status-like" href="/unlike/{{.ID}}" title="unlike">
+ <span class="icon dripicons-star liked"></span>
+ <span> {{DisplayInteractionCount .FavouritesCount}} </span>
+ </a>
+ {{else}}
+ <a class="status-like" href="/like/{{.ID}}" title="like">
+ <span class="icon dripicons-star"></span>
+ <span> {{DisplayInteractionCount .FavouritesCount}} </span>
+ </a>
+ {{end}}
+ <a class="status-time" href="/thread/{{.ID}}">
+ <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{.CreatedAt}}"> {{TimeSince .CreatedAt}} </time>
+ </a>
+ </div>
+ </div>
+</div>
diff --git a/templates/thread.tmpl b/templates/thread.tmpl
new file mode 100644
index 0000000..4d6aad0
--- /dev/null
+++ b/templates/thread.tmpl
@@ -0,0 +1,24 @@
+{{template "header.tmpl"}}
+<h1> THREAD </h1>
+
+{{range .Context.Ancestors}}
+{{template "status.tmpl" .}}
+{{end}}
+
+{{template "status.tmpl" .Status}}
+{{if .PostReply}}
+<form class="timeline-post-form" action="/post" method="POST">
+ <input type="hidden" name="reply_to_id" value="{{.ReplyToID}}" />
+ <label for="post-content"> Reply to {{.Status.Account.DisplayName}} </label>
+ <br/>
+ <textarea id="post-content" name="content" class="post-content" cols="50" rows="5"></textarea>
+ <br/>
+ <button type="submit"> Post </button>
+</form>
+{{end}}
+
+{{range .Context.Descendants}}
+{{template "status.tmpl" .}}
+{{end}}
+
+{{template "footer.tmpl"}}
diff --git a/templates/timeline.tmpl b/templates/timeline.tmpl
new file mode 100644
index 0000000..b9ee3a5
--- /dev/null
+++ b/templates/timeline.tmpl
@@ -0,0 +1,22 @@
+{{template "header.tmpl"}}
+<h1> TIMELINE </h1>
+
+<form class="timeline-post-form" action="/post" method="POST">
+ <label for="post-content"> New Post </label>
+ <br/>
+ <textarea id="post-content" name="content" class="post-content" cols="50" rows="5"></textarea>
+ <br/>
+ <button type="submit"> Post </button>
+</form>
+
+{{range .Statuses}}
+{{template "status.tmpl" .}}
+{{end}}
+
+{{if .HasNext}}
+ <a href="{{.NextLink}}"> next </a>
+{{end}}
+{{if .HasPrev}}
+ <a href="{{.PrevLink}}"> next </a>
+{{end}}
+{{template "footer.tmpl"}}