Allow a proposal to be created with a Subtitle and Difficulty Level.

When a proposal is being submitted, we want to allow the submitter to
fill out the form once with all the required data. This change unifies
the forms for both editing and creating proposals. This allows us to
ensure that features are added in parallel to both workflows.

We also reduce the number of duplicate lines by removing duplicates
from the new.html.haml file.

We also increase the column size in css to have both pages show the
same width forms.
This commit is contained in:
Rob Smith 2015-06-13 12:28:27 -07:00
parent a9f806ca39
commit 24db130c92
3 changed files with 12 additions and 48 deletions

View file

@ -1,4 +1,8 @@
= semantic_form_for(@event, url: @url) do |f|
- if current_user.nil?
= render partial: 'devise/shared/sign_up_form_embedded'
= f.inputs name: 'Proposal Information' do
= f.input :title, as: :string, required: true
@ -39,8 +43,10 @@
= f.input :require_registration, label: 'Require participants to register to your event'
- if current_user.has_any_role? :admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference }
= f.input :is_highlight
-# We have to verify current_user in this context as this partial form is used both for new proposals and editing existing proposals
- if current_user
- if current_user.has_any_role? :admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference }
= f.input :is_highlight
%p.text-right
= link_to '#description', "data-toggle"=>"collapse" do
@ -48,6 +54,5 @@
.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.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: @event.new_record? ? 'Create Proposal' : 'Update Proposal'