Add relevance field for track requests

The requester can now provide more info about the track and himself
This commit is contained in:
AEtherC0r3 2017-07-26 14:54:10 +03:00 committed by Stella Rouzi
parent 3d250ecf75
commit 2ff4c6d6b2
10 changed files with 40 additions and 5 deletions

View file

@ -53,7 +53,7 @@ class TracksController < ApplicationController
private
def track_params
params.require(:track).permit(:name, :description, :color, :short_name, :start_date, :end_date)
params.require(:track).permit(:name, :description, :color, :short_name, :start_date, :end_date, :relevance)
end
def update_state(transition, notice)

View file

@ -27,6 +27,7 @@ class Track < ActiveRecord::Base
validates :start_date, presence: true, if: :self_organized_and_accepted_or_confirmed?
validates :end_date, presence: true, if: :self_organized_and_accepted_or_confirmed?
validates :room, presence: true, if: :self_organized_and_accepted_or_confirmed?
validates :relevance, presence: true, if: :self_organized?
validate :valid_dates
validate :valid_room, if: :self_organized_and_accepted_or_confirmed?

View file

@ -92,6 +92,12 @@
%b Description
%td
= markdown(@track.description)
- if @track.self_organized?
%tr
%td
%b Relevance
%td
= markdown(@track.relevance)
.tab-pane#events
.col-md-12

View file

@ -16,4 +16,5 @@
= 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 :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, required: true, hint: "This will be public #{markdown_hint}".html_safe
= f.input :relevance, input_html: {rows: 5, data: { provide: 'markdown-editable' } }, required: true, hint: "Please explain here how this track relates to the conference, how you are related to it's content and why we should accept it. #{markdown_hint}".html_safe
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -39,3 +39,7 @@
Description
%dd
= markdown(@track.description)
%dt
Relevance
%dd
= markdown(@track.relevance)