~emersion/alps-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] caldav: add page titles to all routes

Details
Message ID
<20200520174754.113745-1-sir@cmpwn.com>
DKIM signature
pass
Download raw message
Patch: +7 -3
---
 plugins/caldav/routes.go | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/plugins/caldav/routes.go b/plugins/caldav/routes.go
index fd3b219..e9ba789 100644
--- a/plugins/caldav/routes.go
+++ b/plugins/caldav/routes.go
@@ -139,7 +139,8 @@ func registerRoutes(p *alps.GoPlugin, u *url.URL) {
		}

		return ctx.Render(http.StatusOK, "calendar.html", &CalendarRenderData{
			BaseRenderData: *alps.NewBaseRenderData(ctx),
			BaseRenderData: *alps.NewBaseRenderData(ctx).
				WithTitle(calendar.Name + " Calendar: " + start.Format("January 2006")),
			Time:           start,
			Now:            time.Now(), // TODO: Use client time zone
			Calendar:       calendar,
@@ -219,9 +220,10 @@ func registerRoutes(p *alps.GoPlugin, u *url.URL) {
			return fmt.Errorf("expected exactly one calendar object with path %q, got %v", path, len(events))
		}
		event := &events[0]
		summary, _ := event.Data.Events()[0].Props.Text("SUMMARY")

		return ctx.Render(http.StatusOK, "event.html", &EventRenderData{
			BaseRenderData: *alps.NewBaseRenderData(ctx),
			BaseRenderData: *alps.NewBaseRenderData(ctx).WithTitle(summary),
			Calendar:       calendar,
			Event:          CalendarObject{event},
		})
@@ -312,8 +314,10 @@ func registerRoutes(p *alps.GoPlugin, u *url.URL) {
			return ctx.Redirect(http.StatusFound, CalendarObject{co}.URL())
		}

		summary, _ := event.Props.Text("SUMMARY")

		return ctx.Render(http.StatusOK, "update-event.html", &UpdateEventRenderData{
			BaseRenderData: *alps.NewBaseRenderData(ctx),
			BaseRenderData: *alps.NewBaseRenderData(ctx).WithTitle("Update " + summary),
			Calendar:       calendar,
			CalendarObject: co,
			Event:          event,
-- 
2.26.2
Details
Message ID
<N_Le_9p4sPuhZjGLpe3NIXMt-8u9LUjG3tSaWkhbaftKIACibFn1p-p1QfNcGG8lif2R4tRfYSR5_y06xvPD2yjEoY3sSuKAOHjMKqATYjc=@emersion.fr>
In-Reply-To
<20200520174754.113745-1-sir@cmpwn.com> (view parent)
DKIM signature
pass
Download raw message
Pushed, thanks!
Reply to thread Export thread (mbox)