Skip to content

Commit

Permalink
Show different color for current instrument in shared calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinco committed Feb 27, 2025
1 parent 8fc701a commit bf4d462
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/calendar/fullcalendar.extensions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
color: #fff;
}

.fc-event.other-instrument {
background: #e29a78;
}

.fc-event.current-event {
background: #378006;
}
Expand Down
8 changes: 7 additions & 1 deletion app/presenters/calendar_events_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ def unavailable_events

def reservation_events
reservations.map do |reservation|
reservation.as_calendar_object(calendar_opts)
event_data = reservation.as_calendar_object(calendar_opts)

if params[:with_details] && reservation.product_id != instrument.id
event_data[:className] = "other-instrument"
end

event_data
end
end

Expand Down

0 comments on commit bf4d462

Please sign in to comment.