[pull] develop from LibreBooking:develop - #594
Merged
Merged
Conversation
On phones the schedule style buttons did not match what the page actually renders. SchedulePage and ViewSchedulePage route every style except Tall to schedule-mobile.tpl, and schedule.js renders Standard as condensed week markup when isMobileView is set, so the Standard button advertised a table view the user could never get. The Wide and CondensedWeek buttons were hidden with Bootstrap's d-none/d-md-* utility classes, which keyed off viewport width rather than device, leaving them present in the DOM and reachable on phones held in landscape. Label the Standard button with the CondensedWeek icon, title and alt text when the device is a phone, so the button describes the view it produces. Replace the responsive utility classes on the Wide and CondensedWeek buttons with a server-side check on IsMobile/IsTablet, which matches how the page picks its template and keeps the buttons out of the markup entirely on phones regardless of orientation. Tablets and desktops are unaffected in what they can reach, but the Wide and CondensedWeek buttons now render at every viewport width rather than only at md and above.
Phones render schedule-mobile.tpl for every style except Tall, but the selected style was still passed to Smarty and schedule.js unchanged, so the reported style could describe a template that was never rendered. With Wide, schedule.js positions reservations using the desktop grid inside a template that has no grid. With Condensed Week it skips Standard-only layout adjustments. In both cases no style control shows as active, since neither control is in the DOM on phones. A schedule whose default style is Wide hits this on every phone visit, so no stale cookie is needed to reproduce it. Normalize any non-Tall style to Standard on phones in SetScheduleStyle(). Tall is preserved because it genuinely renders a different template, and ViewSchedulePage inherits the method, so both entry points are covered. The style cookie is left untouched so a desktop choice survives a phone visit. Add tests/Pages/SchedulePageTest.php covering all four styles across phone, tablet and desktop. Refs: #1600 Assisted-by: Claude:claude-opus-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )