aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/about.tmpl4
-rw-r--r--templates/emoji.tmpl2
-rw-r--r--templates/header.tmpl4
-rw-r--r--templates/list.tmpl63
-rw-r--r--templates/lists.tmpl35
-rw-r--r--templates/nav.tmpl11
-rw-r--r--templates/notification.tmpl4
-rw-r--r--templates/postform.tmpl2
-rw-r--r--templates/requestlist.tmpl2
-rw-r--r--templates/search.tmpl2
-rw-r--r--templates/status.tmpl21
-rw-r--r--templates/user.tmpl15
-rw-r--r--templates/userlist.tmpl14
-rw-r--r--templates/userlistitem.tmpl15
-rw-r--r--templates/usersearch.tmpl6
15 files changed, 155 insertions, 45 deletions
diff --git a/templates/about.tmpl b/templates/about.tmpl
index 54316cf..0e4d001 100644
--- a/templates/about.tmpl
+++ b/templates/about.tmpl
@@ -46,11 +46,11 @@
<td> <kbd>6</kbd> </td>
</tr>
<tr>
- <td> Settings </td>
+ <td> Lists </td>
<td> <kbd>7</kbd> </td>
</tr>
<tr>
- <td> Signout </td>
+ <td> Settings </td>
<td> <kbd>8</kbd> </td>
</tr>
<tr>
diff --git a/templates/emoji.tmpl b/templates/emoji.tmpl
index ee84522..4b07e81 100644
--- a/templates/emoji.tmpl
+++ b/templates/emoji.tmpl
@@ -6,7 +6,7 @@
{{range .Emojis}}
<div class="emoji-item-container">
<div class="emoji-item">
- <img class="emoji" src="{{.URL}}" alt="{{.ShortCode}}" height="32" />
+ <img class="emoji" src="{{.URL}}" alt="{{.ShortCode}}" height="32" loading="lazy" />
<span title=":{{.ShortCode}}:" class="emoji-shortcode">:{{.ShortCode}}:</span>
</div>
</div>
diff --git a/templates/header.tmpl b/templates/header.tmpl
index 8eb53f6..8a1b0ca 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 | html}} </title>
+ <title> {{if gt .Count 0}}({{.Count}}){{end}} {{.Title}} </title>
<link rel="stylesheet" href="/static/style.css">
{{if .CustomCSS}}
<link rel="stylesheet" href="{{.CustomCSS}}">
@@ -26,7 +26,7 @@
<script src="/static/fluoride.js"></script>
{{end}}
{{if $.Ctx.UserCSS}}
- <style>{{$.Ctx.UserCSS}}</style>
+ <style>{{RawCSS $.Ctx.UserCSS}}</style>
{{end}}
</head>
<body {{if $.Ctx.DarkMode}}class="dark"{{end}}>
diff --git a/templates/list.tmpl b/templates/list.tmpl
new file mode 100644
index 0000000..dcc6ee8
--- /dev/null
+++ b/templates/list.tmpl
@@ -0,0 +1,63 @@
+{{with .Data}}
+{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
+<div class="page-title"> List {{.List.Title}} </div>
+
+<form action="/list/{{.List.ID}}/rename" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <input id="title" name="title" value="{{.List.Title}}">
+ <button type="submit"> Rename </button>
+</form>
+
+<div class="page-title"> Users </div>
+{{if .Accounts}}
+<table>
+{{range .Accounts}}
+ <tr>
+ <td class="p-0"> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td>
+ <td class="p-0">
+ <form class="user-list-action" action="/list/{{$.Data.List.ID}}/removeuser?uid={{.ID}}" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <button type="submit"> Remove </button>
+ </form>
+ </td>
+ </tr>
+{{end}}
+</table>
+{{else}}
+<div class="no-data-found">No data found</div>
+{{end}}
+
+<div class="page-title"> Add user </div>
+<form class="search-form" action="/list/{{.List.ID}}" method="GET">
+ <span class="post-form-field">
+ <label for="query"> Query </label>
+ <input id="query" name="q" value="{{.Q}}">
+ </span>
+ <button type="submit"> Search </button>
+</form>
+
+{{if .Q}}
+{{if .SearchAccounts}}
+<table>
+{{range .SearchAccounts}}
+ <tr>
+ <td> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td>
+ <td>
+ <form class="user-list-action" action="/list/{{$.Data.List.ID}}/adduser?uid={{.ID}}" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <button type="submit"> Add </button>
+ </form>
+ </td>
+ </tr>
+{{end}}
+</table>
+{{else}}
+<div class="no-data-found">No data found</div>
+{{end}}
+{{end}}
+
+{{template "footer.tmpl"}}
+{{end}}
diff --git a/templates/lists.tmpl b/templates/lists.tmpl
new file mode 100644
index 0000000..27979cb
--- /dev/null
+++ b/templates/lists.tmpl
@@ -0,0 +1,35 @@
+{{with .Data}}
+{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
+<div class="page-title"> Lists </div>
+
+{{range .Lists}}
+<div>
+ <a href="/timeline/list?list={{.ID}}"> {{.Title}} timeline </a>
+ -
+ <form class="d-inline" action="/list/{{.ID}}" method="GET">
+ <button type="submit" class="btn-link"> edit </button>
+ </form>
+ -
+ <form class="d-inline" action="/list/{{.ID}}/remove" method="POST">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
+ <button type="submit" class="btn-link"> delete </button>
+ </form>
+</div>
+{{else}}
+<div class="no-data-found">No data found</div>
+{{end}}
+
+<div class="page-title"> Add list </div>
+<form action="/list" 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="title"> Title </label>
+ <input id="title" name="title" required>
+ </span>
+ <button type="submit"> Add </button>
+</form>
+
+{{template "footer.tmpl"}}
+{{end}}
diff --git a/templates/nav.tmpl b/templates/nav.tmpl
index ea18a5f..db88aa0 100644
--- a/templates/nav.tmpl
+++ b/templates/nav.tmpl
@@ -8,7 +8,7 @@
</div>
<div class="user-info-details-container">
<div class="user-info-details-name">
- <bdi class="status-dname"> {{EmojiFilter (html .User.DisplayName) .User.Emojis}} </bdi>
+ <bdi class="status-dname"> {{EmojiFilter (HTML .User.DisplayName) .User.Emojis | Raw}} </bdi>
<a class="nav-link" href="/user/{{.User.ID}}" accesskey="0" title="User profile (0)">
<span class="status-uname"> @{{.User.Acct}} </span>
</a>
@@ -17,16 +17,17 @@
<a class="nav-link" href="/timeline/home" accesskey="1" title="Home timeline (1)">home</a>
<a class="nav-link" href="/timeline/direct" accesskey="2" title="Direct timeline (2)">direct</a>
<a class="nav-link" href="/timeline/local" accesskey="3" title="Local timeline (3)">local</a>
- <a class="nav-link" href="/timeline/twkn" accesskey="5" title="The Whole Known Netwwork (4)">twkn</a>
- <a class="nav-link" href="/timeline/remote" accesskey="4" title="Remote timeline (5)">remote</a>
+ <a class="nav-link" href="/timeline/twkn" accesskey="4" title="The Whole Known Netwwork (4)">twkn</a>
+ <a class="nav-link" href="/timeline/remote" accesskey="5" title="Remote timeline (5)">remote</a>
<a class="nav-link" href="/search" accesskey="6" title="Search (6)">search</a>
</div>
<div>
- <a class="nav-link" href="/settings" target="_top" accesskey="7" title="Settings (7)">settings</a>
+ <a class="nav-link" href="/lists" accesskey="7" title="Lists (7)">lists</a>
+ <a class="nav-link" href="/settings" target="_top" accesskey="8" title="Settings (8)">settings</a>
<form class="signout" action="/signout" method="post" target="_top">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
- <input type="submit" value="signout" class="btn-link nav-link" accesskey="8" title="Signout (8)">
+ <input type="submit" value="signout" class="btn-link nav-link" title="Signout">
</form>
<a class="nav-link" href="/about" accesskey="9" title="About (9)">about</a>
</div>
diff --git a/templates/notification.tmpl b/templates/notification.tmpl
index a7f88a7..f62726b 100644
--- a/templates/notification.tmpl
+++ b/templates/notification.tmpl
@@ -28,7 +28,7 @@
</div>
<div class="notification-follow">
<div class="notification-info-text">
- <bdi class="status-dname"> {{EmojiFilter (html .Account.DisplayName) .Account.Emojis}} </bdi>
+ <bdi class="status-dname"> {{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}} </bdi>
<span class="notification-text"> followed you -
<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
</span>
@@ -48,7 +48,7 @@
</div>
<div class="notification-follow">
<div class="notification-info-text">
- <bdi class="status-dname"> {{EmojiFilter (html .Account.DisplayName) .Account.Emojis}} </bdi>
+ <bdi class="status-dname"> {{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}} </bdi>
<span class="notification-text"> wants to follow you -
<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time>
</span>
diff --git a/templates/postform.tmpl b/templates/postform.tmpl
index 35171a4..0af50fb 100644
--- a/templates/postform.tmpl
+++ b/templates/postform.tmpl
@@ -5,7 +5,7 @@
{{if .ReplyContext}}
<input type="hidden" name="reply_to_id" value="{{.ReplyContext.InReplyToID}}" />
<input type="hidden" name="quickreply" value="{{.ReplyContext.QuickReply}}" />
- <label for="post-content" class="post-form-title"> Reply to {{.ReplyContext.InReplyToName}} </label>
+ <label for="post-content" class="post-form-title"> Reply to @{{.ReplyContext.InReplyToName}} </label>
{{else}}
<label for="post-content" class="post-form-title"> New post </label>
{{end}}
diff --git a/templates/requestlist.tmpl b/templates/requestlist.tmpl
index d9b2b0a..1a51e31 100644
--- a/templates/requestlist.tmpl
+++ b/templates/requestlist.tmpl
@@ -9,7 +9,7 @@
</div>
<div class="user-list-name">
<div>
- <div class="status-dname"> {{EmojiFilter (html .DisplayName) .Emojis}} </div>
+ <div class="status-dname"> {{EmojiFilter (HTML .DisplayName) .Emojis | Raw}} </div>
<a class="img-link" href="/user/{{.ID}}">
<div class="status-uname"> @{{.Acct}} </div>
</a>
diff --git a/templates/search.tmpl b/templates/search.tmpl
index 7338cad..0473d4a 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 | html}}">
+ <input id="query" name="q" value="{{.Q}}">
</span>
<span class="post-form-field">
<label for="type"> Type </label>
diff --git a/templates/status.tmpl b/templates/status.tmpl
index dda1d79..5ada84e 100644
--- a/templates/status.tmpl
+++ b/templates/status.tmpl
@@ -5,7 +5,7 @@
<a class="img-link" href="/user/{{.Account.ID}}">
<img class="status-profile-img" src="{{.Account.Avatar}}" title="@{{.Account.Acct}}" alt="avatar" height="24" />
</a>
- <bdi class="status-dname"> {{EmojiFilter (html .Account.DisplayName) .Account.Emojis}} </bdi>
+ <bdi class="status-dname"> {{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}} </bdi>
<a href="/user/{{.Account.ID}}">
<span class="status-uname"> @{{.Account.Acct}} </span>
</a>
@@ -23,7 +23,7 @@
</div>
<div class="status">
<div class="status-name">
- <bdi class="status-dname"> {{EmojiFilter (html .Account.DisplayName) .Account.Emojis}} </bdi>
+ <bdi class="status-dname"> {{EmojiFilter (HTML .Account.DisplayName) .Account.Emojis | Raw}} </bdi>
<a href="/user/{{.Account.ID}}">
<span class="status-uname"> @{{.Account.Acct}} </span>
</a>
@@ -91,7 +91,10 @@
{{end}}
</div>
{{if (or .Content .SpoilerText)}}
- <div class="status-content"> {{StatusContentFilter (html .SpoilerText) .Content .Emojis .Mentions}} </div>
+ <div class="status-content">
+ {{if .SpoilerText}}{{EmojiFilter (HTML .SpoilerText) .Emojis | Raw}}<br/>{{end}}
+ {{StatusContentFilter .Content .Emojis .Mentions | Raw}}
+ </div>
{{end}}
{{if .MediaAttachments}}
<div class="status-media-container">
@@ -100,7 +103,7 @@
{{if eq .Type "image"}}
{{if $.Ctx.HideAttachments}}
<a href="{{.URL}}" target="_blank">
- {{if .Description}}[{{.Description}}]{{else}}[image]{{end}}
+ [image{{if $s.Sensitive}}/nsfw{{end}}{{if .Description}}: {{.Description}}{{end}}]
</a>
{{else}}
<a class="img-link" href="{{.URL}}" target="_blank" title="{{.Description}}">
@@ -114,7 +117,7 @@
{{else if eq .Type "audio"}}
{{if $.Ctx.HideAttachments}}
<a href="{{.URL}}" target="_blank">
- {{if .Description}}[{{.Description}}]{{else}}[audio]{{end}}
+ [audio{{if $s.Sensitive}}/nsfw{{end}}{{if .Description}}: {{.Description}}{{end}}]
</a>
{{else}}
<audio class="status-audio" controls title="{{.Description}}">
@@ -126,7 +129,7 @@
{{else if eq .Type "video"}}
{{if $.Ctx.HideAttachments}}
<a href="{{.URL}}" target="_blank">
- {{if .Description}}[{{.Description}}]{{else}}[video]{{end}}
+ [video{{if $s.Sensitive}}/nsfw{{end}}{{if .Description}}: {{.Description}}{{end}}]
</a>
{{else}}
<div class="status-video-container" title="{{.Description}}">
@@ -142,7 +145,7 @@
{{else}}
<a href="{{.URL}}" target="_blank">
- {{if .Description}}[{{.Description}}]{{else}}[attachment]{{end}}
+ [attachment{{if $s.Sensitive}}/nsfw{{end}}{{if .Description}}: {{.Description}}{{end}}]
</a>
{{end}}
{{end}}
@@ -156,12 +159,12 @@
{{range $i, $o := .Poll.Options}}
<div class="poll-option">
{{if (or $s.Poll.Expired $s.Poll.Voted)}}
- <div> {{EmojiFilter (html $o.Title) $s.Emojis}} - {{$o.VotesCount}} votes </div>
+ <div> {{EmojiFilter (HTML $o.Title) $s.Emojis | Raw}} - {{$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 (html $o.Title) $s.Emojis}}
+ {{EmojiFilter (HTML $o.Title) $s.Emojis | Raw}}
</label>
{{end}}
</div>
diff --git a/templates/user.tmpl b/templates/user.tmpl
index 2532a91..5342efe 100644
--- a/templates/user.tmpl
+++ b/templates/user.tmpl
@@ -11,7 +11,7 @@
</div>
<div class="user-profile-details-container">
<div>
- <bdi class="status-dname"> {{EmojiFilter (html .User.DisplayName) .User.Emojis}} </bdi>
+ <bdi class="status-dname"> {{EmojiFilter (HTML .User.DisplayName) .User.Emojis | Raw}} </bdi>
<span class="status-uname"> @{{.User.Acct}} </span>
<a class="remote-link" href="{{.User.URL}}" target="_blank" title="remote profile">
source
@@ -20,6 +20,7 @@
{{if not .IsCurrent}}
<div>
<span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span>
+ {{if .User.Pleroma.Relationship.BlockedBy}} blocks you - {{end}}
{{if .User.Pleroma.Relationship.Following}}
<form class="d-inline" action="/unfollow/{{.User.ID}}" method="post">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
@@ -129,11 +130,15 @@
</div>
</div>
<div class="user-profile-decription">
- {{EmojiFilter .User.Note .User.Emojis}}
+ {{EmojiFilter .User.Note .User.Emojis | Raw}}
</div>
- {{if .User.Fields}}{{range .User.Fields}}
- <div>{{.Name}} - {{.Value}}</div>
- {{end}}{{end}}
+ {{if .User.Fields}}
+ <div class="user-fields">
+ {{range .User.Fields}}
+ <div>{{.Name}} - {{.Value | Raw}}</div>
+ {{end}}
+ </div>
+ {{end}}
</div>
</div>
diff --git a/templates/userlist.tmpl b/templates/userlist.tmpl
index b8e0e5d..f206397 100644
--- a/templates/userlist.tmpl
+++ b/templates/userlist.tmpl
@@ -1,19 +1,7 @@
{{with .Data}}
<div>
{{range .}}
- <div class="user-list-item">
- <div class="user-list-profile-img">
- <a class="img-link" href="/user/{{.ID}}">
- <img class="status-profile-img" src="{{.Avatar}}" title="@{{.Acct}}" alt="avatar" height="48" />
- </a>
- </div>
- <div class="user-list-name">
- <div class="status-dname"> {{EmojiFilter (html .DisplayName) .Emojis}} </div>
- <a class="img-link" href="/user/{{.ID}}">
- <div class="status-uname"> @{{.Acct}} </div>
- </a>
- </div>
- </div>
+ {{template "userlistitem.tmpl" (WithContext . $.Ctx)}}
{{else}}
<div class="no-data-found">No data found</div>
{{end}}
diff --git a/templates/userlistitem.tmpl b/templates/userlistitem.tmpl
new file mode 100644
index 0000000..50b9d0c
--- /dev/null
+++ b/templates/userlistitem.tmpl
@@ -0,0 +1,15 @@
+{{with .Data}}
+<div class="user-list-item">
+ <div class="user-list-profile-img">
+ <a class="img-link" href="/user/{{.ID}}">
+ <img class="status-profile-img" src="{{.Avatar}}" title="@{{.Acct}}" alt="avatar" height="48" />
+ </a>
+ </div>
+ <div class="user-list-name">
+ <div class="status-dname"> {{EmojiFilter (HTML .DisplayName) .Emojis | Raw}} </div>
+ <a class="img-link" href="/user/{{.ID}}">
+ <div class="status-uname"> @{{.Acct}} </div>
+ </a>
+ </div>
+</div>
+{{end}}
diff --git a/templates/usersearch.tmpl b/templates/usersearch.tmpl
index e95129c..78fa7b8 100644
--- a/templates/usersearch.tmpl
+++ b/templates/usersearch.tmpl
@@ -1,11 +1,11 @@
{{with .Data}}
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
-<div class="page-title"> Search {{EmojiFilter (html .User.DisplayName) .User.Emojis}}'s statuses </div>
+<div class="page-title"> Search {{EmojiFilter (HTML .User.DisplayName) .User.Emojis | Raw}}'s statuses </div>
<form class="search-form" action="/usersearch/{{.User.ID}}" method="GET">
- <span class="post-form-field>
+ <span class="post-form-field">
<label for="query"> Query </label>
- <input id="query" name="q" value="{{.Q | html}}">
+ <input id="query" name="q" value="{{.Q}}">
</span>
<button type="submit"> Search </button>
</form>