Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide print cal #759

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Hide print cal #759

wants to merge 2 commits into from

Conversation

ionous
Copy link
Contributor

@ionous ionous commented Jun 25, 2024

in the same spirit as #753, simplify the edit form by hiding the print calendar ( based on site configuration. )

  • .Site.Params.pedalp.enablePrintCal can be toggled true/false in the config.toml ( in the pr, it is set to false )
  • edit.html hides the print fields in that case
  • the validator doesn't write the fields into the "values" object unless "tinytitle" is in the input data, that way -- in calEvent.js updateFromJSON() the Object.assign() won't overwrite the existing values

ionous added 2 commits June 24, 2024 19:07
1. ical feed was giving trailing line whitespace for words, but the tests were never updated
2. on my new machine i was getting EPIPE errors on some of the test runs; reading the file first seems to fix things? ( maybe just slows things down enough for pipes to be happy? )
- .Site.Params.pedalp.enablePrintCal can be toggled int the config.toml
- edit.html hides the print fields in that case
- the validator doesn't write the fields into the "values" object unless "tinytitle" is in the input data, that way -- in calEvent.js updateFromJSON() the `Object.assign()` won't overwrite the existing values
@carrythebanner
Copy link
Collaborator

One wrinkle is that we currently use the tinytitle value in the grid view:

title: (eventData.tinytitle ? eventData.tinytitle : eventData.title),

title: (eventData.tinytitle ? eventData.tinytitle : eventData.title),

If tinytitle isn't set we just show as much of the regular title as we can. A lot of people don't actually customize the tiny title anyway, but for the folks who do it can help to make it more readable in the grid. If we don't show the print fields, all rides will just get the truncated title. Not the worst, but a good tinytitle can make it a lot more readable.

Examples:

https://www.shift2bikes.org/calendar/event-19034

  • title: The Magical Armchair: A Ben Folds Five Ride!
  • tinytitle: Ben Folds Five Ride
  • auto-truncated title: The Magical Armchair: A

https://www.shift2bikes.org/calendar/event-19302

  • title: 4 Quadrant CANDIDATE Splash Ride - District 1
  • tinytitle: 4Q CANDIDATE Splash D1
  • auto-truncated title: 4 Quadrant CANDIDATE Spl

(For the 2nd one, that there are 4 similar rides, 1 from each district. With the auto-truncated title, they all have the same short title.)

@ionous
Copy link
Contributor Author

ionous commented Jun 28, 2024

that's a good catch.
i can look at tweaking the pr to handle that.

a couple related thoughts:

  • i wonder if we should change the user facing name and description of that field to make it more obvious what it does?
  • we could probably use a better word breaking algorithm for generating that auto title. ( if we knew which were auto-generated, we might be able to try css word-break properties.... )
  • i might check the ical feed to see what those titles look like. maybe tiny might be better?

@carrythebanner
Copy link
Collaborator

carrythebanner commented Jun 28, 2024

Yeah, agreed that we've sort of muddied up the meaning of both "print" fields. We also use printdescr (when populated) for social media rich previews:

https://github.com/shift-org/shift-docs/blob/main/site/themes/s2b_hugo_theme/static/js/cal/main.js#L68

(See also #576)

@ionous ionous marked this pull request as draft July 10, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants