mirror of
https://git.freesoftwareextremist.com/bloat
synced 2024-12-22 09:10:42 +00:00
Make refresh button point to the first page on timeline
This commit is contained in:
parent
df77ca0226
commit
ce1680dfd0
3 changed files with 19 additions and 14 deletions
|
@ -54,12 +54,13 @@ type RootData struct {
|
|||
|
||||
type TimelineData struct {
|
||||
*CommonData
|
||||
Title string
|
||||
Type string
|
||||
Instance string
|
||||
Statuses []*mastodon.Status
|
||||
NextLink string
|
||||
PrevLink string
|
||||
Title string
|
||||
Type string
|
||||
Instance string
|
||||
Statuses []*mastodon.Status
|
||||
NextLink string
|
||||
PrevLink string
|
||||
RefreshLink string
|
||||
}
|
||||
|
||||
type ListsData struct {
|
||||
|
|
|
@ -131,6 +131,7 @@ func (s *service) TimelinePage(c *client, tType, instance, listId, maxID,
|
|||
MinID: minID,
|
||||
Limit: 20,
|
||||
}
|
||||
var refreshLink = "/timeline/" + tType
|
||||
|
||||
switch tType {
|
||||
default:
|
||||
|
@ -159,6 +160,7 @@ func (s *service) TimelinePage(c *client, tType, instance, listId, maxID,
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
refreshLink += "?instance=" + instance
|
||||
}
|
||||
title = "Remote Timeline"
|
||||
case "twkn":
|
||||
|
@ -177,6 +179,7 @@ func (s *service) TimelinePage(c *client, tType, instance, listId, maxID,
|
|||
return err
|
||||
}
|
||||
title = "List Timeline - " + list.Title
|
||||
refreshLink += "?list=" + listId
|
||||
}
|
||||
|
||||
for i := range statuses {
|
||||
|
@ -211,13 +214,14 @@ func (s *service) TimelinePage(c *client, tType, instance, listId, maxID,
|
|||
|
||||
cdata := s.cdata(c, title, 0, 0, "")
|
||||
data := &renderer.TimelineData{
|
||||
Title: title,
|
||||
Type: tType,
|
||||
Instance: instance,
|
||||
Statuses: statuses,
|
||||
NextLink: nextLink,
|
||||
PrevLink: prevLink,
|
||||
CommonData: cdata,
|
||||
Title: title,
|
||||
Type: tType,
|
||||
Instance: instance,
|
||||
Statuses: statuses,
|
||||
NextLink: nextLink,
|
||||
PrevLink: prevLink,
|
||||
RefreshLink: refreshLink,
|
||||
CommonData: cdata,
|
||||
}
|
||||
return s.renderer.Render(c.rctx, c.w, renderer.TimelinePage, data)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{with .Data}}
|
||||
{{template "header.tmpl" (WithContext .CommonData $.Ctx)}}
|
||||
<h1>{{.Title}} <a class="page-link" href="{{$.Ctx.Referrer}}" accesskey="T" title="Refresh (T)">refresh</a></h1>
|
||||
<h1>{{.Title}} <a class="page-link" href="{{.RefreshLink}}" accesskey="T" title="Refresh (T)">refresh</a></h1>
|
||||
|
||||
{{if eq .Type "remote"}}
|
||||
<form action="/timeline/remote" method="GET">
|
||||
|
|
Loading…
Reference in a new issue