From ad6fbd5586f409f107c4d48c892bf8aec7316b54 Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 19 Jul 2016 17:28:23 -0700 Subject: [PATCH] Front page schedule --- app/assets/javascripts/schedule.js | 30 +++++++++++++++++++ app/assets/stylesheets/_application.scss | 24 +++++++++++++++ app/controllers/conferences_controller.rb | 2 ++ .../application/_login_confirm.html.haml | 7 ++--- .../_login_confirmation_sent.html.haml | 2 +- .../conferences/admin/_broadcast.html.haml | 2 +- .../admin/_broadcast_sent.html.haml | 2 +- .../conferences/admin/_schedule.html.haml | 10 +++---- config/locales/en.yml | 2 ++ config/locales/es.yml | 1 + 10 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 app/assets/javascripts/schedule.js diff --git a/app/assets/javascripts/schedule.js b/app/assets/javascripts/schedule.js new file mode 100644 index 0000000..5dbe76f --- /dev/null +++ b/app/assets/javascripts/schedule.js @@ -0,0 +1,30 @@ +(function() { + var body = document.querySelector('body'); + var primaryContent = document.getElementById('primary-content'); + var eventDlg = document.getElementById('event-dlg'); + + forEachElement('.event-detail-link', function(link) { + var eventDetails = link.parentElement.querySelector('.event-details'); + var moreDetails = eventDlg.querySelector('.more-details'); + + link.addEventListener('click', function(event) { + event.preventDefault(); + eventDlg.querySelector('.event-details').innerHTML = eventDetails.innerHTML; + var href = eventDetails.getAttribute('data-href'); + if (href) { + moreDetails.setAttribute('href', href); + moreDetails.classList.remove('hidden'); + } else { + moreDetails.classList.add('hidden'); + } + window.openOverlay(eventDlg, primaryContent, body); + + var closeDlg = function(event) { + event.preventDefault(); + window.closeOverlay(eventDlg, primaryContent, body); + }; + eventDlg.querySelector('.close-btn').onclick = closeDlg; + document.getElementById('overlay').onclick = closeDlg; + }); + }); +})(); diff --git a/app/assets/stylesheets/_application.scss b/app/assets/stylesheets/_application.scss index dce0ec4..7356df2 100644 --- a/app/assets/stylesheets/_application.scss +++ b/app/assets/stylesheets/_application.scss @@ -1546,6 +1546,30 @@ table.schedule { width: 100%; margin: 0 0 1em; + &.locations-1 td.workshop { + width: 100%; + } + + &.locations-2 td.workshop { + width: 50%; + } + + &.locations-3 td.workshop { + width: 33.333%; + } + + &.locations-4 td.workshop { + width: 25%; + } + + &.locations-5 td.workshop { + width: 20%; + } + + &.locations-6 td.workshop { + width: 16.66667%; + } + td { position: relative; text-align: center; diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index d6e32b9..9bd020b 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -1120,6 +1120,8 @@ class ConferencesController < ApplicationController event.save + return redirect_to administration_step_path(@this_conference.slug, :events) + when 'cancel' return redirect_to administration_step_path(@this_conference.slug, :events) end when 'workshop_times' diff --git a/app/views/application/_login_confirm.html.haml b/app/views/application/_login_confirm.html.haml index 307f69d..20245e1 100644 --- a/app/views/application/_login_confirm.html.haml +++ b/app/views/application/_login_confirm.html.haml @@ -1,10 +1,7 @@ = row do = columns(medium: 12) do %h2=_'articles.permission_denied.headings.confirm_email','Please confirm your email address' - = columns(medium: 6, large: 5) do - = form_tag :do_confirm, :authenticity_token => false do - .email-field.input-field - = email_field_tag :email, nil, required: true - = label_tag :email + = form_tag :do_confirm, :authenticity_token => false, class: 'flex-form' do + = emailfield :email, nil, required: true, big: true = hidden_field_tag :token, @confirmation.token = button_tag :login diff --git a/app/views/application/_login_confirmation_sent.html.haml b/app/views/application/_login_confirmation_sent.html.haml index 4099e77..782fefc 100644 --- a/app/views/application/_login_confirmation_sent.html.haml +++ b/app/views/application/_login_confirmation_sent.html.haml @@ -1,4 +1,4 @@ = row do = columns(medium: 12) do - %h2=_'articles.permission_denied.headings.confirmation_sent','Confirmation Sent' + %h2=_'articles.permission_denied.headings.confirmation_sent' %p=_'articles.conference_registration.paragraphs.email_confirm', :p diff --git a/app/views/conferences/admin/_broadcast.html.haml b/app/views/conferences/admin/_broadcast.html.haml index a0a2acd..34314a0 100644 --- a/app/views/conferences/admin/_broadcast.html.haml +++ b/app/views/conferences/admin/_broadcast.html.haml @@ -12,7 +12,7 @@ = richtext @body, 4 .actions.right = button_tag :test, value: :test, class: :secondary if @broadcast_step == :preview - = button_with_confirmation :send, (_'modals.admin.broadcast.confirm', vars: { number: @subscriber_count || 0 }), value: :send, class: :delete if @broadcast_step == :test + = button_with_confirmation :send, (_'modals.admin.broadcast.confirm', vars: { number: "#{(@send_to_count || 0)}".html_safe }), value: :send, class: :delete if @broadcast_step == :test = button_tag :edit, value: :edit - else = selectfield :send_to, nil, broadcast_options, full: true diff --git a/app/views/conferences/admin/_broadcast_sent.html.haml b/app/views/conferences/admin/_broadcast_sent.html.haml index 4ace70c..89d1834 100644 --- a/app/views/conferences/admin/_broadcast_sent.html.haml +++ b/app/views/conferences/admin/_broadcast_sent.html.haml @@ -1 +1 @@ -Sent. \ No newline at end of file +%p= _'articles.conference_registration.paragraphs.admin.broadcast.sent' diff --git a/app/views/conferences/admin/_schedule.html.haml b/app/views/conferences/admin/_schedule.html.haml index 9cbed17..30670d4 100644 --- a/app/views/conferences/admin/_schedule.html.haml +++ b/app/views/conferences/admin/_schedule.html.haml @@ -11,7 +11,7 @@ #schedule-preview - @schedule.each do | day, data | %h4=date(day, :weekday) - %table.schedule{class: data[:locations].present? ? 'has-locations' : 'no-locations'} + %table.schedule{class: [data[:locations].present? ? 'has-locations' : 'no-locations', "locations-#{data[:locations].size}"]} - if data[:locations].present? %thead %tr @@ -81,15 +81,15 @@ .title= time_data[:item]['title'] .location= location.title - when :event - %a.event-detail-link=off_screen(time_data[:item].title) + %a.event-detail-link=off_screen(time_data[:item][:title]) %template.event-details - %h1.title=time_data[:item].title + %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 + = richtext time_data[:item][:info], 1 + .title= time_data[:item][:title] .location= time_data[:item].event_location.title %td.status{rowspan: rowspan} - if @entire_page diff --git a/config/locales/en.yml b/config/locales/en.yml index a792f3f..2c4d7cb 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5488,6 +5488,7 @@ en: broadcast: test: Please take a look at this preview to ensure that you want to send this email. Clicking ‘Test’ will send the email only to you. Only after that then the email will be set to %{send_to_count} people. preview: Clicking ‘Send’ will send this message to %{send_to_count} people. Please confirm that you have verified that the test email sent to you is what you want to be sent. + sent: Your message has been sent. companion: Is there someone who you would like us to ensure that you are housed with? arrival_and_departure: If you don't need housing, just tell us how long you plan to hang out with Bike!Bike! host: @@ -5570,6 +5571,7 @@ en: What_is_BikeBike: What is Bike!Bike!? permission_denied: headings: + confirmation_sent: Confirmation Sent confirm_email: Please confirm your email address login_required: Login Required paragraphs: diff --git a/config/locales/es.yml b/config/locales/es.yml index ef30842..6ecf522 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -35,6 +35,7 @@ es: default: '%d/%m/%Y' long: '%d de %B de %Y' short: '%d de %b' + weekday: "%A" span_same_month_date_2: '%e, %Y' span_same_month_date_1: '%B %e' span_same_year_date_1: "%B %e"