Schedules!

This commit is contained in:
Godwin
2015-09-26 20:05:55 -07:00
parent 34e72144cc
commit bc80c09938
82 changed files with 1669 additions and 268 deletions
+36
View File
@@ -0,0 +1,36 @@
.programme
- schedule.each do |day, day_schedule|
.programme-day
%h2=I18n.l(conference.start_date + (day - 1).days, :format => "%A")
- (0...day_parts.length).each do |day_part|
.programme-day-part
- times = schedule_start_and_end_times(day_part, day_parts, day_schedule)
- if times.present?
%h3=_"articles.headings.schedule.day_parts.#{day_parts.keys[day_part].to_s}" if day_parts.length > 1
%table.schedule
%tr
%th
- (times.first...times.last).step(0.5).each do |t|
- t = t.to_i if t == t.to_i
%th=I18n.l(Date.today + t.hours, :format => :short)
- day_schedule[:locations].each do |location, location_schedule|
%tr
%th=locations[location.to_s].title
- skip = 0
- (times.first...times.last).step(0.5).each do |t|
- t = t.to_i if t == t.to_i
- if location_schedule[t].present?
- workshop = location_schedule[t]
- w = get_workshop(workshop, workshops, events)
%td{:class => workshop_classes(w, show_interest) + [show_previews && workshop[:type] == :workshop ? 'previewable' : nil], :colspan => (workshop[:span] * 2), :id => "workshop-#{w.id}"}
.title= w.title
- if show_previews && workshop[:type] == :workshop
.info
%a.close{href: "#!"}
= render 'workshops/show', :workshop => w, :preview => true
%a{class: 'preview', href: "#workshop-#{w.id}"}
- skip = workshop[:span] - 0.5
- elsif skip > 0
- skip -= 0.5
- else
%td.empty
+77
View File
@@ -0,0 +1,77 @@
= render 'conferences/page_header', :page_key => 'Edit_Schedule'
%article
= form_tag save_schedule_path(@this_conference.slug), class: 'composition' do
= row do
= columns(medium: 12) do
= render 'schedule/programme', :schedule => @schedule, :conference => @this_conference, :workshops => @workshops, :events => @events, :locations => @location_hash, :show_interest => false, :day_parts => @day_parts, :show_previews => false
= row do
= columns(medium: 12) do
- if @error_count && @error_count > 0
%h3.errors
=_'errors.schedule.errors',"Errors:"
= @error_count
- if @conflict_score && @conflict_score > 0
%h3.conflict-score
=_'errors.schedule.conflict_score',"Interest Conflicts:"
= @conflict_score
= row do
= columns(medium: 12) do
= (hidden_field_tag :location_id, @location.id) if @location
.actions
- if @this_conference.workshop_schedule_published
= button_tag :Unpublish, :value => :unpublish, :class => 'delete'
- elsif @error_count < 1
= button_tag :Publish, :value => :publish
= button_tag :Preview, :value => :preview, :class => 'secondary'
- unless @this_conference.workshop_schedule_published && @error_count > 0
= button_tag :save, :value => :save
- unless @saved
.unsaved=_'errors.schedule.unsaved','Your changes will not be saved until you press Save or Publish'
= row do
= columns(medium: 6) do
%h2=_"articles.headings.schedule.day_parts.Workshops"
%ul.all-workshops
- @workshops.each do |i|
- error = @errors["w#{i.id}"]
- warnings = @warnings["w#{i.id}"]
%li{class: error.present? ? :error : nil}
%h3=i.title
.workshop-interest=_'articles.workshops.info.interested_count', "#{i.interested_count} people are interested in this workshop", :vars => {:count => i.interested_count}
.time
= select_tag "workshop_day[#{i.id}]", options_for_select(@days, i.conference_day), :include_blank => true
= select_tag "workshop_hour[#{i.id}]", options_for_select(@hours, i.start_time ? i.start_time.strftime('%R') : nil), :include_blank => true
= select_tag "workshop_duration[#{i.id}]", options_for_select(@workshop_durations, i.duration || 60)
.location
= select_tag "workshop_location[#{i.id}]", options_from_collection_for_select(@locations, :id, :title, i.event_location_id), :include_blank => true
- if warnings
%ul.warnings
- warnings.each do |warning|
%li=warning
- if error
.error-description=error
= columns(medium: 6) do
%h2=_"articles.headings.schedule.day_parts.Events"
%ul.all-events
- @events.each do |i|
- error = @errors["e#{i.id}"]
%li{:class => [i.event_type, error.present? ? :error : nil]}
%h3=i.title
.time
= select_tag "event_day[#{i.id}]", options_for_select(@days, i.conference_day)
= select_tag "event_hour[#{i.id}]", options_for_select(@hours, i.start_time ? i.start_time.strftime('%R') : '12:00')
= select_tag "event_duration[#{i.id}]", options_for_select(@event_durations, i.duration || 60)
.location
= select_tag "event_location[#{i.id}]", options_from_collection_for_select(@locations, :id, :title, i.event_location_id), :include_blank => true
- if error
.error-description=error
%h2=_"articles.headings.schedule.day_parts.Day_Parts"
%ul.day_parts
- [:morning, :afternoon, :evening].each do |day_part|
%li
%h4
=_"articles.headings.schedule.day_parts.#{day_part.to_s}"
- h = (Date.today + @day_parts[day_part.to_s].to_f.hours).strftime('%R')
- if day_part == :morning
.select=h
- else
= select_tag "day_parts[#{day_part.to_s}]", options_for_select(@hours, h)
+28
View File
@@ -0,0 +1,28 @@
= render 'conferences/page_header', :page_key => 'Schedule'
%article
- if @this_conference.host?(current_user)
= row do
= columns(medium: 12) do
.actions.left
= link_to (_'actions.schedule.edit','Edit Schedule'), edit_schedule_path(@this_conference.slug), class: [:button]
= row do
= columns(medium: 6) do
%h2=_'articles.schedule.headings.Events'
- if @events
%ul
- @events.each do |event|
%li
%h3=_!event.title
= link_to (_'actions.events.edit','Edit'), edit_event_path(@this_conference.slug, event.id), class: [:button, :modify]
.actions.left
= link_to (_'actions.events.create','Add Event'), add_event_path(@this_conference.slug), class: [:button, :modify]
= columns(medium: 6) do
%h2=_'articles.schedule.headings.Locations'
- if @locations
%ul
- @locations.each do |location|
%li
%h3=_!location.title
= link_to (_'actions.locations.edit','Edit'), edit_location_path(@this_conference.slug, location.id), class: [:button, :modify]
.actions.left
= link_to (_'actions.schedule.edit','Add Location'), add_location_path(@this_conference.slug), class: [:button, :modify]