Merge pull request #562 from differentreality/highlights_cfp
add highlights and fix cfp in splashpage
This commit is contained in:
commit
6076e29733
26 changed files with 206 additions and 67 deletions
3
Gemfile
3
Gemfile
|
|
@ -121,6 +121,9 @@ gem 'money-rails'
|
||||||
# for lists
|
# for lists
|
||||||
gem 'acts_as_list'
|
gem 'acts_as_list'
|
||||||
|
|
||||||
|
# for switch checkboxes
|
||||||
|
gem 'bootstrap-switch-rails', '~> 3.0.0'
|
||||||
|
|
||||||
# Use guard and spring for testing in development
|
# Use guard and spring for testing in development
|
||||||
group :development do
|
group :development do
|
||||||
# rspec Guard rules
|
# rspec Guard rules
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ GEM
|
||||||
bcrypt (3.1.7)
|
bcrypt (3.1.7)
|
||||||
bootstrap-sass (3.3.1.0)
|
bootstrap-sass (3.3.1.0)
|
||||||
sass (~> 3.2)
|
sass (~> 3.2)
|
||||||
|
bootstrap-switch-rails (3.0.2)
|
||||||
bootstrap3-datetimepicker-rails (3.0.3)
|
bootstrap3-datetimepicker-rails (3.0.3)
|
||||||
momentjs-rails (>= 2.8.1)
|
momentjs-rails (>= 2.8.1)
|
||||||
browser (0.6.0)
|
browser (0.6.0)
|
||||||
|
|
@ -438,6 +439,7 @@ DEPENDENCIES
|
||||||
awesome_nested_set (~> 3.0.0.rc.5)
|
awesome_nested_set (~> 3.0.0.rc.5)
|
||||||
axlsx_rails
|
axlsx_rails
|
||||||
bootstrap-sass
|
bootstrap-sass
|
||||||
|
bootstrap-switch-rails (~> 3.0.0)
|
||||||
bootstrap3-datetimepicker-rails (~> 3.0.2)
|
bootstrap3-datetimepicker-rails (~> 3.0.2)
|
||||||
byebug
|
byebug
|
||||||
cancancan
|
cancancan
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@
|
||||||
//= require osem-datepickers
|
//= require osem-datepickers
|
||||||
//= require osem-datatables
|
//= require osem-datatables
|
||||||
//= require osem-tickets
|
//= require osem-tickets
|
||||||
|
//= require bootstrap-switch
|
||||||
|
//= require osem-switch
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('a[disabled=disabled]').click(function(event){
|
$('a[disabled=disabled]').click(function(event){
|
||||||
|
|
|
||||||
16
app/assets/javascripts/osem-switch.js
Normal file
16
app/assets/javascripts/osem-switch.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
$(function () {
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("[class='switch-checkbox']").bootstrapSwitch();
|
||||||
|
|
||||||
|
$('input[class="switch-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
|
||||||
|
url = "/admin/conference/" + this.name + "/events/" + this.value
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: 'PATCH',
|
||||||
|
data: { event: { is_highlight: state } },
|
||||||
|
dataType: 'script'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -13,4 +13,5 @@
|
||||||
*= require bootstrap-markdown.min
|
*= require bootstrap-markdown.min
|
||||||
*= require bootstrap-datetimepicker
|
*= require bootstrap-datetimepicker
|
||||||
*= require leaflet
|
*= require leaflet
|
||||||
|
*= require bootstrap3-switch
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -53,4 +53,6 @@ body {
|
||||||
|
|
||||||
fieldset {
|
fieldset {
|
||||||
margin: 20px 0 20px 0;
|
margin: 20px 0 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bootstrap-switch { height: 1.7em }
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ module Admin
|
||||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||||
@events = @conference.events
|
@events = @conference.events
|
||||||
@tracks = @conference.tracks
|
@tracks = @conference.tracks
|
||||||
|
@difficulty_levels = @conference.difficulty_levels
|
||||||
@machine_states = @events.state_machine.states.map
|
@machine_states = @events.state_machine.states.map
|
||||||
@event_types = @conference.event_types
|
@event_types = @conference.event_types
|
||||||
|
|
||||||
|
|
@ -104,24 +105,20 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if params.has_key? :track_id
|
if @event.submitter.update_attributes(params[:user]) &&
|
||||||
@event.update_attribute(:track_id, params[:track_id])
|
@event.update_attributes(params[:event])
|
||||||
end
|
|
||||||
if params.has_key? :event_type_id
|
|
||||||
@event.update_attribute(:event_type_id, params[:event_type_id])
|
|
||||||
end
|
|
||||||
if params.has_key? :difficulty_level_id
|
|
||||||
@event.update_attribute(:difficulty_level_id, params[:difficulty_level_id])
|
|
||||||
end
|
|
||||||
|
|
||||||
if @event.submitter.update_attributes!(params[:user]) && @event.
|
if request.xhr?
|
||||||
update_attributes!(params[:event])
|
render js: 'index'
|
||||||
flash[:notice] = "Successfully updated #{@event.title}."
|
else
|
||||||
|
flash[:notice] = "Successfully updated event with ID #{@event.id}."
|
||||||
|
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event))
|
||||||
|
end
|
||||||
else
|
else
|
||||||
flash[:notice] = 'Update not successful.'
|
@url = admin_conference_event_path(@conference.short_title, @event)
|
||||||
|
flash[:notice] = 'Update not successful. ' + @event.errors.full_messages.to_sentence
|
||||||
|
render :edit
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create; end
|
def create; end
|
||||||
|
|
@ -183,11 +180,11 @@ module Admin
|
||||||
alert = @event.update_state(transition, mail, subject, send_mail, params[:send_mail].blank?)
|
alert = @event.update_state(transition, mail, subject, send_mail, params[:send_mail].blank?)
|
||||||
|
|
||||||
if !alert.blank?
|
if !alert.blank?
|
||||||
return redirect_to(admin_conference_events_path(conference_id: @conference.short_title),
|
flash[:error] = error
|
||||||
alert: alert) && return
|
return redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
|
||||||
else
|
else
|
||||||
redirect_to(admin_conference_events_path(conference_id: @conference.short_title),
|
flash[:notice] = notice
|
||||||
notice: notice) && return
|
redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,7 @@ class ConferenceController < ApplicationController
|
||||||
@antiquated = @conferences - @current
|
@antiquated = @conferences - @current
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show; end
|
||||||
@keynote_speakers = @conference.keynote_speakers
|
|
||||||
end
|
|
||||||
|
|
||||||
def schedule
|
def schedule
|
||||||
@rooms = @conference.rooms
|
@rooms = @conference.rooms
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,10 @@ class Conference < ActiveRecord::Base
|
||||||
def confirmed
|
def confirmed
|
||||||
where(state: :confirmed)
|
where(state: :confirmed)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def highlights
|
||||||
|
where(state: :confirmed, is_highlight: true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
has_many :event_users, through: :events
|
has_many :event_users, through: :events
|
||||||
has_many :speakers, -> { distinct }, through: :event_users, source: :user do
|
has_many :speakers, -> { distinct }, through: :event_users, source: :user do
|
||||||
|
|
@ -559,10 +563,6 @@ class Conference < ActiveRecord::Base
|
||||||
email_settings.updated_conference_registration_dates_template
|
email_settings.updated_conference_registration_dates_template
|
||||||
end
|
end
|
||||||
|
|
||||||
def keynote_speakers
|
|
||||||
User.with_role(:keynote_speaker, self)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
after_create do
|
after_create do
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
class Event < ActiveRecord::Base
|
class Event < ActiveRecord::Base
|
||||||
include ActiveRecord::Transitions
|
include ActiveRecord::Transitions
|
||||||
has_paper_trail
|
has_paper_trail
|
||||||
attr_accessible :title, :subtitle, :abstract, :description, :event_type_id, :users_attributes,
|
attr_accessible :title, :subtitle, :abstract, :description, :user, :users_attributes,
|
||||||
:user, :proposal_additional_speakers, :track_id,
|
:proposal_additional_speakers, :event_type_id, :track_id,
|
||||||
:require_registration, :difficulty_level_id
|
:difficulty_level_id, :require_registration, :is_highlight
|
||||||
|
|
||||||
acts_as_commentable
|
acts_as_commentable
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
class Splashpage < ActiveRecord::Base
|
class Splashpage < ActiveRecord::Base
|
||||||
belongs_to :conference
|
belongs_to :conference
|
||||||
attr_accessible :public,
|
attr_accessible :public,
|
||||||
:include_tracks, :include_program,
|
:include_tracks, :include_program, :include_cfp,
|
||||||
:include_venue, :include_registrations,
|
:include_venue, :include_registrations,
|
||||||
:include_tickets, :include_lodgings,
|
:include_tickets, :include_lodgings,
|
||||||
:include_sponsors, :include_social_media
|
:include_sponsors, :include_social_media
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
= semantic_form_for(@call_for_paper, :url => admin_conference_call_for_paper_path(@conference.short_title),:html => {:multipart => true}) do |f|
|
= semantic_form_for(@call_for_paper, :url => admin_conference_call_for_paper_path(@conference.short_title),:html => {:multipart => true}) do |f|
|
||||||
= 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 :include_cfp_in_splash, label: "Show Call for Papers on the splash page"
|
|
||||||
= f.input :schedule_public, label: "Show Schedule on the home and splash page"
|
= f.input :schedule_public, label: "Show Schedule on the home and splash page"
|
||||||
= f.input :schedule_changes, label: "Allow submitters to change their event after it is scheduled"
|
= f.input :schedule_changes, label: "Allow submitters to change their event after it is scheduled"
|
||||||
= f.input :rating, :hint => "Enter the number of different rating levels you want to have for voting on proposals. Enter 0 if you do not want to vote on proposals."
|
= f.input :rating, :hint => "Enter the number of different rating levels you want to have for voting on proposals. Enter 0 if you do not want to vote on proposals."
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,6 @@
|
||||||
Tracks:
|
Tracks:
|
||||||
%dd
|
%dd
|
||||||
= tracks(@conference)
|
= tracks(@conference)
|
||||||
%dt
|
|
||||||
Public
|
|
||||||
%dd#cfp_in_splash
|
|
||||||
- if @call_for_paper.include_cfp_in_splash
|
|
||||||
True
|
|
||||||
- else
|
|
||||||
False
|
|
||||||
%dt
|
%dt
|
||||||
Public Schedule
|
Public Schedule
|
||||||
%dd#schedule_public
|
%dd#schedule_public
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
= event_type.length
|
= event_type.length
|
||||||
Minutes
|
Minutes
|
||||||
%td
|
%td
|
||||||
= "#{event_type.minimum_abstract_length}:#{event_type.maximum_abstract_length}"
|
= "#{event_type.minimum_abstract_length} - #{event_type.maximum_abstract_length}"
|
||||||
Words
|
Words
|
||||||
%td
|
%td
|
||||||
%span.label{style: "background-color: #{event_type.color};"}
|
%span.label{style: "background-color: #{event_type.color};"}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,21 @@
|
||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
- @event_types.each do |type|
|
- @event_types.each do |type|
|
||||||
%li= link_to type.title, admin_conference_event_path(@conference.short_title, @event, :event_type_id => type.id) ,
|
%li= link_to type.title,
|
||||||
:method => :put, :event_type_id => type.id
|
admin_conference_event_path(@conference.short_title,
|
||||||
|
@event,
|
||||||
|
event: { event_type_id: type.id }),
|
||||||
|
method: :patch
|
||||||
|
%tr
|
||||||
|
%td
|
||||||
|
%b Highlight
|
||||||
|
%td
|
||||||
|
= check_box_tag @conference.short_title, @event.id, @event.is_highlight, class: 'switch-checkbox',
|
||||||
|
data: { size: "small",
|
||||||
|
off_color: 'warning',
|
||||||
|
on_text: 'Yes',
|
||||||
|
off_text: 'No' }
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
%b State
|
%b State
|
||||||
|
|
@ -48,8 +61,11 @@
|
||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
- @tracks.each do |track|
|
- @tracks.each do |track|
|
||||||
%li= link_to track.name, admin_conference_event_path(@conference.short_title, @event, :track_id => track.id) ,
|
%li= link_to track.name,
|
||||||
:method => :put, :track_id => track.id
|
admin_conference_event_path(@conference.short_title,
|
||||||
|
@event,
|
||||||
|
event: { track_id: track.id }),
|
||||||
|
method: :patch
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
%b Difficulty
|
%b Difficulty
|
||||||
|
|
@ -63,8 +79,10 @@
|
||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
- @difficulty_levels.each do |difficulty|
|
- @difficulty_levels.each do |difficulty|
|
||||||
%li= link_to difficulty.title, admin_conference_event_path(@conference.short_title, @event, :difficulty_level_id => difficulty.id) ,
|
%li= link_to difficulty.title, admin_conference_event_path(@conference.short_title,
|
||||||
:method => :put, :difficulty_level_id => difficulty.id
|
@event,
|
||||||
|
event: { difficulty_level_id: difficulty.id }),
|
||||||
|
method: :patch
|
||||||
- if !@event.room.nil?
|
- if !@event.room.nil?
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@
|
||||||
%b Submitter
|
%b Submitter
|
||||||
%th
|
%th
|
||||||
%b Speaker
|
%b Speaker
|
||||||
|
%th
|
||||||
|
%b Highlight
|
||||||
%th
|
%th
|
||||||
%b Type
|
%b Type
|
||||||
%th
|
%th
|
||||||
|
|
@ -70,6 +72,13 @@
|
||||||
= link_to speaker.name, admin_user_path(speaker)
|
= link_to speaker.name, admin_user_path(speaker)
|
||||||
- else
|
- else
|
||||||
Unknown speaker
|
Unknown speaker
|
||||||
|
%td{'data-order' => "#{event.is_highlight}"}
|
||||||
|
= check_box_tag @conference.short_title, event.id, event.is_highlight, class: 'switch-checkbox',
|
||||||
|
data: { size: "small",
|
||||||
|
off_color: 'warning',
|
||||||
|
on_text: 'Yes',
|
||||||
|
off_text: 'No' }
|
||||||
|
|
||||||
%td
|
%td
|
||||||
.btn-group
|
.btn-group
|
||||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||||
|
|
@ -80,8 +89,11 @@
|
||||||
%span.caret
|
%span.caret
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
- @event_types.each do |type|
|
- @event_types.each do |type|
|
||||||
%li= link_to type.title, admin_conference_event_path(@conference.short_title, event, :event_type_id => type.id) ,
|
%li= link_to type.title,
|
||||||
:method => :put, :event_type_id => type.id
|
admin_conference_event_path(@conference.short_title,
|
||||||
|
event,
|
||||||
|
event: { event_type_id: type.id }),
|
||||||
|
method: :patch
|
||||||
%td
|
%td
|
||||||
.btn-group
|
.btn-group
|
||||||
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||||
|
|
@ -92,10 +104,27 @@
|
||||||
%span.caret
|
%span.caret
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
- @tracks.each do |track|
|
- @tracks.each do |track|
|
||||||
%li= link_to track.name, admin_conference_event_path(@conference.short_title, event, :track_id => track.id) ,
|
%li= link_to track.name,
|
||||||
:method => :put, :track_id => track.id
|
admin_conference_event_path(@conference.short_title,
|
||||||
|
event,
|
||||||
|
event: { track_id: track.id }),
|
||||||
|
method: :patch
|
||||||
%td
|
%td
|
||||||
= event.difficulty_level.title if event.difficulty_level
|
.btn-group
|
||||||
|
%button{:type=>"button", :class=>"btn btn-link dropdown-toggle", "data-toggle"=>"dropdown"}
|
||||||
|
- if event.difficulty_level.nil?
|
||||||
|
Difficulty
|
||||||
|
- else
|
||||||
|
= event.difficulty_level.title
|
||||||
|
%span.caret
|
||||||
|
%ul.dropdown-menu
|
||||||
|
- @difficulty_levels.each do |difficulty_level|
|
||||||
|
%li= link_to difficulty_level.title,
|
||||||
|
admin_conference_event_path(@conference.short_title,
|
||||||
|
event,
|
||||||
|
event: { difficulty_level_id: difficulty_level.id }),
|
||||||
|
method: :patch
|
||||||
|
|
||||||
%td
|
%td
|
||||||
- if event.state == "withdrawn"
|
- if event.state == "withdrawn"
|
||||||
Withdrawn
|
Withdrawn
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
= f.inputs name: 'Components' do
|
= f.inputs name: 'Components' do
|
||||||
= f.input :include_tracks, label: 'Display tracks on the splashpage?'
|
= f.input :include_tracks, label: 'Display tracks on the splashpage?'
|
||||||
= f.input :include_program, label: 'Display program on the splashpage?'
|
= f.input :include_program, label: 'Display program on the splashpage?'
|
||||||
|
= f.input :include_cfp, label: 'Display call for papers information on splashpage, while cfp is open?'
|
||||||
= f.input :include_venue, label: 'Display venue on the splashpage?'
|
= f.input :include_venue, label: 'Display venue on the splashpage?'
|
||||||
= f.input :include_registrations, label: 'Display the registration period on the splashpage?'
|
= f.input :include_registrations, label: 'Display the registration period on the splashpage?'
|
||||||
= f.input :include_tickets, label: 'Display tickets on the splashpage?'
|
= f.input :include_tickets, label: 'Display tickets on the splashpage?'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
.page-header
|
.page-header
|
||||||
%h1 Splashpage
|
%h1 Splashpage
|
||||||
%p.text-muted
|
%p.text-muted
|
||||||
Build a
|
Build a
|
||||||
= link_to "splash page", conference_path(@conference.short_title)
|
= link_to "splash page", conference_path(@conference.short_title)
|
||||||
with all the information for your conference
|
with all the information for your conference
|
||||||
- if @splashpage
|
- if @splashpage
|
||||||
|
|
@ -45,6 +45,13 @@
|
||||||
Yes
|
Yes
|
||||||
- else
|
- else
|
||||||
No
|
No
|
||||||
|
%dt
|
||||||
|
Include CFP:
|
||||||
|
%dd
|
||||||
|
- if @splashpage.include_cfp
|
||||||
|
Yes
|
||||||
|
- else
|
||||||
|
No
|
||||||
%dt
|
%dt
|
||||||
Include Social Media:
|
Include Social Media:
|
||||||
%dd
|
%dd
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,22 @@
|
||||||
= link_to(schedule_conference_path(@conference.short_title), class: 'btn btn-default btn-lg') do
|
= link_to(schedule_conference_path(@conference.short_title), class: 'btn btn-default btn-lg') do
|
||||||
Full Schedule
|
Full Schedule
|
||||||
|
|
||||||
- #FIXME: Display keynotes https://github.com/openSUSE/osem/issues/544
|
|
||||||
- #FIXME: Display schedule highlights https://github.com/openSUSE/osem/issues/545
|
|
||||||
|
|
||||||
|
%h3.text-center
|
||||||
|
Don't miss out!
|
||||||
|
%br
|
||||||
|
- if @conference.events.highlights.any?
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
- @conference.events.highlights.each_slice(2) do |slice|
|
||||||
|
.row.row-centered
|
||||||
|
- slice.each do |event|
|
||||||
|
.col-md-6.col-centered.col-top.highlights
|
||||||
|
%p.text-center
|
||||||
|
%b= event.title
|
||||||
|
%h5.text-center
|
||||||
|
= simple_format truncate(event.abstract, length: 500, separator: ' ')
|
||||||
|
= link_to "Read More", conference_proposal_path(@conference.short_title, event)
|
||||||
|
|
||||||
= content_for :splash_nav do
|
= content_for :splash_nav do
|
||||||
%li
|
%li
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
%section#program
|
%section#program
|
||||||
= render 'program'
|
= render 'program'
|
||||||
|
|
||||||
- if @conference.cfp_open? and @conference.call_for_paper.include_cfp_in_splash?
|
- if @conference.cfp_open? and @conference.splashpage.include_cfp
|
||||||
%section#callforpapers
|
%section#callforpapers
|
||||||
= render 'call_for_paper'
|
= render 'call_for_paper'
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
%section#sponsors
|
%section#sponsors
|
||||||
= render 'sponsors'
|
= render 'sponsors'
|
||||||
|
|
||||||
- if @conference.splashpage.include_social_media and @conference.contact.has_social_media?
|
- if @conference.contact.has_social_media? and @conference.splashpage.include_social_media
|
||||||
%section#social-media
|
%section#social-media
|
||||||
= render 'social_media'
|
= render 'social_media'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
%meta{:content => "", :name => "author"}
|
%meta{:content => "", :name => "author"}
|
||||||
= stylesheet_link_tag "application", :media => "all"
|
= stylesheet_link_tag "application", :media => "all"
|
||||||
= javascript_include_tag "application"
|
= javascript_include_tag "application"
|
||||||
|
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
:javascript
|
:javascript
|
||||||
window.liveSettings = {
|
window.liveSettings = {
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,18 @@
|
||||||
%section#details
|
%section#details
|
||||||
- if can? :update, @event or can? :create, @event
|
- if can? :update, @event or can? :create, @event
|
||||||
= f.input :event_type_id, as: :select,
|
= f.input :event_type_id, as: :select,
|
||||||
collection: @conference.event_types.map {|x| ["#{x.title} - #{show_time(x.length)}", x.id,
|
collection: @conference.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
|
||||||
data: { min_words: x.minimum_abstract_length, max_words: x.maximum_abstract_length }]},
|
data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]},
|
||||||
include_blank: false, label: 'Session Type'
|
include_blank: false, label: 'Session Type'
|
||||||
- else
|
- else
|
||||||
Event type: #{@event.event_type.title}
|
Event type: #{@event.event_type.title}
|
||||||
|
|
||||||
|
- if current_user.has_any_role? :admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference }
|
||||||
|
= f.label :is_highlight
|
||||||
%br
|
%br
|
||||||
%br
|
= f.check_box :is_highlight, class: 'switch-checkbox', data: { size: "small" }
|
||||||
|
|
||||||
|
%br
|
||||||
= f.input :difficulty_level, :as => :select, :collection => @conference.difficulty_levels, :include_blank => "(Please select)" if @conference.difficulty_levels.any?
|
= f.input :difficulty_level, :as => :select, :collection => @conference.difficulty_levels, :include_blank => "(Please select)" if @conference.difficulty_levels.any?
|
||||||
= f.input :require_registration
|
= f.input :require_registration
|
||||||
= f.input :abstract, :input_html => {:rows => 5, :class => "span11"},
|
= f.input :abstract, :input_html => {:rows => 5, :class => "span11"},
|
||||||
|
|
|
||||||
5
db/migrate/20141127161313_add_is_highlight_in_events.rb
Normal file
5
db/migrate/20141127161313_add_is_highlight_in_events.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddIsHighlightInEvents < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :events, :is_highlight, :boolean, default: false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
class MigrateDataRemoveColumnIncludeCfpInSplashAddColumnIncludeCfp < ActiveRecord::Migration
|
||||||
|
class TempConference < ActiveRecord::Base
|
||||||
|
self.table_name = 'conferences'
|
||||||
|
end
|
||||||
|
|
||||||
|
class TempCallForPaper< ActiveRecord::Base
|
||||||
|
self.table_name = 'call_for_papers'
|
||||||
|
end
|
||||||
|
|
||||||
|
class TempSplashpage < ActiveRecord::Base
|
||||||
|
self.table_name = 'splashpages'
|
||||||
|
attr_accessible :conference_id
|
||||||
|
end
|
||||||
|
|
||||||
|
def up
|
||||||
|
add_column :splashpages, :include_cfp, :boolean, default: false
|
||||||
|
|
||||||
|
TempConference.all.each do |conference|
|
||||||
|
cfp = TempCallForPaper.find_by(conference_id: conference.id)
|
||||||
|
|
||||||
|
if cfp && cfp.include_cfp_in_splash
|
||||||
|
splashpage = TempSplashpage.find_or_initialize_by(conference_id: conference.id)
|
||||||
|
splashpage.include_cfp = cfp.include_cfp_in_splash # true
|
||||||
|
splashpage.save!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
remove_column :call_for_papers, :include_cfp_in_splash, :boolean, default: false
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
add_column :call_for_papers, :include_cfp_in_splash, :boolean, default: false
|
||||||
|
|
||||||
|
TempConference.all.each do |conference|
|
||||||
|
splashpage = TempSplashpage.find_by(conference_id: conference.id)
|
||||||
|
cfp = TempCallForPaper.find_by(conference_id: conference.id)
|
||||||
|
|
||||||
|
if splashpage && cfp
|
||||||
|
cfp.include_cfp_in_splash = splashpage.include_cfp
|
||||||
|
cfp.save!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
remove_column :splashpages, :include_cfp, :boolean, default: false
|
||||||
|
end
|
||||||
|
end
|
||||||
11
db/schema.rb
11
db/schema.rb
|
|
@ -32,15 +32,14 @@ ActiveRecord::Schema.define(version: 20141130182139) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "call_for_papers", force: true do |t|
|
create_table "call_for_papers", force: true 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.integer "conference_id"
|
t.integer "conference_id"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.boolean "schedule_changes", default: false
|
t.boolean "schedule_changes", default: false
|
||||||
t.integer "rating", default: 3
|
t.integer "rating", default: 3
|
||||||
t.boolean "schedule_public"
|
t.boolean "schedule_public"
|
||||||
t.boolean "include_cfp_in_splash", default: false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "campaigns", force: true do |t|
|
create_table "campaigns", force: true do |t|
|
||||||
|
|
@ -234,6 +233,7 @@ ActiveRecord::Schema.define(version: 20141130182139) do
|
||||||
t.boolean "require_registration"
|
t.boolean "require_registration"
|
||||||
t.integer "difficulty_level_id"
|
t.integer "difficulty_level_id"
|
||||||
t.integer "week"
|
t.integer "week"
|
||||||
|
t.boolean "is_highlight", default: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "events_registrations", id: false, force: true do |t|
|
create_table "events_registrations", id: false, force: true do |t|
|
||||||
|
|
@ -378,6 +378,7 @@ ActiveRecord::Schema.define(version: 20141130182139) do
|
||||||
t.boolean "include_lodgings"
|
t.boolean "include_lodgings"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
t.boolean "include_cfp", default: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "sponsors", force: true do |t|
|
create_table "sponsors", force: true do |t|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ describe 'conference/show.html.haml' do
|
||||||
include_tickets: true,
|
include_tickets: true,
|
||||||
include_social_media: true,
|
include_social_media: true,
|
||||||
include_venue: true,
|
include_venue: true,
|
||||||
include_lodgings: true)
|
include_lodgings: true,
|
||||||
|
include_cfp: true)
|
||||||
|
|
||||||
@conference.contact.update(sponsor_email: 'example@example.com',
|
@conference.contact.update(sponsor_email: 'example@example.com',
|
||||||
facebook: 'http://facebook.com',
|
facebook: 'http://facebook.com',
|
||||||
|
|
@ -24,8 +25,7 @@ describe 'conference/show.html.haml' do
|
||||||
start_date: Date.yesterday,
|
start_date: Date.yesterday,
|
||||||
end_date: Date.tomorrow)
|
end_date: Date.tomorrow)
|
||||||
|
|
||||||
@conference.call_for_paper = create(:call_for_paper, conference: @conference,
|
@conference.call_for_paper = create(:call_for_paper, conference: @conference)
|
||||||
include_cfp_in_splash: true)
|
|
||||||
|
|
||||||
@conference.sponsorship_levels << create(:sponsorship_level, conference: @conference)
|
@conference.sponsorship_levels << create(:sponsorship_level, conference: @conference)
|
||||||
@sponsorship_level = @conference.sponsorship_levels.first
|
@sponsorship_level = @conference.sponsorship_levels.first
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue