osem-fcy/app/views/conferences/_program.haml
Asish Kumar fae6332c36 Stop offering the schedule page when no schedule is published
The home and splash page render a link to the schedule based purely on
the `schedule_public` flag, even when an admin has not yet selected a
schedule or scheduled any events. Following that link rendered the
schedule view, which then failed inside `_carousel.html.haml` because
`@rooms` (and the selected schedule) had no data — a 500 error instead
of a graceful response.

Treat `schedule_public` as an allowance rather than an unchecked
control: introduce `Program#any_published_schedule?` (true only when
the flag is on *and* there is at least one event in a selected
schedule) and use it to decide whether to render the link from the
home and splash pages. The schedule controller now returns 404 when no
event has been scheduled, so bookmarked URLs surface as "not found"
instead of an internal server error.
2026-05-14 09:28:58 +05:30

38 lines
1.1 KiB
Text

= content_for :splash_nav do
%li
%a.smoothscroll{ href: '#program' } Program
- cache [conference, highlights, tracks, booths, '#splash#program'] do
%section#program
.container
.row
.col-md-12
%p.lead.text-center
%span.notranslate
= conference.title
has the most awesome program ever!
- unless highlights.blank?
= render 'highlights', conference_id: conference.short_title,
highlights: highlights
- if conference.splashpage.include_tracks
- unless tracks.blank?
= render 'tracks', tracks: tracks
- if conference.splashpage.include_booths
- unless booths.blank?
= render 'booths', booths: booths
- if conference.program&.any_published_schedule?
.row
.col-md-12
%p.cta-button.text-center
= link_to(conference_schedule_path(conference.short_title),
class: 'btn btn-success btn-lg') do
Full Schedule
- unless booths.blank?
- booths.each do |booth|
- content_for :modals do
= render 'modal_description', object: booth