Makespace / members-app

Simplifying operations for Cambridge MakeSpace
MIT License
1 stars 1 forks source link

DO NOT MERGE: pageTemplate for forms question #22

Open chromy opened 3 weeks ago

chromy commented 3 weeks ago

I was looking into converting the 'commands' pages (formGet) to use pageTemplate as done already by queryGet. This avoids every route having to apply the template itself.

I think I found the place where pageTemplate ought to be added. However I don't understand what the idiomatic way to thread a variable from earlier in the pipe is. @Lan2u @erkannt: any advice you have appreciated! XD

erkannt commented 3 weeks ago

Ah yes. That is always a fun one. Haven't found the solution. Depending on the surrounding context and what feels nice I'd go for one of three options:

Pragmatically I'd probably go for the first option. Zooming out I am wondering whether pageTemplate should even require a User. It is only used to toggle log-in/log-out in the navbar, however all of our pages apart from the log-in require the user to be logged in. At this point I'd suggest ripping out the requirement for User in the pageTemplate and that should remove the issue you encountered.