diff options
author | r <r@freesoftwareextremist.com> | 2024-02-12 06:44:32 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2024-02-12 06:44:32 +0000 |
commit | 6ddec8db3ee73d3abdc85b6a2101020cf2455bce (patch) | |
tree | 3eb09979df47a3dd33b7d2903ed687db7254c2c1 | |
parent | 6ad1c5436ae4b623143db9def4b160213456a69e (diff) | |
download | bloat-6ddec8db3ee73d3abdc85b6a2101020cf2455bce.tar.gz bloat-6ddec8db3ee73d3abdc85b6a2101020cf2455bce.zip |
Update page titles
- Use consistent letter casing
- Append instance domain to the title
-rw-r--r-- | renderer/model.go | 2 | ||||
-rw-r--r-- | service/service.go | 41 | ||||
-rw-r--r-- | templates/about.tmpl | 2 | ||||
-rw-r--r-- | templates/filters.tmpl | 2 | ||||
-rw-r--r-- | templates/list.tmpl | 2 | ||||
-rw-r--r-- | templates/lists.tmpl | 2 | ||||
-rw-r--r-- | templates/root.tmpl | 2 | ||||
-rw-r--r-- | templates/signin.tmpl | 2 | ||||
-rw-r--r-- | templates/user.tmpl | 4 |
9 files changed, 33 insertions, 26 deletions
diff --git a/renderer/model.go b/renderer/model.go index 59b0059..3862976 100644 --- a/renderer/model.go +++ b/renderer/model.go @@ -49,7 +49,7 @@ type SigninData struct { } type RootData struct { - Title string + *CommonData } type TimelineData struct { diff --git a/service/service.go b/service/service.go index 0245042..24e3f85 100644 --- a/service/service.go +++ b/service/service.go @@ -47,8 +47,13 @@ func NewService(cname string, cscope string, cwebsite string, func (s *service) cdata(c *client, title string, count int, rinterval int, target string) (data *renderer.CommonData) { + if title == "" { + title = s.cname + } else { + title += " - " + s.cname + } data = &renderer.CommonData{ - Title: title + " - " + s.cname, + Title: title, CustomCSS: s.css, Count: count, RefreshInterval: rinterval, @@ -56,6 +61,7 @@ func (s *service) cdata(c *client, title string, count int, rinterval int, } if c != nil && c.s.IsLoggedIn() { data.CSRFToken = c.s.CSRFToken + data.Title += " - " + c.s.Instance } return } @@ -81,7 +87,7 @@ func (s *service) ErrorPage(c *client, err error, retry bool) error { } func (s *service) SigninPage(c *client) (err error) { - cdata := s.cdata(nil, "signin", 0, 0, "") + cdata := s.cdata(nil, "Signin", 0, 0, "") data := &renderer.SigninData{ CommonData: cdata, } @@ -89,8 +95,9 @@ func (s *service) SigninPage(c *client) (err error) { } func (s *service) RootPage(c *client) (err error) { + cdata := s.cdata(c, "", 0, 0, "") data := &renderer.RootData{ - Title: s.cname, + CommonData: cdata, } return s.renderer.Render(c.rctx, c.w, renderer.RootPage, data) } @@ -105,7 +112,7 @@ func (s *service) NavPage(c *client) (err error) { DefaultFormat: c.s.Settings.DefaultFormat, Formats: s.postFormats, } - cdata := s.cdata(c, "nav", 0, 0, "main") + cdata := s.cdata(c, "Nav", 0, 0, "main") data := &renderer.NavData{ User: u, CommonData: cdata, @@ -202,7 +209,7 @@ func (s *service) TimelinePage(c *client, tType, instance, listId, maxID, nextLink = "/timeline/" + tType + "?" + v.Encode() } - cdata := s.cdata(c, tType+" timeline ", 0, 0, "") + cdata := s.cdata(c, title, 0, 0, "") data := &renderer.TimelineData{ Title: title, Type: tType, @@ -355,7 +362,7 @@ func (s *service) ThreadPage(c *client, id string, reply bool) (err error) { addToReplyMap(replies, statuses[i].InReplyToID, statuses[i].ID, i+1) } - cdata := s.cdata(c, "post by "+status.Account.DisplayName, 0, 0, "") + cdata := s.cdata(c, "Post by "+status.Account.DisplayName, 0, 0, "") data := &renderer.ThreadData{ Statuses: statuses, PostContext: pctx, @@ -411,7 +418,7 @@ func (s *service) QuickReplyPage(c *client, id string) (err error) { }, } - cdata := s.cdata(c, "post by "+status.Account.DisplayName, 0, 0, "") + cdata := s.cdata(c, "Post by "+status.Account.DisplayName, 0, 0, "") data := &renderer.QuickReplyData{ Ancestor: ancestor, Status: status, @@ -426,7 +433,7 @@ func (s *service) LikedByPage(c *client, id string) (err error) { if err != nil { return } - cdata := s.cdata(c, "likes", 0, 0, "") + cdata := s.cdata(c, "Likes", 0, 0, "") data := &renderer.LikedByData{ CommonData: cdata, Users: likers, @@ -439,7 +446,7 @@ func (s *service) RetweetedByPage(c *client, id string) (err error) { if err != nil { return } - cdata := s.cdata(c, "retweets", 0, 0, "") + cdata := s.cdata(c, "Retweets", 0, 0, "") data := &renderer.RetweetedByData{ CommonData: cdata, Users: retweeters, @@ -488,7 +495,7 @@ func (s *service) NotificationPage(c *client, maxID string, nextLink = "/notifications?max_id=" + pg.MaxID } - cdata := s.cdata(c, "notifications", unreadCount, + cdata := s.cdata(c, "Notifications", unreadCount, c.s.Settings.NotificationInterval, "main") data := &renderer.NotificationData{ Notifications: notifications, @@ -648,7 +655,7 @@ func (s *service) UserSearchPage(c *client, id string, q string, offset int) (err error) { var nextLink string - var title = "search" + var title = "Search" user, err := c.GetAccount(c.ctx, id) if err != nil { @@ -700,7 +707,7 @@ func (s *service) MutePage(c *client, id string) (err error) { } func (s *service) AboutPage(c *client) (err error) { - cdata := s.cdata(c, "about", 0, 0, "") + cdata := s.cdata(c, "About", 0, 0, "") data := &renderer.AboutData{ CommonData: cdata, } @@ -712,7 +719,7 @@ func (s *service) EmojiPage(c *client) (err error) { if err != nil { return } - cdata := s.cdata(c, "emojis", 0, 0, "") + cdata := s.cdata(c, "Emojis", 0, 0, "") data := &renderer.EmojiData{ Emojis: emojis, CommonData: cdata, @@ -724,7 +731,7 @@ func (s *service) SearchPage(c *client, q string, qType string, offset int) (err error) { var nextLink string - var title = "search" + var title = "Search" var results *mastodon.Results if len(q) > 0 { @@ -760,7 +767,7 @@ func (s *service) SearchPage(c *client, } func (s *service) SettingsPage(c *client) (err error) { - cdata := s.cdata(c, "settings", 0, 0, "") + cdata := s.cdata(c, "Settings", 0, 0, "") data := &renderer.SettingsData{ CommonData: cdata, Settings: &c.s.Settings, @@ -774,7 +781,7 @@ func (svc *service) FiltersPage(c *client) (err error) { if err != nil { return } - cdata := svc.cdata(c, "filters", 0, 0, "") + cdata := svc.cdata(c, "Filters", 0, 0, "") data := &renderer.FiltersData{ CommonData: cdata, Filters: filters, @@ -795,7 +802,7 @@ func (svc *service) ProfilePage(c *client) (err error) { for len(*u.Source.Fields) < 4 { *u.Source.Fields = append(*u.Source.Fields, mastodon.Field{}) } - cdata := svc.cdata(c, "edit profile", 0, 0, "") + cdata := svc.cdata(c, "Edit profile", 0, 0, "") data := &renderer.ProfileData{ CommonData: cdata, User: u, diff --git a/templates/about.tmpl b/templates/about.tmpl index c6129f9..580c68d 100644 --- a/templates/about.tmpl +++ b/templates/about.tmpl @@ -14,7 +14,7 @@ </P> </div> -<h1>Keyboard shortcuts</h1> +<h1>Keyboard Shortcuts</h1> <div> <table class="keyboard-shortcuts"> <tr> diff --git a/templates/filters.tmpl b/templates/filters.tmpl index 8bdae41..383a0ad 100644 --- a/templates/filters.tmpl +++ b/templates/filters.tmpl @@ -21,7 +21,7 @@ <p> No filters added </p> {{end}} -<h1>Add filter</h1> +<h1>Add Filter</h1> <form action="/filter" method="POST"> <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> diff --git a/templates/list.tmpl b/templates/list.tmpl index ad2e538..6fa2830 100644 --- a/templates/list.tmpl +++ b/templates/list.tmpl @@ -31,7 +31,7 @@ <p>No data found</p> {{end}} -<h1>Add user</h1> +<h1>Add User</h1> <form action="/list/{{.List.ID}}" method="GET"> <div class="form-field"> <label for="query"> Query </label> diff --git a/templates/lists.tmpl b/templates/lists.tmpl index 98cdb78..59c53fe 100644 --- a/templates/lists.tmpl +++ b/templates/lists.tmpl @@ -26,7 +26,7 @@ <p>No lists added</p> {{end}} -<h1>Add list</h1> +<h1>Add List</h1> <form action="/list" method="POST"> <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> diff --git a/templates/root.tmpl b/templates/root.tmpl index 0fde835..b04638b 100644 --- a/templates/root.tmpl +++ b/templates/root.tmpl @@ -5,7 +5,7 @@ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <link rel="icon" type="image/png" href="/static/favicon.png"> <link rel="stylesheet" href="/static/style.css"> - <title>{{.Title}}</title> + <title>{{.CommonData.Title}}</title> </head> <frameset cols="424px,*"> <frameset rows="316px,*"> diff --git a/templates/signin.tmpl b/templates/signin.tmpl index b12e0aa..2c97de2 100644 --- a/templates/signin.tmpl +++ b/templates/signin.tmpl @@ -1,7 +1,7 @@ {{with .Data}} {{template "header.tmpl" (WithContext .CommonData $.Ctx)}} -<h1>Bloat</h1> +<h1>bloat</h1> <p>A web client for <a href="https://pleroma.social" target="_blank">Mastadon Network</a>.</p> <form action="/signin" method="post"> <div class="form-field-s"> diff --git a/templates/user.tmpl b/templates/user.tmpl index 4323b2f..b279e15 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -149,7 +149,7 @@ {{template "userlistfollow.tmpl" (WithContext .Users $.Ctx)}} {{else if eq .Type "media"}} -<h1>Statuses with media</h1> +<h1>Statuses With Media</h1> {{range .Statuses}} {{template "status.tmpl" (WithContext . $.Ctx)}} {{else}} @@ -215,7 +215,7 @@ {{end}} {{else if eq .Type "requests"}} -<h1>Follow requests</h1> +<h1>Follow Requests</h1> {{template "requestlist.tmpl" (WithContext .Users $.Ctx)}} {{end}} |