Merge pull request #54 from snap-cloud/track-tweaks

Improve Some Tracks Display, Fix Some VolunteersDisplays
This commit is contained in:
Michael Ball 2020-07-27 00:31:54 -07:00 committed by GitHub
commit 6c56f45387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 19 deletions

View file

@ -180,7 +180,7 @@ module Admin
:track_id, :state, :language, :is_highlight, :max_attendees,
# Not used anymore?
:proposal_additional_speakers, :user, :users_attributes,
speaker_ids: [])
speaker_ids: [], volunteer_ids: [])
end
def comment_params

View file

@ -126,7 +126,7 @@ module ApplicationHelper
def volunteer_links(event)
safe_join(event.volunteers.map do |volunteer|
link_to(volunteer.name, admin_user_path(volunteer))
end, ',')
end, ', ')
end
def volunteer_selector_input(form)

View file

@ -259,7 +259,7 @@ class User < ApplicationRecord
# TODO: Use a real authorization in the right place....
def manages_volunteers?(conference)
organizer_roles = get_roles['organizer']
organizer_roles&.include?(conference.short_title) # TODO or Volunteer Coorinator.
organizer_roles&.include?(conference.short_title) # TODO or Volunteer Coorinator.
end
def registered

View file

@ -85,6 +85,11 @@
(
= link_to speaker.email, "mailto: #{speaker.email}"
)
%tr
%td
%b Volunteers
%td
= volunteer_links(@event)
%tr
%td
%b Biographies

View file

@ -6,5 +6,5 @@
.row
.col-md-12
= semantic_form_for @schedule, url: admin_conference_schedules_path(@conference.short_title) do |f|
= f.input :track, collection: Track.accessible_by(current_ability).where(program: @program).self_organized.confirmed.pluck(:name, :id), include_blank: false
= f.input :track, collection: Track.accessible_by(current_ability).where(program: @program), include_blank: false
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -70,9 +70,6 @@
%span{ title: event.state.humanize, class: "fa #{status_icon(event)}" }
%td.col-md-7{style: "padding:20px 8px 20px 8px;"}
- if event.volunteers.include?(current_user)
%strong You are volunteer host for:
%br
= link_to event.title, conference_program_proposal_path(@conference.short_title, event.id)
%br
%small.text-muted
@ -117,12 +114,15 @@
= link_to 'Edit', edit_conference_program_proposal_path(@conference.short_title, event.id),
class: 'btn btn-default', id: "edit_proposal_#{event.id}"
- if @volunteer_events.any?
%h2
Volunteer Events
%small
Thanks for being a host at #{@conference.title}
= render 'volunteers_table', events: @volunteer_events
- if @volunteer_events.any?
.row
.col-md-12
%h2
Volunteer Duties
%small
Thanks for being a host at #{@conference.title}
= render 'volunteers_table', events: @volunteer_events
.row
.col-md-12
- if can? :create, @event

View file

@ -1,19 +1,22 @@
.panel.panel-default.event-panel{ onClick: 'eventClicked(event, this);', "data-url" => "#{url_for(conference_program_proposal_path(@conference.short_title, event.id))}" }
.panel-body
- header_color = event.track&.color || '#f5f5f5'
.trapezoid{style: "color: white; top: 12px; z-index: 100;"}
.panel-heading{ style: "background-color: #{header_color}; color: #{ contrast_color(header_color) }; border-radius: 4px" }
- event.speakers_ordered.each do |speaker|
= image_tag speaker.profile_picture, :class => "img-circle pull-right all-speaker-pic", |
:alt => speaker.name, |
:title => speaker.name |
= image_tag speaker.profile_picture, class: "img-circle pull-right", alt: speaker.name, style: "padding: 2px;"
%p
= canceled_replacement_event_label(event, event_schedule)
= replacement_event_notice(event_schedule)
%span.h3
%span.h3{style: "margin-bottom: 14px"}
= event.title
%br
%small
%small{style: "color: #{contrast_color(header_color)}"}
= event.subtitle
.trapezoid{style: "color: #{header_color}; top: 12px;"}
.panel-body
%h4
- if(event.speakers.any?)
presented by #{event.speaker_names}

View file

@ -45,3 +45,7 @@
Relevance
%dd
= markdown(@track.relevance)
.row
- @track.events.each do |event|
= render 'schedules/event', event: event, event_schedule: event.event_schedules.first