aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2021-05-30 09:13:47 +0000
committerr <r@freesoftwareextremist.com>2021-05-30 09:13:47 +0000
commit4ab53547a81aa954b694fbde292c14bd2d04b76c (patch)
tree4ed7280db468abc4b9a05bf05d5d32776772342a /templates
parent9f34b607498c09b4a21bdcc82b3295f6c94bd058 (diff)
parent44d4b0d379ddfe004bff710c5c3cb44692500ad4 (diff)
downloadbloat-4ab53547a81aa954b694fbde292c14bd2d04b76c.tar.gz
bloat-4ab53547a81aa954b694fbde292c14bd2d04b76c.zip
Merge branch 'master' into absolute_fluoride
Diffstat (limited to 'templates')
-rw-r--r--templates/about.tmpl4
-rw-r--r--templates/emoji.tmpl2
-rw-r--r--templates/error.tmpl11
-rw-r--r--templates/filters.tmpl40
-rw-r--r--templates/header.tmpl5
-rw-r--r--templates/nav.tmpl2
-rw-r--r--templates/notification.tmpl10
-rw-r--r--templates/postform.tmpl4
-rw-r--r--templates/requestlist.tmpl2
-rw-r--r--templates/search.tmpl2
-rw-r--r--templates/settings.tmpl8
-rw-r--r--templates/status.tmpl21
-rw-r--r--templates/thread.tmpl5
-rw-r--r--templates/user.tmpl8
-rw-r--r--templates/userlist.tmpl2
-rw-r--r--templates/usersearch.tmpl2
16 files changed, 95 insertions, 33 deletions
diff --git a/templates/about.tmpl b/templates/about.tmpl
index a179a9c..6357bcb 100644
--- a/templates/about.tmpl
+++ b/templates/about.tmpl
@@ -89,6 +89,10 @@
<td> Read notifications </td>
<td> <kbd>C</kbd> </td>
</tr>
+ <tr>
+ <td> Refresh thread page </td>
+ <td> <kbd>T</kbd> </td>
+ </tr>
</table>
<p>
You can activate the shortcuts by pressing the associated key with your browser's <a href="https://en.wikipedia.org/wiki/Access_key#Access_in_different_browsers" target="_blank">accesskey modifier</a>,
diff --git a/templates/emoji.tmpl b/templates/emoji.tmpl
index 551d6f6..ee84522 100644
--- a/templates/emoji.tmpl
+++ b/templates/emoji.tmpl
@@ -7,7 +7,7 @@
<div class="emoji-item-container">
<div class="emoji-item">
<img class="emoji" src="{{.URL}}" alt="{{.ShortCode}}" height="32" />
- <span class="emoji-shortcode">:{{.ShortCode}}:</span>
+ <span title=":{{.ShortCode}}:" class="emoji-shortcode">:{{.ShortCode}}:</span>
</div>
</div>
{{end}}
diff --git a/templates/error.tmpl b/templates/error.tmpl
index fc925ca..c8da1e6 100644
--- a/templates/error.tmpl
+++ b/templates/error.tmpl
@@ -2,10 +2,15 @@
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
<div class="page-title"> Error </div>
-<div class="error-text"> {{.Error}} </div>
+<div class="error-text"> {{.Err}} </div>
<div>
- <a href="/timeline/home">Home</a>
- <a href="/signin" target="_top">Sign In</a>
+ <a href="/timeline/home">home</a>
+ {{if .Retry}}
+ <a href="{{$.Ctx.Referrer}}">retry</a>
+ {{end}}
+ {{if .SessionErr}}
+ <a href="/signin" target="_top">signin</a>
+ {{end}}
</div>
{{template "footer.tmpl"}}
diff --git a/templates/filters.tmpl b/templates/filters.tmpl
new file mode 100644
index 0000000..ef7c024
--- /dev/null
+++ b/templates/filters.tmpl
@@ -0,0 +1,40 @@
+{{with .Data}}
+{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
+<div class="page-title"> Filters </div>
+
+{{if .Filters}}
+<table class="filters">
+ {{range .Filters}}
+ <tr>
+ <td> {{.Phrase}}{{if not .WholeWord}}*{{end}} </td>
+ <td>
+ <form action="/unfilter/{{.ID}}" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <button type="submit"> Delete </button>
+ </form>
+ </td>
+ </tr>
+ {{end}}
+</table>
+{{else}}
+ <div class="filters"> No filters added </div>
+{{end}}
+
+<div class="page-title"> Add filter </div>
+<form action="/filter" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <span class="settings-form-field">
+ <label for="phrase"> Phrase </label>
+ <input id="phrase" name="phrase" required>
+ </span>
+ <span class="settings-form-field">
+ <input id="whole-word" name="whole_word" type="checkbox" value="true" checked>
+ <label for="whole-word"> Whole word </label>
+ </span>
+ <button type="submit"> Add </button>
+</form>
+
+{{template "footer.tmpl"}}
+{{end}}
diff --git a/templates/header.tmpl b/templates/header.tmpl
index df2b6af..8eb53f6 100644
--- a/templates/header.tmpl
+++ b/templates/header.tmpl
@@ -17,7 +17,7 @@
{{if .RefreshInterval}}
<meta http-equiv="refresh" content="{{.RefreshInterval}}">
{{end}}
- <title> {{if gt .Count 0}}({{.Count}}){{end}} {{.Title}} </title>
+ <title> {{if gt .Count 0}}({{.Count}}){{end}} {{.Title | html}} </title>
<link rel="stylesheet" href="/static/style.css">
{{if .CustomCSS}}
<link rel="stylesheet" href="{{.CustomCSS}}">
@@ -25,6 +25,9 @@
{{if $.Ctx.FluorideMode}}
<script src="/static/fluoride.js"></script>
{{end}}
+ {{if $.Ctx.UserCSS}}
+ <style>{{$.Ctx.UserCSS}}</style>
+ {{end}}
</head>
<body {{if $.Ctx.DarkMode}}class="dark"{{end}}>
{{end}}
diff --git a/templates/nav.tmpl b/templates/nav.tmpl
index 98f0532..88458c8 100644
--- a/templates/nav.tmpl
+++ b/templates/nav.tmpl
@@ -3,7 +3,7 @@
<div class="user-info">
<div class="user-info-img-container">
<a class="img-link" href="/timeline/home" title="Home (1)">
- <img class="user-info-img" src="{{.User.AvatarStatic}}" alt="profile-avatar" height="64" />
+ <img class="user-info-img" src="{{.User.Avatar}}" alt="profile-avatar" height="64" />
</a>
</div>
<div class="user-info-details-container">
diff --git a/templates/notification.tmpl b/templates/notification.tmpl
index 4eed61b..2778ef0 100644
--- a/templates/notification.tmpl
+++ b/templates/notification.tmpl
@@ -23,7 +23,7 @@
<div class="notification-follow-container">
<div class="status-profile-img-container">
<a class="img-link" href="/user/{{.Account.ID}}">
- <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="@{{.Account.Acct}}" alt="profile-avatar" height="48" />
+ <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="profile-avatar" height="48" />
</a>
</div>
<div class="notification-follow">
@@ -43,7 +43,7 @@
<div class="notification-follow-container">
<div class="status-profile-img-container">
<a class="img-link" href="/user/{{.Account.ID}}">
- <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="@{{.Account.Acct}}" alt="profile-avatar" height="48" />
+ <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="profile-avatar" height="48" />
</a>
</div>
<div class="notification-follow">
@@ -76,7 +76,7 @@
{{else if eq .Type "reblog"}}
<div class="retweet-info">
<a class="img-link" href="/user/{{.Account.ID}}">
- <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
+ <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
</a>
<a href="/user/{{.Account.ID}}">
<span class="status-uname"> @{{.Account.Acct}} </span>
@@ -90,7 +90,7 @@
{{else if eq .Type "favourite"}}
<div class="retweet-info">
<a class="img-link" href="/user/{{.Account.ID}}">
- <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
+ <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
</a>
<a href="/user/{{.Account.ID}}">
<span class="status-uname"> @{{.Account.Acct}} </span>
@@ -104,7 +104,7 @@
{{else}}
<div class="retweet-info">
<a class="img-link" href="/user/{{.Account.ID}}">
- <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
+ <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
</a>
<a href="/user/{{.Account.ID}}">
<span class="status-uname"> @{{.Account.Acct}} </span>
diff --git a/templates/postform.tmpl b/templates/postform.tmpl
index b81126c..421b118 100644
--- a/templates/postform.tmpl
+++ b/templates/postform.tmpl
@@ -15,7 +15,7 @@
<textarea id="post-content" name="content" class="post-content" cols="34" rows="5" accesskey="E" title="Edit post (E)">{{if .ReplyContext}}{{.ReplyContext.ReplyContent}}{{end}}</textarea>
</div>
<div>
- {{if gt (len .Formats) 0}}
+ {{if .Formats}}
<span class="post-form-field">
{{$defFormat := .DefaultFormat}}
<select id="post-format" name="format" accesskey="F" title="Format (F)">
@@ -34,7 +34,7 @@
</select>
</span>
<span class="post-form-field">
- <input type="checkbox" id="nsfw-checkbox" name="is_nsfw" value="on" accesskey="N" title="NSFW (N)">
+ <input type="checkbox" id="nsfw-checkbox" name="is_nsfw" value="true" accesskey="N" title="NSFW (N)">
<label for="nsfw-checkbox"> NSFW </label>
</span>
</div>
diff --git a/templates/requestlist.tmpl b/templates/requestlist.tmpl
index eec75f2..8142620 100644
--- a/templates/requestlist.tmpl
+++ b/templates/requestlist.tmpl
@@ -4,7 +4,7 @@
<div class="user-list-item">
<div class="user-list-profile-img">
<a class="img-link" href="/user/{{.ID}}">
- <img class="status-profile-img" src="{{.AvatarStatic}}" title="@{{.Acct}}" alt="avatar" height="48" />
+ <img class="status-profile-img" src="{{.Avatar}}" title="@{{.Acct}}" alt="avatar" height="48" />
</a>
</div>
<div class="user-list-name">
diff --git a/templates/search.tmpl b/templates/search.tmpl
index 0473d4a..7338cad 100644
--- a/templates/search.tmpl
+++ b/templates/search.tmpl
@@ -5,7 +5,7 @@
<form class="search-form" action="/search" method="GET">
<span class="post-form-field">
<label for="query"> Query </label>
- <input id="query" name="q" value="{{.Q}}">
+ <input id="query" name="q" value="{{.Q | html}}">
</span>
<span class="post-form-field">
<label for="type"> Type </label>
diff --git a/templates/settings.tmpl b/templates/settings.tmpl
index 4a72b6a..500aea8 100644
--- a/templates/settings.tmpl
+++ b/templates/settings.tmpl
@@ -5,6 +5,7 @@
<form id="settings-form" action="/settings" method="POST">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ {{if .PostFormats}}
<div class="settings-form-field">
<label for="visibility"> Default format </label>
{{$defFormat := .Settings.DefaultFormat}}
@@ -14,6 +15,7 @@
{{end}}
</select>
</div>
+ {{end}}
<div class="settings-form-field">
<label for="visibility"> Default scope </label>
<select id="visibility" name="visibility">
@@ -63,6 +65,12 @@
<input id="dark-mode" name="dark_mode" type="checkbox" value="true" {{if .Settings.DarkMode}}checked{{end}}>
<label for="dark-mode"> Use dark theme </label>
</div>
+ <div class="settings-form-field">
+ <label for="css"> Custom CSS: </label>
+ </div>
+ <div>
+ <textarea id="css" name="css" cols="80" rows="8">{{.Settings.CSS}}</textarea>
+ </div>
<button type="submit"> Save </button>
</form>
diff --git a/templates/status.tmpl b/templates/status.tmpl
index a1e2d9f..9109f4e 100644
--- a/templates/status.tmpl
+++ b/templates/status.tmpl
@@ -3,7 +3,7 @@
{{if .Reblog}}
<div class="retweet-info">
<a class="img-link" href="/user/{{.Account.ID}}">
- <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="@{{.Account.Acct}}" alt="avatar" height="24" />
+ <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="24" />
</a>
<bdi class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </bdi>
<a href="/user/{{.Account.ID}}">
@@ -18,7 +18,7 @@
<div class="status-container status-{{.ID}}" data-id="{{.ID}}">
<div class="status-profile-img-container">
<a class="img-link" href="/user/{{.Account.ID}}">
- <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
+ <img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="48" />
</a>
</div>
<div class="status">
@@ -88,7 +88,7 @@
{{end}}
</div>
{{if .Content}}
- <div class="status-content"> {{StatusContentFilter .SpoilerText .Content .Emojis .Mentions}} </div>
+ <div class="status-content"> {{StatusContentFilter (html .SpoilerText) .Content .Emojis .Mentions}} </div>
{{end}}
{{if .MediaAttachments}}
<div class="status-media-container">
@@ -101,7 +101,7 @@
</a>
{{else}}
<a class="img-link" href="{{.URL}}" target="_blank" title="{{.Description}}">
- <img class="status-image" src="{{.URL}}" alt="status-image" height="240" />
+ <img class="status-image" src="{{.PreviewURL}}" alt="status-image" height="240" />
{{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
<div class="status-nsfw-overlay"></div>
{{end}}
@@ -153,12 +153,12 @@
{{range $i, $o := .Poll.Options}}
<div class="poll-option">
{{if (or $s.Poll.Expired $s.Poll.Voted)}}
- <div> {{EmojiFilter $o.Title $s.Emojis}} - {{$o.VotesCount}} votes </div>
+ <div> {{EmojiFilter (html $o.Title) $s.Emojis}} - {{$o.VotesCount}} votes </div>
{{else}}
<input type="{{if $s.Poll.Multiple}}checkbox{{else}}radio{{end}}" name="choices"
id="poll-{{$s.ID}}-{{$i}}" value="{{$i}}">
<label for="poll-{{$s.ID}}-{{$i}}">
- {{EmojiFilter $o.Title $s.Emojis}}
+ {{EmojiFilter (html $o.Title) $s.Emojis}}
</label>
{{end}}
</div>
@@ -193,24 +193,19 @@
</a>
</div>
<div class="status-action">
- {{if or (eq .Visibility "private") (eq .Visibility "direct")}}
- <a class="status-retweet" href="" title="this status cannot be retweeted">
- retweet
- </a>
- {{else}}
{{$rt := "retweet"}} {{if .Reblogged}} {{$rt = "unretweet"}} {{end}}
<form class="status-retweet" data-action="{{$rt}}" action="/{{$rt}}/{{.ID}}" method="post" target="_self">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
<input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
- <input type="submit" value="{{$rt}}" class="btn-link">
+ <input type="submit" value="{{$rt}}" class="btn-link"
+ {{if or (eq .Visibility "private") (eq .Visibility "direct")}}title="this status cannot be retweeted" disabled{{end}}>
<a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list">
{{if and (not $.Ctx.AntiDopamineMode) .ReblogsCount}}
({{DisplayInteractionCount .ReblogsCount}})
{{end}}
</a>
</form>
- {{end}}
</div>
<div class="status-action">
{{$like := "like"}} {{if .Favourited}} {{$like = "unlike"}} {{end}}
diff --git a/templates/thread.tmpl b/templates/thread.tmpl
index 8cf9ead..bb9f14f 100644
--- a/templates/thread.tmpl
+++ b/templates/thread.tmpl
@@ -1,6 +1,9 @@
{{with $s := .Data}}
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
-<div class="page-title"> Thread </div>
+<div class="notification-title-container">
+ <span class="page-title"> Thread </span>
+ <a class="notification-refresh" href="{{$.Ctx.Referrer}}" accesskey="T" title="Refresh (T)">refresh</a>
+</div>
{{range .Statuses}}
diff --git a/templates/user.tmpl b/templates/user.tmpl
index af6a8d1..c7b3164 100644
--- a/templates/user.tmpl
+++ b/templates/user.tmpl
@@ -5,8 +5,8 @@
<div class="user-info-container">
<div>
<div class="user-profile-img-container">
- <a class="img-link" href="{{.User.AvatarStatic}}" target="_blank">
- <img class="user-profile-img" src="{{.User.AvatarStatic}}" alt="profile-avatar" height="96" />
+ <a class="img-link" href="{{.User.Avatar}}" target="_blank">
+ <img class="user-profile-img" src="{{.User.Avatar}}" alt="profile-avatar" height="96" />
</a>
</div>
<div class="user-profile-details-container">
@@ -119,11 +119,15 @@
{{end}}
<div>
<a href="/usersearch/{{.User.ID}}"> search statuses </a>
+ {{if .IsCurrent}} - <a href="/filters"> filters </a> {{end}}
</div>
</div>
<div class="user-profile-decription">
{{EmojiFilter .User.Note .User.Emojis}}
</div>
+ {{if .User.Fields}}{{range .User.Fields}}
+ <div>{{.Name}} - {{.Value}}</div>
+ {{end}}{{end}}
</div>
</div>
diff --git a/templates/userlist.tmpl b/templates/userlist.tmpl
index 0a83bf4..3f75085 100644
--- a/templates/userlist.tmpl
+++ b/templates/userlist.tmpl
@@ -4,7 +4,7 @@
<div class="user-list-item">
<div class="user-list-profile-img">
<a class="img-link" href="/user/{{.ID}}">
- <img class="status-profile-img" src="{{.AvatarStatic}}" title="@{{.Acct}}" alt="avatar" height="48" />
+ <img class="status-profile-img" src="{{.Avatar}}" title="@{{.Acct}}" alt="avatar" height="48" />
</a>
</div>
<div class="user-list-name">
diff --git a/templates/usersearch.tmpl b/templates/usersearch.tmpl
index 3f42f28..ee84143 100644
--- a/templates/usersearch.tmpl
+++ b/templates/usersearch.tmpl
@@ -5,7 +5,7 @@
<form class="search-form" action="/usersearch/{{.User.ID}}" method="GET">
<span class="post-form-field>
<label for="query"> Query </label>
- <input id="query" name="q" value="{{.Q}}">
+ <input id="query" name="q" value="{{.Q | html}}">
</span>
<button type="submit"> Search </button>
</form>