tidy up event#show page, google calendar link

This commit is contained in:
Michael Ball 2020-12-09 02:46:16 -08:00
parent acfc3e7aff
commit ab3c8ff4ca
2 changed files with 24 additions and 12 deletions

View file

@ -164,7 +164,7 @@ module EventsHelper
conference_id,
event.id,
event.send(attribute),
url: admin_conference_program_event_path(
url: admin_conference_program_event_path(
conference_id,
event,
event: { attribute => nil }
@ -208,7 +208,7 @@ module EventsHelper
event_details = {
action: 'TEMPLATE',
text: "#{event.title} at #{conference.title}",
details: "#{conference.title}:\n\n#{event.room&.url}\n\n#{truncate(event.abstract, length: 200)}",
details: calendar_event_text(event, event_schedule, conference),
location: "#{event.room.name} #{event.room&.url}",
dates: "#{start_timestamp}/#{end_timestamp}",
ctz: event_schedule.timezone
@ -218,6 +218,18 @@ module EventsHelper
private
def calendar_event_text(event, event_schedue, conference)
<<~TEXT
#{conference.title} - #{event.title}
#{event_schedule.start_time.strftime("%Y %B %e - %H:%M")} #{event_schedule.timezone}
More Info: #{event.url}
Join: #{event.room&.url}
#{truncate(event.abstract, length: 200)}"
TEXT
end
def active_dropdown(selection, options)
# Consistent rendering of dropdown lists that submit patched changes
#

View file

@ -25,9 +25,9 @@
.col-md-4
%p{style: "margin-top: 20px"}
- if @event_schedule&.start_time
= link_to google_calendar_link(@event_schedule), target: '_blank', class: 'btn btn-success' do
= link_to google_calendar_link(@event_schedule), target: '_blank', class: 'btn btn-success btn-mini' do
%i.fa.fa-calendar
Google Calendar
Add to Google Calendar (beta)
- if can?(:update, @event) && @event.require_registration?
= link_to 'Registrations', registrations_conference_program_proposal_path(@conference.short_title, @event), class: 'btn btn-mini btn-success'
- if can?(:edit, @event)
@ -96,16 +96,16 @@
.col-md-12
%dt Language:
%dd= @event.language
.col-md-12
%dt Track:
%dd
- if @event.track
- if @event.track
.col-md-12
%dt Track:
%dd
%span.label{style: "background-color: #{@event.track.color}; color: #{ contrast_color(@event.track.color) }"}
= @event.track.name
.col-md-12
%dt Difficulty:
%dd
- if @event.difficulty_level
- if @event.difficulty_level
.col-md-12
%dt Difficulty:
%dd
%span.label{style: "background-color: #{@event.difficulty_level.color}; color: #{ contrast_color(@event.difficulty_level.color) };"}
= @event.difficulty_level.title