Merge pull request #827 from hennevogel/feature-proposal_for_track

Feature: Add/change Track for Event
This commit is contained in:
Christian Bruckmayer 2016-03-07 17:12:33 +01:00
commit 9fbd2e9618
5 changed files with 17 additions and 22 deletions

View file

@ -140,7 +140,7 @@ class ProposalController < ApplicationController
private
def event_params
params.require(:event).permit(:title, :subtitle, :event_type_id, :abstract, :description, :require_registration, :difficulty_level_id)
params.require(:event).permit(:title, :subtitle, :track_id, :event_type_id, :abstract, :description, :require_registration, :difficulty_level_id)
end
def user_params

View file

@ -190,6 +190,7 @@ class Event < ActiveRecord::Base
commercials: self.commercials.any?,
biography: !self.submitter.biography.blank?,
subtitle: !self.subtitle.blank?,
track: !self.track.blank?,
difficulty_level: !self.difficulty_level.blank?,
title: true,
abstract: true

View file

@ -4,6 +4,11 @@
= f.input :subtitle, as: :string
- if @program.tracks.any?
= f.input :track_id, as: :select,
collection: @program.tracks.map {|track| ["#{track.name}", track.id] },
include_blank: true
= f.input :event_type_id, as: :select,
collection: @conference.program.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 }]},

View file

@ -3,33 +3,21 @@
%li{'class'=>class_for_todo(progress_status['registered'])}
%span{'class'=>icon_for_todo(progress_status['registered'])}
- if progress_status['registered']
= link_to 'Edit your registration', edit_conference_conference_registrations_path(event.program.conference.short_title)
= link_to 'Register to the conference', edit_conference_conference_registrations_path(event.program.conference.short_title)
- else
= link_to 'Register to the conference', new_conference_conference_registrations_path(event.program.conference.short_title)
%li{'class'=>class_for_todo(progress_status['biography'])}
%span{'class'=>icon_for_todo(progress_status['biography'])}
- if progress_status['biography']
= link_to 'Edit your biography', edit_user_path(event.submitter)
- else
= link_to 'Fill out your biography', edit_user_path(event.submitter)
= link_to 'Fill out your biography', edit_user_path(event.submitter)
%li{'class'=>class_for_todo(progress_status['subtitle'])}
%span{'class'=>icon_for_todo(progress_status['subtitle'])}
- if progress_status['subtitle']
= link_to 'Edit the subtitle', edit_conference_program_proposal_path(event.program.conference.short_title, event)
- else
= link_to 'Add a subtitle', edit_conference_program_proposal_path(event.program.conference.short_title, event)
= link_to 'Add a subtitle', edit_conference_program_proposal_path(event.program.conference.short_title, event)
%li{'class'=>class_for_todo(progress_status['commercials'])}
%span{'class'=>icon_for_todo(progress_status['commercials'])}
- if progress_status['commercials']
= link_to 'Edit the commercials', edit_conference_program_proposal_path(event.program.conference.short_title, event, anchor: 'commercials-content')
- else
= link_to 'Add a commercial', edit_conference_program_proposal_path(event.program.conference.short_title, event, anchor: 'commercials-content')
= link_to 'Add a commercial', edit_conference_program_proposal_path(event.program.conference.short_title, event, anchor: 'commercials-content')
%li{'class'=>class_for_todo(progress_status['track'])}
%span{'class'=>icon_for_todo(progress_status['track'])}
= link_to 'Add a track', edit_conference_program_proposal_path(event.program.conference.short_title, event)
%li{'class'=>class_for_todo(progress_status['difficulty_level'])}
%span{'class'=>icon_for_todo(progress_status['difficulty_level'])}
- if progress_status['difficulty_level']
= link_to 'Change the difficulty level', edit_conference_program_proposal_path(event.program.conference.short_title, event)
- else
= link_to 'Add a difficulty level', edit_conference_program_proposal_path(event.program.conference.short_title, event)
= link_to 'Add a difficulty level', edit_conference_program_proposal_path(event.program.conference.short_title, event)

View file

@ -65,12 +65,13 @@
%small.text-muted
= event.event_type.title
= "(#{event.event_type.length} min)"
= "in #{event.track.name}" if event.track
- if event.state == 'confirmed' && event.require_registration == true
,
Pre-registered: #{pre_registered(event).count}
%td.col-md-2{style: "padding:20px 8px 20px 8px;"}
= link_to 'Complete your todo list', 'javascript: void(0)', "type"=>"button", "data-trigger"=>"focus", "data-toggle"=>"popover", "title"=>"Your todo list", "data-content"=>"#{render partial: 'tooltip', locals: { event: event} }"
= link_to 'Complete your proposal', 'javascript: void(0)', "type"=>"button", "data-trigger"=>"focus", "data-toggle"=>"popover", "title"=>"Your todo list", "data-content"=>"#{render partial: 'tooltip', locals: { event: event} }"
- progress_percentage = event.calculate_progress
.progress