aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-09-27 09:29:17 +0000
committerr <r@freesoftwareextremist.com>2020-09-27 09:37:15 +0000
commitda22d19fb45b5504f4191ad06d4e7637bfbc3916 (patch)
tree73a44f90ec525caddfe3d01caf688a1b4afdc4af /templates
parent0b8c41ca7c99f6ab31a3769b16c760fd028f7c2b (diff)
downloadbloat-da22d19fb45b5504f4191ad06d4e7637bfbc3916.tar.gz
bloat-da22d19fb45b5504f4191ad06d4e7637bfbc3916.zip
Add bookmarks
- Add bookmark/unbookmark link on mouse hover - Add bookmarks section on user profile page
Diffstat (limited to 'templates')
-rw-r--r--templates/status.tmpl13
-rw-r--r--templates/user.tmpl17
2 files changed, 30 insertions, 0 deletions
diff --git a/templates/status.tmpl b/templates/status.tmpl
index 1e3d514..6c255a0 100644
--- a/templates/status.tmpl
+++ b/templates/status.tmpl
@@ -46,6 +46,19 @@
<input type="submit" value="mute" class="btn-link more-link">
</form>
{{end}}
+ {{if .Bookmarked}}
+ <form action="/unbookmark/{{.ID}}" method="post" target="_self">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
+ <input type="submit" value="unbookmark" class="btn-link more-link">
+ </form>
+ {{else}}
+ <form action="/bookmark/{{.ID}}" method="post" target="_self">
+ <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
+ <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
+ <input type="submit" value="bookmark" class="btn-link more-link">
+ </form>
+ {{end}}
{{if eq $.Ctx.UserID .Account.ID}}
<form action="/delete/{{.ID}}" method="post" target="_self">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
diff --git a/templates/user.tmpl b/templates/user.tmpl
index cb21b8a..3bb7523 100644
--- a/templates/user.tmpl
+++ b/templates/user.tmpl
@@ -97,6 +97,11 @@
<a href="/user/{{.User.ID}}/followers"> followers ({{.User.FollowersCount}}) </a> -
<a href="/user/{{.User.ID}}/media"> media </a>
</div>
+ {{if .IsCurrent}}
+ <div>
+ <a href="/user/{{.User.ID}}/bookmarks"> bookmarks </a>
+ </div>
+ {{end}}
<div>
<a href="/usersearch/{{.User.ID}}"> search statuses </a>
</div>
@@ -111,6 +116,8 @@
<div class="page-title"> Statuses </div>
{{range .Statuses}}
{{template "status.tmpl" (WithContext . $.Ctx)}}
+{{else}}
+<div class="no-data-found">No data found</div>
{{end}}
{{else if eq .Type "following"}}
@@ -125,6 +132,16 @@
<div class="page-title"> Statuses with media </div>
{{range .Statuses}}
{{template "status.tmpl" (WithContext . $.Ctx)}}
+{{else}}
+<div class="no-data-found">No data found</div>
+{{end}}
+
+{{else if eq .Type "bookmarks"}}
+<div class="page-title"> Bookmarks </div>
+{{range .Statuses}}
+{{template "status.tmpl" (WithContext . $.Ctx)}}
+{{else}}
+<div class="no-data-found">No data found</div>
{{end}}
{{end}}