The working basics

This commit is contained in:
Godwin
2014-03-09 14:43:33 -06:00
parent b490a97852
commit db60933506
628 changed files with 81918 additions and 1060 deletions
@@ -0,0 +1,6 @@
= sortable @conference.conference_registration_form_fields, 'registration_form_field_id', url: 'form/reorder' do |form_field|
- ff = RegistrationFormField.find(form_field.registration_form_field_id)
%span.drag-sort='[drag]'
= ff.title
%a.remove-form-field.button{:data => {:id => ff.id}}
= _ 'registration_form_field.list.remove_from_form'
@@ -0,0 +1,14 @@
= form_for @registration_form_field do |f|
- if @registration_form_field.errors.any?
#error_explanation
%h2= "#{pluralize(@registration_form_field.errors.count, "error")} prohibited this registration_form_field from being saved:"
%ul
- @registration_form_field.errors.full_messages.each do |msg|
%li= msg
= field f, :field_type, :select, RegistrationFormField::Types.keys
- RegistrationFormField::Fields.each do |key, value|
- classes = RegistrationFormField::TypesForField(key.to_sym).collect{|v| 'field-type-' + v.to_s}
- classes << 'registration-form-field-field'
= eval('field f, :' + key.to_s + ', :' + value[:control] + (value[:options] ? ', ' + (value[:options].map.with_index{|v, i| 'value[:options][' + i.to_s + ']'}.join(', ') || 'nil') : '') + ", classes: classes")
= actions :save
@@ -0,0 +1,6 @@
%ul
- @registration_form_fields.each do |registration_form_field|
%li
= registration_form_field.title
%a.add-form-field.button{:data => {:id => registration_form_field.id}}
= _ 'registration_form_field.list.add_to_form'
@@ -0,0 +1,7 @@
%h1 Editing registration_form_field
= render 'form'
= link_to 'Show', @registration_form_field
\|
= link_to 'Back', registration_form_fields_path
@@ -0,0 +1,29 @@
%h1 Listing registration_form_fields
%table
%tr
%th Title
%th Help
%th Required
%th Field type
%th Options
%th Is retired
%th
%th
%th
- @registration_form_fields.each do |registration_form_field|
%tr
%td= registration_form_field.title
%td= registration_form_field.help
%td= registration_form_field.required
%td= registration_form_field.field_type
%td= registration_form_field.options
%td= registration_form_field.is_retired
%td= link_to 'Show', registration_form_field
%td= link_to 'Edit', edit_registration_form_field_path(registration_form_field)
%td= link_to 'Destroy', registration_form_field, :method => :delete, :data => { :confirm => 'Are you sure?' }
%br
= link_to 'New Registration form field', new_registration_form_field_path
@@ -0,0 +1,5 @@
%h1 New registration_form_field
= render 'form'
= link_to 'Back', registration_form_fields_path
@@ -0,0 +1,24 @@
%p#notice= notice
%p
%b Title:
= @registration_form_field.title
%p
%b Help:
= @registration_form_field.help
%p
%b Required:
= @registration_form_field.required
%p
%b Field type:
= @registration_form_field.field_type
%p
%b Options:
= @registration_form_field.options
%p
%b Is retired:
= @registration_form_field.is_retired
= link_to 'Edit', edit_registration_form_field_path(@registration_form_field)
\|
= link_to 'Back', registration_form_fields_path