From 1a068d2d2427c893f56c389c15c23b3c6027fda7 Mon Sep 17 00:00:00 2001 From: William Hale Date: Thu, 6 Aug 2015 23:19:09 -0700 Subject: [PATCH 1/9] added Voted? column to admin/events view --- app/views/admin/events/index.html.haml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index b796da61..0d1d7cf1 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -34,6 +34,8 @@ %b Difficulty %th %b State + %th + %b Voted? - @events.each do |event| %tr %td @@ -147,3 +149,14 @@ %span.caret %ul.dropdown-menu{:role=>"menu"} = render 'change_state_dropdown', event: event + + - if event.voted?(event, current_user) + - bgcolor = "" + - else + - bgcolor = "#F7819F" + %td{:style=>"background-color: #{bgcolor}"} + - if event.voted?(event, current_user) + Yes + - else + Not yet + From 49b38da18804e1072a417acbc5cd5770aa065afb Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Thu, 6 Aug 2015 07:41:20 +0300 Subject: [PATCH 2/9] Fix ordering for event.average_voting in events#index --- app/models/event.rb | 2 +- app/views/admin/events/index.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 7f5d9aa8..7cd75a89 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -77,7 +77,7 @@ class Event < ActiveRecord::Base @total_rating = @total_rating + vote.rating end @total = votes.size - number_with_precision(@total_rating / @total.to_f, precision: 2, strip_insignificant_zeros: true) + @total_rating > 0 ? number_with_precision(@total_rating / @total.to_f, precision: 2, strip_insignificant_zeros: true) : 0 end def submitter diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 0d1d7cf1..76604e95 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -44,7 +44,7 @@ =link_to event.title, admin_conference_event_path(@conference.short_title, event) - if @conference.call_for_paper && @conference.call_for_paper.rating && @conference.call_for_paper.rating > 0 - %td.col-md-1 + %td.col-md-1{'data-order' => "#{event.average_rating}"} - if event.average_rating.to_f > 0 #{event.average_rating}/#{@conference.call_for_paper.rating} %br From 1b8ec36bc1146d43c00f7aaa03202c7784ac19f5 Mon Sep 17 00:00:00 2001 From: William Hale Date: Tue, 11 Aug 2015 00:34:22 -0700 Subject: [PATCH 3/9] Removed Voted? column and added information to Rating column. --- app/views/admin/events/index.html.haml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 76604e95..b6a80ec7 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -56,6 +56,12 @@ = javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');" - else = label_tag "label_rating", "", :class => "avgrating" + %br + - voted = event.voted?(event, current_user) + - if voted + Your rating: #{voted.rating} + - else + Not rated - else 0/#{@conference.call_for_paper.rating} %br @@ -149,14 +155,3 @@ %span.caret %ul.dropdown-menu{:role=>"menu"} = render 'change_state_dropdown', event: event - - - if event.voted?(event, current_user) - - bgcolor = "" - - else - - bgcolor = "#F7819F" - %td{:style=>"background-color: #{bgcolor}"} - - if event.voted?(event, current_user) - Yes - - else - Not yet - From 4af7eef954148a2375d91fa2aa86c8f856a486f4 Mon Sep 17 00:00:00 2001 From: William Hale Date: Tue, 11 Aug 2015 00:34:22 -0700 Subject: [PATCH 4/9] Removed Voted? column and added information to Rating column. --- app/views/admin/events/index.html.haml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 76604e95..5edf4d81 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -34,8 +34,6 @@ %b Difficulty %th %b State - %th - %b Voted? - @events.each do |event| %tr %td @@ -56,6 +54,12 @@ = javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');" - else = label_tag "label_rating", "", :class => "avgrating" + %br + - voted = event.voted?(event, current_user) + - if voted + Your rating: #{voted.rating} + - else + Not rated - else 0/#{@conference.call_for_paper.rating} %br @@ -149,14 +153,3 @@ %span.caret %ul.dropdown-menu{:role=>"menu"} = render 'change_state_dropdown', event: event - - - if event.voted?(event, current_user) - - bgcolor = "" - - else - - bgcolor = "#F7819F" - %td{:style=>"background-color: #{bgcolor}"} - - if event.voted?(event, current_user) - Yes - - else - Not yet - From a0ffab098beddde336bf05875573462469bb268f Mon Sep 17 00:00:00 2001 From: William Hale Date: Tue, 11 Aug 2015 06:23:41 -0700 Subject: [PATCH 5/9] Wrapped voted? notification in label to promote visibility. --- app/views/admin/events/index.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index 5edf4d81..10a99f6d 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -57,9 +57,11 @@ %br - voted = event.voted?(event, current_user) - if voted - Your rating: #{voted.rating} + %span.label.label-success + Your rating: #{voted.rating} - else - Not rated + %span.label.label-danger + Not rated - else 0/#{@conference.call_for_paper.rating} %br From fd709ed4c09d357b4e78b14f03ec6a641c730781 Mon Sep 17 00:00:00 2001 From: raluka Date: Tue, 29 Sep 2015 16:40:51 +0200 Subject: [PATCH 6/9] Issue #686: Postalcode requires number --- .../20150929142405_change_postalcode_format_in_venues.rb | 9 +++++++++ db/schema.rb | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20150929142405_change_postalcode_format_in_venues.rb diff --git a/db/migrate/20150929142405_change_postalcode_format_in_venues.rb b/db/migrate/20150929142405_change_postalcode_format_in_venues.rb new file mode 100644 index 00000000..1cfbc714 --- /dev/null +++ b/db/migrate/20150929142405_change_postalcode_format_in_venues.rb @@ -0,0 +1,9 @@ +class ChangePostalcodeFormatInVenues < ActiveRecord::Migration + def up + change_column :venues, :postalcode, :string + end + + def down + change_column :venues, :postalcode, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 086a703f..0426bdbf 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150415121038) do +ActiveRecord::Schema.define(version: 20150929142405) do create_table "ahoy_events", force: true do |t| t.uuid "visit_id" @@ -515,7 +515,7 @@ ActiveRecord::Schema.define(version: 20150415121038) do t.integer "photo_file_size" t.datetime "photo_updated_at" t.string "street" - t.integer "postalcode" + t.string "postalcode" t.string "city" t.string "country" t.string "latitude" From 759aa546890f7d282c3dab47bdcca9c5b3ad3dfa Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Tue, 6 Oct 2015 14:15:38 +0300 Subject: [PATCH 7/9] Syntax style + code groomming --- app/assets/stylesheets/osem.css.scss | 4 +++- app/controllers/admin/events_controller.rb | 8 ++++---- .../admin/registrations_controller.rb | 6 +++--- app/views/admin/event_types/index.html.haml | 3 +++ .../admin/registrations/_questions.html.haml | 4 ++-- app/views/admin/registrations/edit.html.haml | 18 +++++------------- app/views/admin/registrations/index.html.haml | 12 ++++++------ app/views/conference/index.html.haml | 8 ++++---- .../conference_registrations/_form.html.haml | 9 +-------- .../_questions.html.haml | 2 +- .../_registration_info.html.haml | 8 ++++++++ app/views/layouts/_admin_sidebar.html.haml | 11 ++++++++--- app/views/proposal/_form.html.haml | 6 +++--- app/views/proposal/_proposal_form.html.haml | 4 ++-- app/views/proposal/new.html.haml | 13 +++++++------ spec/features/ability_spec.rb | 6 ++++-- 16 files changed, 64 insertions(+), 58 deletions(-) create mode 100644 app/views/conference_registrations/_registration_info.html.haml diff --git a/app/assets/stylesheets/osem.css.scss b/app/assets/stylesheets/osem.css.scss index 03c221da..2f44ba19 100644 --- a/app/assets/stylesheets/osem.css.scss +++ b/app/assets/stylesheets/osem.css.scss @@ -55,7 +55,9 @@ fieldset { margin: 20px 0 20px 0; } -.bootstrap-switch { height: 1.7em } +.bootstrap-switch { + height: 1.7em +} .comment-reply{ padding-top: 40px; diff --git a/app/controllers/admin/events_controller.rb b/app/controllers/admin/events_controller.rb index 019d0116..2334531d 100644 --- a/app/controllers/admin/events_controller.rb +++ b/app/controllers/admin/events_controller.rb @@ -179,12 +179,12 @@ module Admin def update_state(transition, notice, mail = false, subject = false, send_mail = false) alert = @event.update_state(transition, mail, subject, send_mail, params[:send_mail].blank?) - if !alert.blank? - flash[:error] = error - return redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return - else + if alert.blank? flash[:notice] = notice redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return + else + flash[:error] = alert + return redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return end end end diff --git a/app/controllers/admin/registrations_controller.rb b/app/controllers/admin/registrations_controller.rb index 9bafb828..70abe4a1 100644 --- a/app/controllers/admin/registrations_controller.rb +++ b/app/controllers/admin/registrations_controller.rb @@ -17,9 +17,9 @@ module Admin @registration.update_attributes(registration_params) if @registration.save redirect_to admin_conference_registrations_path(@conference.short_title), - notice: 'Successfully updated registration!' + notice: "Successfully updated registration for #{@registration.user.email}!" else - flash[:error] = "An error prohibited the Registration for #{@conference.title}: "\ + flash[:error] = "An error prohibited the Registration for #{@registration.user.email}: "\ "#{@registration.errors.full_messages.join('. ')}." render :edit end @@ -56,7 +56,7 @@ module Admin permit( :conference_id, :arrival, :departure, :volunteer, - vchoice_ids: [], qanswer_ids: [], + vchoice_ids: [], qanswer_ids: [], event_ids: [], qanswers_attributes: [], user_attributes: [ :id, :name, :tshirt, :mobile, :volunteer_experience, :languages, diff --git a/app/views/admin/event_types/index.html.haml b/app/views/admin/event_types/index.html.haml index fddc2dd3..e5513eff 100644 --- a/app/views/admin/event_types/index.html.haml +++ b/app/views/admin/event_types/index.html.haml @@ -9,6 +9,7 @@ %table.table.table-hover#event_types %thead %th Title + %th Description %th Length %th Abstract Length %th Color @@ -18,6 +19,8 @@ %tr %td = event_type.title + %td + = event_type.description %td = event_type.length Minutes diff --git a/app/views/admin/registrations/_questions.html.haml b/app/views/admin/registrations/_questions.html.haml index f82a1213..473a3976 100644 --- a/app/views/admin/registrations/_questions.html.haml +++ b/app/views/admin/registrations/_questions.html.haml @@ -4,6 +4,6 @@ = q.title %b A: - - registration.qanswers.where(:question_id => q.id).each do |qa| + - registration.qanswers.where(question_id: q.id).each do |qa| = qa.answer.title - %br \ No newline at end of file + %br diff --git a/app/views/admin/registrations/edit.html.haml b/app/views/admin/registrations/edit.html.haml index caa84108..694da7a5 100644 --- a/app/views/admin/registrations/edit.html.haml +++ b/app/views/admin/registrations/edit.html.haml @@ -2,25 +2,17 @@ .col-md-12 .page-header %h1 - Edit registration of #{@user.username} for #{@conference.short_title} + Registration for #{@user.username} .row - .col-md-8 - = semantic_form_for(@registration, :url => admin_conference_registration_path(@conference.short_title, @registration)) do |f| + .col-md-6 + = semantic_form_for(@registration, url: admin_conference_registration_path(@conference.short_title, @registration)) do |f| = f.inputs 'Personal Information' do = f.fields_for :user do |u| = u.input :name, as: :string = u.input :nickname, as: :string = u.input :affiliation, placeholder: 'Company/User Group/nothing', as: :string = f.inputs 'Registration Information' do - - @conference.questions.each do |q| - %h5 - = "Q: #{q.title}" - - if q.question_type.id == 1 || q.question_type.id == 2 # yes/no or single choice - = f.input :qanswers, :collection => q.qanswers, :as => :select, :input_html => { :multiple => false }, :label => false, :include_blank => "Please make your choice", - :member_label => Proc.new {|a| a.answer.title} - - if q.question_type.id == 3 # multiple choice - = f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, :label => false, - :member_label => Proc.new {|a| a.answer.title} + = render partial: 'conference_registrations/registration_info', locals: { f: f } -# Not necessary - if @conference.social_events.count > 0 @@ -28,4 +20,4 @@ %br Yes, I'll be attending... %br = f.input :social_events, as: :check_boxes, label: false, collection: @conference.social_events - = f.action :submit, button_html: { value: 'Edit Registration', class: 'btn btn-primary' } + = f.action :submit, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/registrations/index.html.haml b/app/views/admin/registrations/index.html.haml index ae48c678..4e3a843e 100644 --- a/app/views/admin/registrations/index.html.haml +++ b/app/views/admin/registrations/index.html.haml @@ -6,8 +6,8 @@ = "(#{@registrations.length})" if @registrations .btn-group.pull-right - if can? :read, Registration - = link_to "Export PDF", admin_conference_registrations_path(@conference.short_title, :format => :pdf), :class => "btn btn-default" - = link_to "Export XLS", {:format => :xlsx}, :class => "btn btn-default" + = link_to 'Export PDF', admin_conference_registrations_path(@conference.short_title, format: :pdf), class: 'btn btn-success' + = link_to 'Export XLS', {format: :xlsx}, class: 'btn btn-success' %p.text-muted All the people who registered to your event %table.table.table-hover.datatable#registrations @@ -32,12 +32,12 @@ = registration.email %td - if registration.arrival - = registration.arrival.strftime("%d %b %H:%M") + = registration.arrival.strftime('%d %b %H:%M') - else n/a %td - if registration.departure - = registration.departure.strftime("%d %b %H:%M") + = registration.departure.strftime('%d %b %H:%M') - else n/a -if @conference.questions.any? @@ -47,7 +47,7 @@ = check_box_tag "#{@conference.short_title}_#{registration.id}", registration.id, registration.attended, class: 'switch-checkbox', method: :patch, url: toggle_attendance_admin_conference_registration_path(@conference.short_title, id: registration.id)+"?attended=", - data: { size: "small", + data: { size: 'small', on_color: 'success', off_color: 'warning', on_text: 'Present', @@ -61,7 +61,7 @@ .questions{class: "question#{index}", style: 'display:none;'} = render partial: 'questions', locals: { registration: registration } -.modal.fade{ id: "questions", 'role' => 'dialog', 'aria-hidden' => 'true' } +.modal.fade{ id: 'questions', 'role' => 'dialog', 'aria-hidden' => 'true' } .modal-dialog .modal-content .modal-header diff --git a/app/views/conference/index.html.haml b/app/views/conference/index.html.haml index 79ea924d..b94f5075 100644 --- a/app/views/conference/index.html.haml +++ b/app/views/conference/index.html.haml @@ -4,19 +4,19 @@ .page-header %h2 Upcoming Conferences - @current.each do |conference| - = render :partial => "conference_details", :locals => {:conference => conference} + = render partial: 'conference_details', locals: { conference: conference } -if @antiquated and @antiquated.any? .row .col-md-12 %p.text-right - %button{:type=>"button", :class=>"btn btn-link btn-sm", "data-toggle"=>"collapse", "data-target"=>"#antiquated", "aria-expanded"=>"true", "aria-controls"=>"antiquated"} + %button{ type: 'button', class: 'btn btn-link btn-sm', 'data-toggle' => 'collapse', 'data-target' => '#antiquated', 'aria-expanded' => 'true', 'aria-controls' => 'antiquated'} Older conferences = "(#{@antiquated.count})" %i.fa.fa-chevron-right - %i.fa.fa-chevron-down{:style => 'display: none'} + %i.fa.fa-chevron-down{ style: 'display: none' } #antiquated.collapse - @antiquated.each do |conference| - = render :partial => "conference_details", :locals => {:conference => conference} + = render partial: 'conference_details', locals: { conference: conference} -content_for :script_body do :javascript diff --git a/app/views/conference_registrations/_form.html.haml b/app/views/conference_registrations/_form.html.haml index f3b282f1..7678abef 100644 --- a/app/views/conference_registrations/_form.html.haml +++ b/app/views/conference_registrations/_form.html.haml @@ -21,14 +21,7 @@ = semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f| = render partial: 'devise/shared/sign_up_form_embedded' - - if @conference.questions.any? - = render partial: 'questions', locals: { f: f } - - if @conference.events.workshops.any? - =f.inputs 'Register to Workshops' do - = f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops - = f.inputs 'Your Travel Info' do - = f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' } - = f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' } + = render partial: 'registration_info', locals: { f: f } .row .col-md-12 %p.pull-right diff --git a/app/views/conference_registrations/_questions.html.haml b/app/views/conference_registrations/_questions.html.haml index 2443b7dc..56ee7836 100644 --- a/app/views/conference_registrations/_questions.html.haml +++ b/app/views/conference_registrations/_questions.html.haml @@ -5,4 +5,4 @@ :member_label => Proc.new {|a| a.answer.title} - if q.question_type.id == 3 # multiple choice = f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, label: q.title, - :member_label => Proc.new {|a| a.answer.title} \ No newline at end of file + :member_label => Proc.new {|a| a.answer.title} diff --git a/app/views/conference_registrations/_registration_info.html.haml b/app/views/conference_registrations/_registration_info.html.haml new file mode 100644 index 00000000..9653862d --- /dev/null +++ b/app/views/conference_registrations/_registration_info.html.haml @@ -0,0 +1,8 @@ +- if @conference.questions.any? + = render partial: 'conference_registrations/questions', locals: { f: f } +- if @conference.events.workshops.any? + =f.inputs 'Pre-registration required for the following:' do + = f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops += f.inputs 'Your Travel Info' do + = f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' } + = f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' } diff --git a/app/views/layouts/_admin_sidebar.html.haml b/app/views/layouts/_admin_sidebar.html.haml index 9fc01035..016c77a2 100644 --- a/app/views/layouts/_admin_sidebar.html.haml +++ b/app/views/layouts/_admin_sidebar.html.haml @@ -29,9 +29,14 @@ Dashboard - if can? :show, @conference %li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))}"} - = link_to(edit_admin_conference_path(@conference.short_title)) do - %span.fa.fa-home - Basics + - if can? :edit, @conference + = link_to(edit_admin_conference_path(@conference.short_title)) do + %span.fa.fa-home + Basics + - else + %a + %span.fa.fa-home + Basics %ul - if can? :update, Contact.new(conference_id: @conference.id) %li{:class=> "#{active_nav_li(edit_admin_conference_contact_path(@conference.short_title))}"} diff --git a/app/views/proposal/_form.html.haml b/app/views/proposal/_form.html.haml index f7eb3f3b..c0bc8dc8 100644 --- a/app/views/proposal/_form.html.haml +++ b/app/views/proposal/_form.html.haml @@ -4,9 +4,9 @@ .tabbable %ul.nav.nav-tabs %li.active - = link_to "Proposal", "#proposal-content", "data-toggle"=>"tab" + = link_to 'Proposal', '#proposal-content', 'data-toggle' => 'tab' %li - = link_to 'Commercials', '#commercials-content', 'data-toggle'=>'tab' + = link_to 'Commercials', '#commercials-content', 'data-toggle' => 'tab' .tab-content #proposal-content.tab-pane.active = render 'proposal/proposal_form' @@ -29,7 +29,7 @@ = link_to 'Edit', edit_conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), class: 'btn btn-primary' - if can? :destroy, commercial = link_to 'Delete', conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), - :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger' + method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' - if can? :create, @event.commercials.new %hr = link_to 'Add Commercial', new_conference_proposal_commercial_path(@conference.short_title, @event.id), class: 'btn btn-primary' diff --git a/app/views/proposal/_proposal_form.html.haml b/app/views/proposal/_proposal_form.html.haml index 8b748139..83b34a5f 100644 --- a/app/views/proposal/_proposal_form.html.haml +++ b/app/views/proposal/_proposal_form.html.haml @@ -43,11 +43,11 @@ = f.input :is_highlight %p.text-right - = link_to '#description', "data-toggle"=>"collapse" do + = link_to '#description', 'data-toggle' => 'collapse' do Do you require something special? .collapse#description = f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.' %p.text-right - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: 'Update Proposal' + = f.submit 'Update Proposal', class: 'btn btn-success' diff --git a/app/views/proposal/new.html.haml b/app/views/proposal/new.html.haml index 1d91c157..e4b4fd99 100644 --- a/app/views/proposal/new.html.haml +++ b/app/views/proposal/new.html.haml @@ -11,11 +11,11 @@ - if !current_user %legend %span - =link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do + =link_to('#signup', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do = CONFIG['name'] Account %span.pull-right#account-already - =link_to('#signin', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do + =link_to('#signin', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do Already have an account? .tab-content .tab-pane.active{role: 'tabpanel', id: 'signup'} @@ -25,7 +25,7 @@ = render partial: 'devise/shared/sign_up_form_embedded' = f.inputs name: 'Proposal Information' do - = f.input :title, as: :string, required: true + = f.input :title, as: :string, required: true, input_html: { required: true } = f.input :event_type_id, as: :select, collection: @conference.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id, data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]}, @@ -38,7 +38,7 @@ :javascript $("##{@conference.event_types.first.id}-help").collapse('show'); - = f.input :abstract, input_html: { rows: 5 }, + = f.input :abstract, input_html: { rows: 5, required: true }, required: true, hint: link_to('Tips to improve your presentations', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx') %p @@ -55,12 +55,13 @@ = f.input :require_registration, label: 'Require participants to register to your event' %p.text-right - = link_to '#description', "data-toggle"=>"collapse", id: 'description_link' do + = link_to '#description', 'data-toggle' => 'collapse', id: 'description_link' do Do you require something special? .collapse#description = f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.' %p.text-right - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: 'Create Proposal' + = f.submit 'Create Proposal', class: 'btn btn-success' + .tab-pane{role: 'tabpanel', id: 'signin'} = render partial: 'devise/shared/sign_in_form_embedded' diff --git a/spec/features/ability_spec.rb b/spec/features/ability_spec.rb index 53f21818..c7abb168 100644 --- a/spec/features/ability_spec.rb +++ b/spec/features/ability_spec.rb @@ -105,7 +105,8 @@ feature 'Has correct abilities' do visit admin_conference_path(conference2.short_title) expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard') - expect(page).to have_link('Basics', href: "/admin/conference/#{conference2.short_title}/edit") + expect(page).to_not have_link('Basics', href: "/admin/conference/#{conference2.short_title}/edit") + expect(page).to have_text('Basics') expect(page).to_not have_link('Contact', href: "/admin/conference/#{conference2.short_title}/contact/edit") expect(page).to have_link('Commercials', href: "/admin/conference/#{conference2.short_title}/commercials") expect(page).to have_link('Events', href: "/admin/conference/#{conference2.short_title}/events") @@ -176,7 +177,8 @@ feature 'Has correct abilities' do visit admin_conference_path(conference3.short_title) expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard') - expect(page).to have_link('Basics', href: "/admin/conference/#{conference3.short_title}/edit") + expect(page).to_not have_link('Basics', href: "/admin/conference/#{conference2.short_title}/edit") + expect(page).to have_text('Basics') expect(page).to_not have_link('Contact', href: "/admin/conference/#{conference3.short_title}/contact/edit") expect(page).to have_link('Commercials', href: "/admin/conference/#{conference3.short_title}/commercials") expect(page).to_not have_link('Events', href: "/admin/conference/#{conference3.short_title}/events") From e3fa414a5c4b81ca2cd5ecbafa800b6fe8ea38bc Mon Sep 17 00:00:00 2001 From: raluka Date: Mon, 12 Oct 2015 11:58:16 +0200 Subject: [PATCH 8/9] made migration irreversible --- ...2405_change_postalcode_format_in_venues.rb | 6 +--- db/schema.rb | 36 +++++++++---------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/db/migrate/20150929142405_change_postalcode_format_in_venues.rb b/db/migrate/20150929142405_change_postalcode_format_in_venues.rb index 1cfbc714..1f9351d6 100644 --- a/db/migrate/20150929142405_change_postalcode_format_in_venues.rb +++ b/db/migrate/20150929142405_change_postalcode_format_in_venues.rb @@ -1,9 +1,5 @@ class ChangePostalcodeFormatInVenues < ActiveRecord::Migration - def up + def change change_column :venues, :postalcode, :string end - - def down - change_column :venues, :postalcode, :integer - end end diff --git a/db/schema.rb b/db/schema.rb index 0426bdbf..6ba080c3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -158,35 +158,35 @@ ActiveRecord::Schema.define(version: 20150929142405) do create_table "email_settings", force: true do |t| t.integer "conference_id" - t.boolean "send_on_registration", default: false - t.boolean "send_on_accepted", default: false - t.boolean "send_on_rejected", default: false - t.boolean "send_on_confirmed_without_registration", default: false - t.text "registration_email_template" - t.text "accepted_email_template" - t.text "rejected_email_template" - t.text "confirmed_email_template" + t.boolean "send_on_registration", default: false + t.boolean "send_on_accepted", default: false + t.boolean "send_on_rejected", default: false + t.boolean "send_on_confirmed_without_registration", default: false + t.text "registration_body" + t.text "accepted_body" + t.text "rejected_body" + t.text "confirmed_without_registration_body" t.datetime "created_at" t.datetime "updated_at" t.string "registration_subject" t.string "accepted_subject" t.string "rejected_subject" t.string "confirmed_without_registration_subject" - t.boolean "send_on_updated_conference_dates", default: false + t.boolean "send_on_updated_conference_dates", default: false t.string "updated_conference_dates_subject" - t.text "updated_conference_dates_template" - t.boolean "send_on_updated_conference_registration_dates", default: false + t.text "updated_conference_dates_body" + t.boolean "send_on_updated_conference_registration_dates", default: false t.string "updated_conference_registration_dates_subject" - t.text "updated_conference_registration_dates_template" - t.boolean "send_on_venue_update", default: false + t.text "updated_conference_registration_dates_body" + t.boolean "send_on_venue_update", default: false t.string "venue_update_subject" - t.text "venue_update_template" - t.boolean "send_on_call_for_papers_dates_updates", default: false - t.boolean "send_on_call_for_papers_schedule_public", default: false + t.text "venue_update_body" + t.boolean "send_on_call_for_papers_dates_updates", default: false + t.boolean "send_on_call_for_papers_schedule_public", default: false t.string "call_for_papers_schedule_public_subject" t.string "call_for_papers_dates_updates_subject" - t.text "call_for_papers_schedule_public_template" - t.text "call_for_papers_dates_updates_template" + t.text "call_for_papers_schedule_public_body" + t.text "call_for_papers_dates_updates_body" end create_table "event_types", force: true do |t| From 3d91029afcd35c2f3bab1f32d9018f0907ad2e8c Mon Sep 17 00:00:00 2001 From: raluka Date: Wed, 14 Oct 2015 11:53:48 +0200 Subject: [PATCH 9/9] now reverting migration will raise AR error --- ...2405_change_postalcode_format_in_venues.rb | 6 +++- db/schema.rb | 36 +++++++++---------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/db/migrate/20150929142405_change_postalcode_format_in_venues.rb b/db/migrate/20150929142405_change_postalcode_format_in_venues.rb index 1f9351d6..010f9349 100644 --- a/db/migrate/20150929142405_change_postalcode_format_in_venues.rb +++ b/db/migrate/20150929142405_change_postalcode_format_in_venues.rb @@ -1,5 +1,9 @@ class ChangePostalcodeFormatInVenues < ActiveRecord::Migration - def change + def up change_column :venues, :postalcode, :string end + + def down + raise ActiveRecord::IrreversibleMigration.new('Cannot reverse migration.') + end end diff --git a/db/schema.rb b/db/schema.rb index 6ba080c3..0426bdbf 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -158,35 +158,35 @@ ActiveRecord::Schema.define(version: 20150929142405) do create_table "email_settings", force: true do |t| t.integer "conference_id" - t.boolean "send_on_registration", default: false - t.boolean "send_on_accepted", default: false - t.boolean "send_on_rejected", default: false - t.boolean "send_on_confirmed_without_registration", default: false - t.text "registration_body" - t.text "accepted_body" - t.text "rejected_body" - t.text "confirmed_without_registration_body" + t.boolean "send_on_registration", default: false + t.boolean "send_on_accepted", default: false + t.boolean "send_on_rejected", default: false + t.boolean "send_on_confirmed_without_registration", default: false + t.text "registration_email_template" + t.text "accepted_email_template" + t.text "rejected_email_template" + t.text "confirmed_email_template" t.datetime "created_at" t.datetime "updated_at" t.string "registration_subject" t.string "accepted_subject" t.string "rejected_subject" t.string "confirmed_without_registration_subject" - t.boolean "send_on_updated_conference_dates", default: false + t.boolean "send_on_updated_conference_dates", default: false t.string "updated_conference_dates_subject" - t.text "updated_conference_dates_body" - t.boolean "send_on_updated_conference_registration_dates", default: false + t.text "updated_conference_dates_template" + t.boolean "send_on_updated_conference_registration_dates", default: false t.string "updated_conference_registration_dates_subject" - t.text "updated_conference_registration_dates_body" - t.boolean "send_on_venue_update", default: false + t.text "updated_conference_registration_dates_template" + t.boolean "send_on_venue_update", default: false t.string "venue_update_subject" - t.text "venue_update_body" - t.boolean "send_on_call_for_papers_dates_updates", default: false - t.boolean "send_on_call_for_papers_schedule_public", default: false + t.text "venue_update_template" + t.boolean "send_on_call_for_papers_dates_updates", default: false + t.boolean "send_on_call_for_papers_schedule_public", default: false t.string "call_for_papers_schedule_public_subject" t.string "call_for_papers_dates_updates_subject" - t.text "call_for_papers_schedule_public_body" - t.text "call_for_papers_dates_updates_body" + t.text "call_for_papers_schedule_public_template" + t.text "call_for_papers_dates_updates_template" end create_table "event_types", force: true do |t|