Merge branch 'master' into recaptcha
This commit is contained in:
commit
eca09dd7d6
20 changed files with 73 additions and 23 deletions
|
|
@ -55,7 +55,7 @@ module Admin
|
||||||
private
|
private
|
||||||
|
|
||||||
def cfp_params
|
def cfp_params
|
||||||
params.require(:cfp).permit(:start_date, :end_date, :cfp_type)
|
params.require(:cfp).permit(:start_date, :end_date, :description, :cfp_type)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,7 @@ module Admin
|
||||||
def edit
|
def edit
|
||||||
@conferences = Conference.all
|
@conferences = Conference.all
|
||||||
@date_string = date_string(@conference.start_date, @conference.end_date)
|
@date_string = date_string(@conference.start_date, @conference.end_date)
|
||||||
|
@affected_event_count = @conference.program.events.scheduled(@conference.program.selected_schedule_id).count
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.json { render json: @conference.to_json }
|
format.json { render json: @conference.to_json }
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,12 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def rescheduling_hint(affected_event_count)
|
||||||
|
if affected_event_count > 0
|
||||||
|
"You have #{affected_event_count} scheduled #{'event'.pluralize(affected_event_count)}. Changing the conference hours will unschedule those scheduled outside the conference hours."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# ====Gets
|
# ====Gets
|
||||||
# a conference object
|
# a conference object
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@ class Program < ActiveRecord::Base
|
||||||
has_many :event_schedules, through: :events
|
has_many :event_schedules, through: :events
|
||||||
|
|
||||||
has_many :event_users, through: :events
|
has_many :event_users, through: :events
|
||||||
has_many :speakers, -> { distinct }, through: :event_users, source: :user do
|
has_many :program_events_speakers, -> {where(event_role: 'speaker')}, through: :events, source: :event_users
|
||||||
|
has_many :speakers, -> { distinct }, through: :program_events_speakers, source: :user do
|
||||||
def confirmed
|
def confirmed
|
||||||
joins(:events).where(events: { state: :confirmed })
|
joins(:events).where(events: { state: :confirmed })
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@
|
||||||
%dd
|
%dd
|
||||||
= @cfp.end_date.strftime('%A, %B %e. %Y')
|
= @cfp.end_date.strftime('%A, %B %e. %Y')
|
||||||
%dt
|
%dt
|
||||||
Days Left:
|
Description
|
||||||
|
%dd
|
||||||
|
= markdown(@cfp.description)
|
||||||
|
%dt
|
||||||
|
Days Left
|
||||||
%dd
|
%dd
|
||||||
= pluralize(@cfp.remaining_days, 'day')
|
= pluralize(@cfp.remaining_days, 'day')
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
End Date:
|
End Date:
|
||||||
%dd#end_date
|
%dd#end_date
|
||||||
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||||
|
%dt
|
||||||
|
Description:
|
||||||
|
%dd#description
|
||||||
|
= markdown(@cfp.description)
|
||||||
%dt
|
%dt
|
||||||
Days Left:
|
Days Left:
|
||||||
%dd
|
%dd
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,6 @@
|
||||||
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly' }
|
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly' }
|
||||||
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' }
|
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' }
|
||||||
= f.input :cfp_type, as: :select, collection: (@cfp.new_record? ? @program.remaining_cfp_types : [@cfp.cfp_type] + @program.remaining_cfp_types).map {|type| ["#{type.capitalize}", type]}, include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
|
= f.input :cfp_type, as: :select, collection: (@cfp.new_record? ? @program.remaining_cfp_types : [@cfp.cfp_type] + @program.remaining_cfp_types).map {|type| ["#{type.capitalize}", type]}, include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
|
||||||
|
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, hint: markdown_hint
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
End Date:
|
End Date:
|
||||||
%dd#end_date
|
%dd#end_date
|
||||||
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
= @cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||||
|
%dt
|
||||||
|
Description:
|
||||||
|
%dd#description
|
||||||
|
= markdown(@cfp.description)
|
||||||
%dt
|
%dt
|
||||||
Days Left:
|
Days Left:
|
||||||
%dd
|
%dd
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
%th Type
|
%th Type
|
||||||
%th Start Date
|
%th Start Date
|
||||||
%th End Date
|
%th End Date
|
||||||
|
%th Description
|
||||||
%th Days Left
|
%th Days Left
|
||||||
%th Actions
|
%th Actions
|
||||||
%tbody
|
%tbody
|
||||||
|
|
@ -24,6 +25,9 @@
|
||||||
= cfp.start_date.strftime('%A, %B %-d. %Y')
|
= cfp.start_date.strftime('%A, %B %-d. %Y')
|
||||||
%td
|
%td
|
||||||
= cfp.end_date.strftime('%A, %B %-d. %Y')
|
= cfp.end_date.strftime('%A, %B %-d. %Y')
|
||||||
|
%td
|
||||||
|
%p
|
||||||
|
= markdown(truncate(cfp.description))
|
||||||
%td
|
%td
|
||||||
= pluralize(cfp.remaining_days, 'day')
|
= pluralize(cfp.remaining_days, 'day')
|
||||||
%td
|
%td
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,11 @@
|
||||||
= f.input :timezone, as: :time_zone, hint: 'The conference time zone'
|
= f.input :timezone, as: :time_zone, hint: 'The conference time zone'
|
||||||
= f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', readonly: 'readonly' }
|
= f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', readonly: 'readonly' }
|
||||||
= f.input :end_date, as: :string, input_html: { id: 'conference-end-datepicker', readonly: 'readonly' }
|
= f.input :end_date, as: :string, input_html: { id: 'conference-end-datepicker', readonly: 'readonly' }
|
||||||
= f.input :start_hour, input_html: {size: 2, type: 'number', min: 0, max: 23}
|
= f.input :start_hour, input_html: {size: 2, type: 'number', min: 0, max: 23}, hint: rescheduling_hint(@affected_event_count)
|
||||||
= f.input :end_hour, input_html: {size: 2, type: 'number', min: 1, max: 24}
|
= f.input :end_hour, input_html: {size: 2, type: 'number', min: 1, max: 24}, hint: rescheduling_hint(@affected_event_count)
|
||||||
= f.inputs name: 'Registrations' do
|
= f.inputs name: 'Registrations' do
|
||||||
= f.input :registration_limit, as: :number, in: 0..9999, hint: 'Limit the number of registrations to the conference (0 no limit). Please note that the registration limit doesn\'t apply to speakers of confirmed events (they will still be able to register even if it has been reached). You currently have ' + pluralize(@conference.registrations.count, 'registration')
|
= f.input :registration_limit, as: :number, in: 0..9999, hint: 'Limit the number of registrations to the conference (0 no limit). Please note that the registration limit doesn\'t apply to speakers of confirmed events (they will still be able to register even if it has been reached). You currently have ' + pluralize(@conference.registrations.count, 'registration')
|
||||||
= f.inputs name: 'Booths' do
|
= f.inputs name: 'Booths' do
|
||||||
= f.input :booth_limit, as: :number, in: 0..9999,
|
= f.input :booth_limit, as: :number, in: 0..9999,
|
||||||
hint: 'Booth limit is the maximum number of booths that you can accept for this conference. By setting this number (0 no limit) you can be sure that you are not going to accept more booths than the conference can accommodate. You currently have ' + pluralize(@conference.booths.accepted.count, 'accepted booth') +'.'
|
hint: 'Booth limit is the maximum number of booths that you can accept for this conference. By setting this number (0 no limit) you can be sure that you are not going to accept more booths than the conference can accommodate. You currently have ' + pluralize(@conference.booths.accepted.count, 'accepted booth') +'.'
|
||||||
= f.action :submit, as: :button, button_html: {class: 'btn btn-primary'}
|
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary', data: { confirm: 'Are you sure you want to proceed?' } }
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,16 @@
|
||||||
= javascript_include_tag "application"
|
= javascript_include_tag "application"
|
||||||
|
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
:javascript
|
|
||||||
window.liveSettings = {
|
|
||||||
api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}",
|
|
||||||
picker: "bottom-right",
|
|
||||||
detectlang: true,
|
|
||||||
autocollect: true
|
|
||||||
};
|
|
||||||
= content_for(:script_head)
|
= content_for(:script_head)
|
||||||
= javascript_include_tag "//cdn.transifex.com/live.js"
|
- if ENV['OSEM_TRANSIFEX_APIKEY']
|
||||||
|
:javascript
|
||||||
|
window.liveSettings = {
|
||||||
|
api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}",
|
||||||
|
picker: "bottom-right",
|
||||||
|
detectlang: true,
|
||||||
|
autocollect: true
|
||||||
|
};
|
||||||
|
= javascript_include_tag "//cdn.transifex.com/live.js"
|
||||||
|
|
||||||
= yield(:head)
|
= yield(:head)
|
||||||
%body
|
%body
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,14 @@
|
||||||
%span.notranslate
|
%span.notranslate
|
||||||
= @conference.title
|
= @conference.title
|
||||||
|
|
||||||
|
|
||||||
|
- if @program.cfp_open?
|
||||||
|
- if @program.cfp.description.present?
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= markdown(@program.cfp.description)
|
||||||
|
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= render partial: 'encouragement_text'
|
= render partial: 'encouragement_text'
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,11 @@
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.page-header
|
.page-header
|
||||||
%h1 New Proposal
|
%h1 New Proposal
|
||||||
|
- if @program.cfp_open?
|
||||||
|
- if @program.cfp.description.present?
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= markdown(@program.cfp.description)
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= render partial: 'encouragement_text'
|
= render partial: 'encouragement_text'
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,8 @@
|
||||||
.col-md-8
|
.col-md-8
|
||||||
%h4
|
%h4
|
||||||
= link_to speaker.name, user_path(speaker.id)
|
= link_to speaker.name, user_path(speaker.id)
|
||||||
= "(#{speaker.email})"
|
- if speaker.email_public?
|
||||||
|
= "(#{speaker.email})"
|
||||||
- if speaker.affiliation?
|
- if speaker.affiliation?
|
||||||
.text-muted
|
.text-muted
|
||||||
from
|
from
|
||||||
|
|
|
||||||
5
db/migrate/20170905110034_add_description_to_cfps.rb
Normal file
5
db/migrate/20170905110034_add_description_to_cfps.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddDescriptionToCfps < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :cfps, :description, :text
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -68,12 +68,13 @@ ActiveRecord::Schema.define(version: 20170924190528) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "cfps", force: :cascade do |t|
|
create_table "cfps", force: :cascade do |t|
|
||||||
t.date "start_date", null: false
|
t.date "start_date", null: false
|
||||||
t.date "end_date", null: false
|
t.date "end_date", null: false
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "program_id"
|
t.integer "program_id"
|
||||||
t.string "cfp_type"
|
t.string "cfp_type"
|
||||||
|
t.text "description"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "comments", force: :cascade do |t|
|
create_table "comments", force: :cascade do |t|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ FactoryGirl.define do
|
||||||
start_date { 1.day.ago }
|
start_date { 1.day.ago }
|
||||||
end_date { 2.days.from_now }
|
end_date { 2.days.from_now }
|
||||||
cfp_type 'events'
|
cfp_type 'events'
|
||||||
|
description 'This is a test description'
|
||||||
program
|
program
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -66,12 +66,12 @@ describe ApplicationHelper, type: :helper do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should use the environment variable' do
|
it 'should use the environment variable' do
|
||||||
ENV['OSEM_NAME'] = Faker::Company.name
|
ENV['OSEM_NAME'] = Faker::Company.name + "'"
|
||||||
expect(nav_root_link_for(nil)).to match ENV['OSEM_NAME']
|
expect(nav_root_link_for(nil)).to match h(ENV['OSEM_NAME'])
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should use the conference organization name' do
|
it 'should use the conference organization name' do
|
||||||
expect(nav_root_link_for(conference)).to match conference.organization.name
|
expect(nav_root_link_for(conference)).to match h(conference.organization.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ describe Program do
|
||||||
it { is_expected.to have_many(:events).dependent(:destroy) }
|
it { is_expected.to have_many(:events).dependent(:destroy) }
|
||||||
it { is_expected.to have_many(:event_schedules).through(:events) }
|
it { is_expected.to have_many(:event_schedules).through(:events) }
|
||||||
it { is_expected.to have_many(:event_users).through(:events) }
|
it { is_expected.to have_many(:event_users).through(:events) }
|
||||||
it { is_expected.to have_many(:speakers).through(:event_users).source(:user) }
|
it { is_expected.to have_many(:program_events_speakers).through(:events).source(:event_users) }
|
||||||
|
it { is_expected.to have_many(:speakers).through(:program_events_speakers).source(:user) }
|
||||||
it { is_expected.to accept_nested_attributes_for(:event_types) }
|
it { is_expected.to accept_nested_attributes_for(:event_types) }
|
||||||
it { is_expected.to accept_nested_attributes_for(:tracks) }
|
it { is_expected.to accept_nested_attributes_for(:tracks) }
|
||||||
it { is_expected.to accept_nested_attributes_for(:difficulty_levels) }
|
it { is_expected.to accept_nested_attributes_for(:difficulty_levels) }
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ require 'phantomjs'
|
||||||
# makes it easier to control when PaperTrail is enabled during testing.
|
# makes it easier to control when PaperTrail is enabled during testing.
|
||||||
require 'paper_trail/frameworks/rspec'
|
require 'paper_trail/frameworks/rspec'
|
||||||
|
|
||||||
|
# Make htmlescape() available
|
||||||
|
require 'erb'
|
||||||
|
include ERB::Util
|
||||||
|
|
||||||
# Requires supporting ruby files with custom matchers and macros, etc, in
|
# Requires supporting ruby files with custom matchers and macros, etc, in
|
||||||
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
||||||
# run as spec files by default. This means that files in spec/support that end
|
# run as spec files by default. This means that files in spec/support that end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue