Home page schedule, publish and unpublish schedule, extended user data in housing

This commit is contained in:
Godwin
2016-07-17 20:04:15 -07:00
parent c474d0be1a
commit e9d9962d9a
15 changed files with 826 additions and 620 deletions
+7 -7
View File
@@ -6,11 +6,11 @@
= columns(medium: 10, push: {medium: 1}) do
%h2=_!@conference.title
= @conference.info.html_safe
- if @conference.workshops
- if @schedule
%h3=_'articles.workshops.headings.Schedule'
= render 'schedule/programme', :schedule => @schedule, :conference => @conference, :workshops => @workshops, :events => @events, :locations => @locations, :show_interest => true, :day_parts => @day_parts, :show_previews => true
- if @conference.registration_status == :open
%h3=_'articles.workshops.headings.Proposed_Workshops'
%p=_'articles.workshops.paragraphs.Proposed_Workshops'
= render 'workshops/workshop_previews', :workshops => @conference.workshops
- if @conference.workshop_schedule_published
%h3=_'articles.workshops.headings.Schedule'
= render 'conferences/admin/schedule'
- else
%h3=_'articles.workshops.headings.Proposed_Workshops'
%p=_'articles.workshops.paragraphs.Proposed_Workshops'
= render 'workshops/workshop_previews', :workshops => @conference.workshops
+1 -1
View File
@@ -10,7 +10,7 @@
= selectfield :departure, @registration.departure || @this_conference.start_date, conference_days_options_list(:after)
= radiobuttons :bike, ConferenceRegistration.all_bike_options, @registration.bike, 'articles.conference_registration.questions.bike', heading: 'articles.conference_registration.headings.bike', inline: true, big: true
= radiobuttons :food, ConferenceRegistration.all_food_options, @registration.food, 'articles.conference_registration.questions.food', heading: 'articles.conference_registration.headings.food', inline: true, big: true
= emailfield :companion, (@registration.housing_data[:companions] || [nil]).first, heading: 'articles.conference_registration.headings.companion', help: 'articles.conference_registration.paragraphs.companion', big: true
= emailfield :companion, (@registration.housing_data['companions'] || [nil]).first, heading: 'articles.conference_registration.headings.companion', help: 'articles.conference_registration.paragraphs.companion', big: true
= textfield :allergies, @registration.allergies, heading: 'articles.conference_registration.headings.allergies'
= textarea :other, @registration.other, plain: true, heading: 'articles.conference_registration.headings.other'
= button_tag :register, :value => :questions
+22 -1
View File
@@ -20,7 +20,28 @@
%li.guest{id: "guest-#{id}", data: { id: id, 'affected-hosts': @hosts_affected_by_guests[id].join(',') }}
%h4= registration.user.name
.city=registration.city
.email.on-top-only=registration.user.email
.on-top-only.details
= data_set(:h4, 'articles.admin.housing.headings.email') do
= registration.user.email
= data_set(:h4, 'articles.admin.housing.headings.housing') do
= registration.housing
- if registration.arrival.present?
= data_set(:h4, 'articles.admin.housing.headings.arrival_departure') do
= date_span(registration.arrival.to_date, registration.departure.to_date)
- if (registration.housing_data || {})['companions'].present?
= data_set(:h4, 'articles.admin.housing.headings.companion') do
- companion = User.find_by_email(registration.housing_data['companions'].first)
- if companion
= "#{companion.firstname} (#{companion.email})"
- else
= registration.housing_data['companions'].first
= _'articles.admin.housing.headings.unregistered'
- if registration.allergies.present?
= data_set(:h4, 'articles.admin.housing.headings.allergies') do
= registration.allergies
- if registration.other.present?
= data_set(:h4, 'articles.admin.housing.headings.other') do
= registration.other
= button_tag :set_host, type: :button, class: [:small, 'set-host', 'not-on-top']
+59 -23
View File
@@ -1,3 +1,13 @@
- conference = @this_conference || @conference
- if @entire_page
= form_tag administration_update_path(conference.slug, :schedule) do
- if conference.workshop_schedule_published
%p=_'articles.conference_registration.paragraphs.admin.schedule.published', :p
.actions= button_tag :un_publish, value: :publish, class: :delete
- else
%p=_'articles.conference_registration.paragraphs.admin.schedule.un_published', :p
.actions= button_tag :publish, value: :publish
#schedule-preview
- @schedule.each do | day, data |
%h4=date(day, :weekday)
@@ -24,23 +34,33 @@
- workshop = status = nil
%td{class: [time_data[:type], workshop.present? ? :filled : nil], rowspan: rowspan}
- if workshop.present?
= form_tag administration_update_path(@this_conference.slug, :schedule), class: 'js-xhr' do
.title=workshop.title
.status
.conflict-score
%span.title Conflict Score:
%span.value="#{status[:conflict_score] * 100.0}%"
- if status[:errors].present?
.errors
- status[:errors].each do | error |
.error=_"errors.messages.schedule.#{error[:name].to_s}", vars: error[:i18nVars]
= hidden_field_tag :id, workshop.id
= button_tag :deschedule, value: :deschedule_workshop, class: [:delete, :small]
- else
= link_to off_screen(workshop.title), view_workshop_path(@conference.slug, workshop.id), class: 'event-detail-link'
%template.event-details{data: { href: view_workshop_path(@conference.slug, workshop.id) }}
%h1.title=workshop.title
%p.address
= workshop.event_location.title + _!(': ')
%a{ href: "http://www.google.com/maps/place/#{workshop.event_location.latitude},#{workshop.event_location.longitude}" }
= workshop.event_location.address
.workshop-description= richtext workshop.info, 1
.title=workshop.title
- if @can_edit
= form_tag administration_update_path(conference.slug, :schedule), class: 'js-xhr' do
.status
.conflict-score
%span.title Conflict Score:
%span.value="#{status[:conflict_score] * 100.0}%"
- if status[:errors].present?
.errors
- status[:errors].each do | error |
.error=_"errors.messages.schedule.#{error[:name].to_s}", vars: error[:i18nVars]
= hidden_field_tag :id, workshop.id
= button_tag :deschedule, value: :deschedule_workshop, class: [:delete, :small]
- elsif @can_edit
.title="Block #{time_data[:item][:block] + 1}"
- else
%td{class: time_data[:type], rowspan: rowspan, colspan: data[:locations].present? ? data[:locations].size : 1}
.title="Block #{time_data[:item][:block] + 1}"
- if @can_edit
.title="Block #{time_data[:item][:block] + 1}"
%td.status{rowspan: rowspan}
- if time_data[:status].present? && time_data[:status][:errors].present?
%ul.errors
@@ -50,18 +70,34 @@
%td{class: time_data[:type], rowspan: rowspan, colspan: data[:locations].present? ? data[:locations].size : 1}
- case time_data[:type]
- when :meal
%a.event-detail-link=off_screen(time_data[:item]['title'])
- location = EventLocation.find(time_data[:item]['location'].to_i)
%template.event-details
%h1.title=time_data[:item]['title']
%p.address
= location.title + _!(': ')
%a{ href: "http://www.google.com/maps/place/#{location.latitude},#{location.longitude}" }
= location.address
.title= time_data[:item]['title']
.location= EventLocation.find(time_data[:item]['location'].to_i).title
.location= location.title
- when :event
%a.event-detail-link=off_screen(time_data[:item].title)
%template.event-details
%h1.title=time_data[:item].title
%p.address
= time_data[:item].event_location.title + _!(': ')
%a{ href: "http://www.google.com/maps/place/#{time_data[:item].event_location.latitude},#{time_data[:item].event_location.longitude}" }
= time_data[:item].event_location.address
= richtext time_data[:item].info, 1
.title= time_data[:item].title
.location= time_data[:item].event_location.title
%td.status{rowspan: rowspan}
- unless request.xhr?
%ul.workshop-list
- if @entire_page
%ul.workshops-to-schedule
- @workshops.each do | workshop |
%li{id: "workshop-#{workshop.id}", class: workshop.block.present? ? 'booked' : 'not-booked'}
%h4.title= workshop.title
= form_tag administration_update_path(@this_conference.slug, :schedule), class: 'js-xhr' do
= form_tag administration_update_path(conference.slug, :schedule), class: 'js-xhr' do
.already-booked
.field-error='This block is already booked'
.workshop-description
@@ -89,10 +125,10 @@
= link_info_dlg truncate(workshop.notes), (richtext workshop.notes.html_safe), workshop.title
= hidden_field_tag :id, workshop.id
.flex-inputs
= location_select workshop.event_location_id, small: true, stretch: true
.drop-downs
= location_select workshop.event_location_id, small: true
= block_select workshop.block.present? ? "#{workshop.block['day']}:#{workshop.block['block']}" : nil, small: true
.actions.next-prev
= button_tag :deschedule, value: :deschedule_workshop, class: [:delete, 'booked-only']
= button_tag :reschedule, value: :schedule_workshop, class: [:secondary, 'booked-only']
= button_tag :schedule_workshop, value: :schedule_workshop, class: 'not-booked-only'
= button_tag :deschedule, value: :deschedule_workshop, class: [:delete, 'booked-only', :small]
= button_tag :reschedule, value: :schedule_workshop, class: [:secondary, 'booked-only', :small]
= button_tag :schedule_workshop, value: :schedule_workshop, class: ['not-booked-only', :small]
@@ -1,5 +1,17 @@
.details
= data_set(:h4, 'articles.admin.stats.headings.registrations') do
= @registrations.size
= data_set(:h4, 'articles.admin.stats.headings.bikes') do
= "#{@bikes} (#{(@bikes / @registration_count) * 100.0}%)"
= data_set(:h4, 'articles.admin.stats.headings.food.meat') do
= "#{@food[:meat]} (#{(@food[:meat] / @food[:all]) * 100.0}%)"
= data_set(:h4, 'articles.admin.stats.headings.food.vegetarian') do
= "#{@food[:vegetarian]} (#{(@food[:vegetarian] / @food[:all]) * 100.0}%)"
= data_set(:h4, 'articles.admin.stats.headings.food.vegan') do
= "#{@food[:vegan]} (#{(@food[:vegan] / @food[:all]) * 100.0}%)"
= data_set(:h4, 'articles.admin.stats.headings.donation_count') do
= "#{@donation_count} (#{(@donation_count / @registration_count) * 100.0}%)"
= data_set(:h4, 'articles.admin.stats.headings.donation_total') do
= "$#{@donations}"
.actions
= link_to (_'links.download.Excel'), administration_step_path(@this_conference.slug, :stats, :format => :xlsx), class: [:button, :download]
+6
View File
@@ -74,5 +74,11 @@
= link_to (_'forms.actions.generic.facebook_sign_in','Facebook Sign In'), auth_at_provider_path(provider: :facebook, dest: settings_path), class: [:button, :facebook]
%button.close.subdued=_'forms.actions.generic.cancel'
- if @event_dlg.present?
.event-dlg#event-dlg{ data: { type: :event } }
.event-details
.actions.right
%a.more-details.button{href: '#'}=_'articles.workshops.info.read_more'
%button.close-btn.subdued=_'forms.actions.generic.close'
= yield :footer_scripts if content_for?(:footer_scripts)
= inline_scripts
@@ -12,4 +12,4 @@
%span.interest-text=interest_text(w)
.workshop-description=richtext w.info, 4
.actions.right
= link_to (_'articles.workshops.info.read_more'), view_workshop_path(w.conference.slug, w.id), class: 'workshop-link', class: [:button, :small]
= link_to (_'articles.workshops.info.read_more'), view_workshop_path(w.conference.slug, w.id), class: ['workshop-link', :button, :small]