fe 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +20 -0
- data/Rakefile +48 -0
- data/app/assets/images/fe/ajax-loader.gif +0 -0
- data/app/assets/images/fe/butgrad.png +0 -0
- data/app/assets/images/fe/icons/add.png +0 -0
- data/app/assets/images/fe/icons/application_form.png +0 -0
- data/app/assets/images/fe/icons/application_form_add.png +0 -0
- data/app/assets/images/fe/icons/arrow-move.png +0 -0
- data/app/assets/images/fe/icons/arrow_out.png +0 -0
- data/app/assets/images/fe/icons/asterisk_yellow.png +0 -0
- data/app/assets/images/fe/icons/book-open-list.png +0 -0
- data/app/assets/images/fe/icons/book_open.png +0 -0
- data/app/assets/images/fe/icons/briefcase.png +0 -0
- data/app/assets/images/fe/icons/calendar_view_day.png +0 -0
- data/app/assets/images/fe/icons/checkbox.png +0 -0
- data/app/assets/images/fe/icons/copy_paste.gif +0 -0
- data/app/assets/images/fe/icons/disk.png +0 -0
- data/app/assets/images/fe/icons/document--pencil.png +0 -0
- data/app/assets/images/fe/icons/document-copy.png +0 -0
- data/app/assets/images/fe/icons/map_magnify.png +0 -0
- data/app/assets/images/fe/icons/minus-button.png +0 -0
- data/app/assets/images/fe/icons/move.png +0 -0
- data/app/assets/images/fe/icons/page_error.png +0 -0
- data/app/assets/images/fe/icons/page_valid.png +0 -0
- data/app/assets/images/fe/icons/page_white.png +0 -0
- data/app/assets/images/fe/icons/page_white_add.png +0 -0
- data/app/assets/images/fe/icons/page_white_error.png +0 -0
- data/app/assets/images/fe/icons/paper-clip.png +0 -0
- data/app/assets/images/fe/icons/pencil-small.png +0 -0
- data/app/assets/images/fe/icons/pencil.png +0 -0
- data/app/assets/images/fe/icons/question-balloon.png +0 -0
- data/app/assets/images/fe/icons/radio.png +0 -0
- data/app/assets/images/fe/icons/star-small.png +0 -0
- data/app/assets/images/fe/icons/table.png +0 -0
- data/app/assets/images/fe/icons/text_align_left.png +0 -0
- data/app/assets/images/fe/icons/text_horizontalrule.png +0 -0
- data/app/assets/images/fe/icons/textfield.png +0 -0
- data/app/assets/images/fe/indent.png +0 -0
- data/app/assets/images/fe/overlay.png +0 -0
- data/app/assets/images/fe/selected_bg.jpg +0 -0
- data/app/assets/images/fe/status.gif +0 -0
- data/app/assets/images/fe/tooltip/black.png +0 -0
- data/app/assets/images/fe/tooltip/black_arrow.png +0 -0
- data/app/assets/images/fe/tooltip/black_arrow_big.png +0 -0
- data/app/assets/images/fe/tooltip/black_big.png +0 -0
- data/app/assets/images/fe/tooltip/white.png +0 -0
- data/app/assets/images/fe/tooltip/white_arrow.png +0 -0
- data/app/assets/images/fe/tooltip/white_arrow_big.png +0 -0
- data/app/assets/images/fe/tooltip/white_big.png +0 -0
- data/app/assets/images/fe/uploadify/cancel.png +0 -0
- data/app/assets/images/fe/uploadify/uploadify.swf +0 -0
- data/app/assets/javascripts/fe/admin.js +7 -0
- data/app/assets/javascripts/fe/jquery.metadata.js +122 -0
- data/app/assets/javascripts/fe/jquery.scrollTo-min.js +7 -0
- data/app/assets/javascripts/fe/jquery.uploadify.v2.1.0.js +258 -0
- data/app/assets/javascripts/fe/jquery.validate.pack.js +15 -0
- data/app/assets/javascripts/fe/qe.admin.js +115 -0
- data/app/assets/javascripts/fe/qe.common.js +57 -0
- data/app/assets/javascripts/fe/qe.public.js +331 -0
- data/app/assets/javascripts/fe/swfobject.js +4 -0
- data/app/assets/stylesheets/fe/qe.screen.css.scss.erb +552 -0
- data/app/assets/stylesheets/fe/reset.css +55 -0
- data/app/assets/stylesheets/fe/validation.css +91 -0
- data/app/controllers/fe/admin/elements_controller.rb +185 -0
- data/app/controllers/fe/admin/email_templates_controller.rb +61 -0
- data/app/controllers/fe/admin/question_pages_controller.rb +113 -0
- data/app/controllers/fe/admin/question_sheets_controller.rb +106 -0
- data/app/controllers/fe/answer_pages_controller.rb +3 -0
- data/app/controllers/fe/answer_sheets_controller.rb +3 -0
- data/app/controllers/fe/concerns/answer_pages_controller_concern.rb +80 -0
- data/app/controllers/fe/concerns/answer_sheets_controller_concern.rb +84 -0
- data/app/controllers/fe/reference_sheets_controller.rb +29 -0
- data/app/helpers/fe/answer_pages_helper.rb +19 -0
- data/app/helpers/fe/application_helper.rb +49 -0
- data/app/mailers/fe/notifier.rb +22 -0
- data/app/models/fe/answer.rb +13 -0
- data/app/models/fe/answer_pages_presenter.rb +13 -0
- data/app/models/fe/answer_sheet.rb +10 -0
- data/app/models/fe/answer_sheet_question_sheet.rb +7 -0
- data/app/models/fe/attachment_field.rb +7 -0
- data/app/models/fe/choice_field.rb +7 -0
- data/app/models/fe/concerns/answer_concern.rb +36 -0
- data/app/models/fe/concerns/answer_pages_presenter_concern.rb +99 -0
- data/app/models/fe/concerns/answer_sheet_concern.rb +61 -0
- data/app/models/fe/concerns/choice_field_concern.rb +131 -0
- data/app/models/fe/condition.rb +53 -0
- data/app/models/fe/date_field.rb +52 -0
- data/app/models/fe/element.rb +164 -0
- data/app/models/fe/email_template.rb +7 -0
- data/app/models/fe/option.rb +10 -0
- data/app/models/fe/option_group.rb +10 -0
- data/app/models/fe/page.rb +101 -0
- data/app/models/fe/page_element.rb +9 -0
- data/app/models/fe/page_link.rb +15 -0
- data/app/models/fe/paragraph.rb +10 -0
- data/app/models/fe/payment.rb +52 -0
- data/app/models/fe/payment_question.rb +22 -0
- data/app/models/fe/presenter.rb +23 -0
- data/app/models/fe/question.rb +256 -0
- data/app/models/fe/question_grid.rb +26 -0
- data/app/models/fe/question_grid_with_total.rb +11 -0
- data/app/models/fe/question_set.rb +82 -0
- data/app/models/fe/question_sheet.rb +73 -0
- data/app/models/fe/reference_question.rb +42 -0
- data/app/models/fe/reference_sheet.rb +149 -0
- data/app/models/fe/section.rb +12 -0
- data/app/models/fe/state_chooser.rb +10 -0
- data/app/models/fe/text_field.rb +29 -0
- data/app/views/fe/admin/elements/_errors.html.erb +1 -0
- data/app/views/fe/admin/elements/create.js.erb +11 -0
- data/app/views/fe/admin/elements/destroy.js.erb +4 -0
- data/app/views/fe/admin/elements/drop.js.erb +2 -0
- data/app/views/fe/admin/elements/duplicate.js.erb +2 -0
- data/app/views/fe/admin/elements/edit.js.erb +4 -0
- data/app/views/fe/admin/elements/error.js.erb +4 -0
- data/app/views/fe/admin/elements/new.js.erb +10 -0
- data/app/views/fe/admin/elements/reorder.js.erb +0 -0
- data/app/views/fe/admin/elements/update.js.erb +9 -0
- data/app/views/fe/admin/email_templates/_form.html.erb +8 -0
- data/app/views/fe/admin/email_templates/edit.html.erb +13 -0
- data/app/views/fe/admin/email_templates/index.html.erb +20 -0
- data/app/views/fe/admin/email_templates/new.html.erb +11 -0
- data/app/views/fe/admin/panels/_advanced_options.html.erb +16 -0
- data/app/views/fe/admin/panels/_common_fields.html.erb +24 -0
- data/app/views/fe/admin/panels/_condition.html.erb +6 -0
- data/app/views/fe/admin/panels/_insert.html.erb +39 -0
- data/app/views/fe/admin/panels/_nav_controls.html.erb +6 -0
- data/app/views/fe/admin/panels/_page.html.erb +3 -0
- data/app/views/fe/admin/panels/_pages_list.html.erb +16 -0
- data/app/views/fe/admin/panels/_prop_attachment_field.html.erb +2 -0
- data/app/views/fe/admin/panels/_prop_choice_field.html.erb +46 -0
- data/app/views/fe/admin/panels/_prop_date_field.html.erb +7 -0
- data/app/views/fe/admin/panels/_prop_element.html.erb +30 -0
- data/app/views/fe/admin/panels/_prop_page.html.erb +21 -0
- data/app/views/fe/admin/panels/_prop_paragraph.html.erb +32 -0
- data/app/views/fe/admin/panels/_prop_question_grid.html.erb +23 -0
- data/app/views/fe/admin/panels/_prop_question_grid_with_total.html.erb +14 -0
- data/app/views/fe/admin/panels/_prop_reference_question.html.erb +12 -0
- data/app/views/fe/admin/panels/_prop_section.html.erb +2 -0
- data/app/views/fe/admin/panels/_prop_sheet.html.erb +17 -0
- data/app/views/fe/admin/panels/_prop_text_field.html.erb +20 -0
- data/app/views/fe/admin/question_pages/_element.html.erb +18 -0
- data/app/views/fe/admin/question_pages/_element_show.html.erb +10 -0
- data/app/views/fe/admin/question_pages/_errors.html.erb +1 -0
- data/app/views/fe/admin/question_pages/_question_page.html.erb +13 -0
- data/app/views/fe/admin/question_pages/create.js.erb +11 -0
- data/app/views/fe/admin/question_pages/destroy.js.erb +5 -0
- data/app/views/fe/admin/question_pages/edit.js.erb +3 -0
- data/app/views/fe/admin/question_pages/error.js.erb +4 -0
- data/app/views/fe/admin/question_pages/show.js.erb +8 -0
- data/app/views/fe/admin/question_pages/show_panel.js.erb +3 -0
- data/app/views/fe/admin/question_pages/update.js.erb +2 -0
- data/app/views/fe/admin/question_sheets/_errors.html.erb +1 -0
- data/app/views/fe/admin/question_sheets/edit.js.erb +3 -0
- data/app/views/fe/admin/question_sheets/error.js.erb +5 -0
- data/app/views/fe/admin/question_sheets/index.html.erb +41 -0
- data/app/views/fe/admin/question_sheets/new.html.erb +15 -0
- data/app/views/fe/admin/question_sheets/show.html.erb +27 -0
- data/app/views/fe/admin/question_sheets/update.js.erb +2 -0
- data/app/views/fe/answer_pages/_answer_page.html.erb +56 -0
- data/app/views/fe/answer_pages/_element.html.erb +9 -0
- data/app/views/fe/answer_pages/update.js.erb +5 -0
- data/app/views/fe/answer_sheets/_answer_sheet.html.erb +24 -0
- data/app/views/fe/answer_sheets/_element.html.erb +54 -0
- data/app/views/fe/answer_sheets/_incomplete.html.erb +10 -0
- data/app/views/fe/answer_sheets/_page_link.html.erb +7 -0
- data/app/views/fe/answer_sheets/_pages_list.html.erb +11 -0
- data/app/views/fe/answer_sheets/_title.html.erb +1 -0
- data/app/views/fe/answer_sheets/edit.html.erb +60 -0
- data/app/views/fe/answer_sheets/incomplete.js.erb +5 -0
- data/app/views/fe/answer_sheets/index.html.erb +18 -0
- data/app/views/fe/answer_sheets/send_reference_invite.js.erb +8 -0
- data/app/views/fe/answer_sheets/show.html.erb +13 -0
- data/app/views/fe/help/builder.html +33 -0
- data/app/views/fe/help/question_grid.html +18 -0
- data/app/views/fe/questions/_acceptance.html.erb +13 -0
- data/app/views/fe/questions/_attachment_field.html.erb +42 -0
- data/app/views/fe/questions/_checkbox_field.html.erb +49 -0
- data/app/views/fe/questions/_country.html.erb +7 -0
- data/app/views/fe/questions/_date_field.html.erb +7 -0
- data/app/views/fe/questions/_date_field_mmyy.html.erb +9 -0
- data/app/views/fe/questions/_drop_down_field.html.erb +7 -0
- data/app/views/fe/questions/_paragraph.html.erb +1 -0
- data/app/views/fe/questions/_question_grid.html.erb +65 -0
- data/app/views/fe/questions/_question_grid_with_total.html.erb +57 -0
- data/app/views/fe/questions/_questions.html.erb +9 -0
- data/app/views/fe/questions/_radio_button_field.html.erb +41 -0
- data/app/views/fe/questions/_rating.html.erb +25 -0
- data/app/views/fe/questions/_reference_discipler.html.erb +1 -0
- data/app/views/fe/questions/_reference_friend.html.erb +1 -0
- data/app/views/fe/questions/_reference_parent.html.erb +1 -0
- data/app/views/fe/questions/_reference_peer.html.erb +1 -0
- data/app/views/fe/questions/_reference_question.html.erb +38 -0
- data/app/views/fe/questions/_reference_roommate.html.erb +1 -0
- data/app/views/fe/questions/_reference_spiritual.html.erb +1 -0
- data/app/views/fe/questions/_reference_staff.html.erb +1 -0
- data/app/views/fe/questions/_section.html.erb +1 -0
- data/app/views/fe/questions/_state_chooser.html.erb +7 -0
- data/app/views/fe/questions/_text_area_field.html.erb +6 -0
- data/app/views/fe/questions/_text_field.html.erb +8 -0
- data/app/views/fe/questions/_yes_no.html.erb +17 -0
- data/app/views/fe/questions/_yes_no_field.erb +17 -0
- data/app/views/fe/reference_sheets/not_found.html.erb +5 -0
- data/app/views/layouts/fe/application.html.erb +31 -0
- data/app/views/layouts/fe/qe.admin.html.erb +30 -0
- data/config/routes.rb +49 -0
- data/db/migrate/20131003041856_core.rb +91 -0
- data/db/migrate/20131003044250_create_reference_sheets.rb +23 -0
- data/db/migrate/20131003044436_add_element_and_answer_fields.rb +10 -0
- data/db/migrate/20131003044518_create_email_templates.rb +17 -0
- data/db/migrate/20131003044621_add_max_lengths.rb +8 -0
- data/db/migrate/20131003044714_create_join_table.rb +11 -0
- data/db/migrate/20131016162128_remove_question_id_from_element.rb +9 -0
- data/lib/fe.rb +22 -0
- data/lib/fe/engine.rb +19 -0
- data/lib/fe/version.rb +3 -0
- data/lib/generators/fe/install_generator.rb +132 -0
- data/lib/tasks/qe_tasks.rake +4 -0
- data/spec/controllers/fe/admin/elements_controller_spec.rb +4 -0
- data/spec/controllers/fe/admin/email_templates_controller_spec.rb +4 -0
- data/spec/controllers/fe/admin/question_pages_controller_spec.rb +4 -0
- data/spec/controllers/fe/admin/question_sheets_controller_spec.rb +4 -0
- data/spec/controllers/fe/answer_pages_controller_spec.rb +4 -0
- data/spec/controllers/fe/answer_sheets_controller_spec.rb +4 -0
- data/spec/controllers/fe/reference_sheets_controller_spec.rb +4 -0
- data/spec/factories/answer_sheets.rb +5 -0
- data/spec/factories/answers.rb +4 -0
- data/spec/factories/paragraphs.rb +4 -0
- data/spec/factories/question_sheet.rb +5 -0
- data/spec/factories/reference_questions.rb +4 -0
- data/spec/models/fe/answer_sheet_question_sheet_spec.rb +6 -0
- data/spec/models/fe/answer_sheet_spec.rb +8 -0
- data/spec/models/fe/answer_spec.rb +13 -0
- data/spec/models/fe/attachment_field_spec.rb +4 -0
- data/spec/models/fe/choice_field_spec.rb +5 -0
- data/spec/models/fe/condition_spec.rb +8 -0
- data/spec/models/fe/date_field_spec.rb +49 -0
- data/spec/models/fe/element_spec.rb +12 -0
- data/spec/models/fe/email_template_spec.rb +5 -0
- data/spec/models/fe/option_group_spec.rb +4 -0
- data/spec/models/fe/option_spec.rb +4 -0
- data/spec/models/fe/page_element_spec.rb +6 -0
- data/spec/models/fe/page_link_spec.rb +4 -0
- data/spec/models/fe/page_spec.rb +14 -0
- data/spec/models/fe/paragraph_spec.rb +17 -0
- data/spec/models/fe/question_grid_spec.rb +4 -0
- data/spec/models/fe/question_grid_with_total_spec.rb +4 -0
- data/spec/models/fe/question_set_spec.rb +4 -0
- data/spec/models/fe/question_sheet_spec.rb +8 -0
- data/spec/models/fe/question_spec.rb +20 -0
- data/spec/models/fe/reference_question_spec.rb +17 -0
- data/spec/models/fe/reference_sheet_spec.rb +11 -0
- data/spec/models/fe/section_spec.rb +4 -0
- data/spec/models/fe/state_chooser_spec.rb +4 -0
- data/spec/models/fe/text_field_spec.rb +17 -0
- data/spec/spec_helper.rb +66 -0
- data/spec/support/database.txt +28 -0
- metadata +508 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div id="panel-properties-sheet" class="panel" style="display:block;">
|
|
2
|
+
<p class="instruction">Update the settings for this form.</p>
|
|
3
|
+
|
|
4
|
+
<div id="errors">
|
|
5
|
+
<%= render :partial => 'errors', :locals => { :question_sheet => @question_sheet }%>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<%= form_for @question_sheet, :url => admin_question_sheet_path(@question_sheet), :remote => true, :method => :put do |f| %>
|
|
9
|
+
|
|
10
|
+
<p><label for="" class="desc">Label <span class="required">required</span></label>
|
|
11
|
+
<%= f.text_field :label, :maxlength => 60 %></p>
|
|
12
|
+
|
|
13
|
+
<p class="buttons">
|
|
14
|
+
<%= submit_tag"Update »".html_safe %></p>
|
|
15
|
+
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<%- options = [ OptionGroup.new('Short Answer', [
|
|
2
|
+
Option.new('short', 'Simple'),
|
|
3
|
+
Option.new('number', 'Number'),
|
|
4
|
+
Option.new('currency-dollar', 'Currency'),
|
|
5
|
+
Option.new('email', 'E-mail address'),
|
|
6
|
+
Option.new('url', 'Web address'),
|
|
7
|
+
Option.new('phone', 'Telephone number')
|
|
8
|
+
]),
|
|
9
|
+
OptionGroup.new('Long Answer', [
|
|
10
|
+
Option.new('essay', 'Essay')
|
|
11
|
+
])
|
|
12
|
+
]
|
|
13
|
+
%>
|
|
14
|
+
<div class="field">
|
|
15
|
+
<label for="element_style" class="desc">Style</label>
|
|
16
|
+
<%= select_tag 'element[style]',
|
|
17
|
+
option_groups_from_collection_for_select(options, 'group', 'label', 'key', 'value', @element.style) %>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<%= render 'admin/panels/common_fields', :f => f %>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<li class="element" id="element_<%= element.id %>">
|
|
2
|
+
<div class="controls">
|
|
3
|
+
<ul>
|
|
4
|
+
<li><%= link_to "edit", edit_admin_question_sheet_page_element_path(@page.question_sheet.id, @page.id, element.id), :remote => true, :method => :get, :class => "edit", :title => "Edit this element" %></li>
|
|
5
|
+
<% if in_grid -%>
|
|
6
|
+
<li><%= link_to("remove", remove_from_grid_admin_question_sheet_page_element_path(@page.question_sheet.id, @page.id, element.id), :remote => true, :class => "remove", :title => "remove" )%></li>
|
|
7
|
+
<% end -%>
|
|
8
|
+
<li><%= link_to "duplicate", duplicate_admin_question_sheet_page_element_path(@page.question_sheet.id, @page.id, element.id), :remote => true, :method => :post, :class => "duplicate", :title => "Duplicate this element" %></li>
|
|
9
|
+
<li><%= link_to('Delete', admin_question_sheet_page_element_path( @page.question_sheet_id, @page.id, element.id), :remote => true, :method => :delete, :class => "delete", data: {confirm: "Are you sure you want to remove this element from this form?"}, :title => "Permanently delete this item") %></li>
|
|
10
|
+
<li><a href="#" class="handle" title="Reorder this element">drag</a></li>
|
|
11
|
+
</ul>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="q" id="element_<%= dom_id(element) %>">
|
|
14
|
+
<%= render 'admin/question_pages/element_show', :element => element %>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="q q_form" id="element_form_<%= dom_id(element) %>">
|
|
17
|
+
</div>
|
|
18
|
+
</li>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<%# encoding: utf-8 %>
|
|
2
|
+
<% if element.question? && element.label.present? && !element.hide_label? -%>
|
|
3
|
+
<label for="<%= dom_id(element) %>" class="desc">
|
|
4
|
+
<%= raw element.label %>
|
|
5
|
+
<% if element.required? -%><span class="required">required</span><% end -%>
|
|
6
|
+
<%= image_tag('fe/icons/question-balloon.png', :class => 'tip', :title => element.tooltip) if element.tooltip.present? %>
|
|
7
|
+
</label>
|
|
8
|
+
<% end -%>
|
|
9
|
+
|
|
10
|
+
<%= render :partial => 'questions/' + element.ptemplate, :object => element, :locals => {:col => nil} %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= error_messages_for :page %>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="page">
|
|
2
|
+
<h3 id='page-name'>
|
|
3
|
+
<%= link_to @page.label, edit_admin_question_sheet_page_path(@page.question_sheet_id, @page.id), :remote => true, :method => :get , :class => "ctl", :id => "link-page-name" -%>
|
|
4
|
+
</h3>
|
|
5
|
+
<% if @page.elements.length > 0 %>
|
|
6
|
+
<ul>
|
|
7
|
+
<ul class="questions" id="questions_list" data-sortable="true" data-sortable-url="<%= reorder_admin_question_sheet_page_elements_path(@page.question_sheet_id, @page.id) %>" data-sortable-handle=".handle">
|
|
8
|
+
<%= render :partial => 'admin/question_pages/element', :collection => @page.elements, :locals => {:in_grid => false} %>
|
|
9
|
+
</ul>
|
|
10
|
+
<% else %>
|
|
11
|
+
<div style="background: #ffc;"><p>You don't have any questions on this page yet.</p></div>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
$('#page-preview').html('<%= escape_javascript(render('admin/question_pages/question_page')) %>')
|
|
2
|
+
$('#panel').html('<%= escape_javascript(render('admin/panels/prop_page', :page => @page)) %>')
|
|
3
|
+
$('#nav-controls').html('<%= escape_javascript(render('admin/panels/nav_controls')) %>')
|
|
4
|
+
switchTab('properties');
|
|
5
|
+
selectPage();
|
|
6
|
+
$('#list-pages li').removeClass('active')
|
|
7
|
+
$('#link-<%= dom_id(@page) %>').addClass('active')
|
|
8
|
+
clearCurrentElement()
|
|
9
|
+
activeElement = ''
|
|
10
|
+
$(".tip[title]").tooltip();
|
|
11
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
$('#panel').html('<%= escape_javascript(render('admin/panels/pages_list')) %>')
|
|
2
|
+
$('#page-preview').html('<%= escape_javascript(render('admin/question_pages/question_page')) %>')
|
|
3
|
+
$('#nav-controls').html('<%= escape_javascript(render('admin/panels/nav_controls')) %>')
|
|
4
|
+
switchTab("pages_list")
|
|
5
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
$('#page-preview').html('<%= escape_javascript(render('admin/question_pages/question_page')) %>')
|
|
2
|
+
$('#nav-controls').html('<%= escape_javascript(render('admin/panels/nav_controls')) %>')
|
|
3
|
+
switchTab("pages_list")
|
|
4
|
+
$('#list-pages li').removeClass('active')
|
|
5
|
+
$('#link-<%= dom_id(@page) %>').addClass('active')
|
|
6
|
+
clearCurrentElement()
|
|
7
|
+
activeElement = ''
|
|
8
|
+
$(".tip[title]").tooltip();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= error_messages_for :question_sheet %>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<div id="content">
|
|
2
|
+
<h1>Questionnaires</h1>
|
|
3
|
+
|
|
4
|
+
<% if flash[:error] -%>
|
|
5
|
+
<div style="background: #ffe5df; border: solid 1px #efbeb3; padding: 9px; margin: 0 0 18px;"><%= flash[:error] %></div>
|
|
6
|
+
<% end -%>
|
|
7
|
+
|
|
8
|
+
<%= link_to 'New Form', admin_question_sheets_path(), :method => :post, :class => "add-link" %>
|
|
9
|
+
<br/>
|
|
10
|
+
<table cellspacing="0" class="list">
|
|
11
|
+
<tr>
|
|
12
|
+
<th>Active Question Sheets</th>
|
|
13
|
+
<th colspan="3"> </th>
|
|
14
|
+
</tr>
|
|
15
|
+
<% for question_sheet in @active_question_sheets %>
|
|
16
|
+
<tr class="<%= cycle("","alt") %>">
|
|
17
|
+
<td class="title"><%= link_to question_sheet.label, admin_question_sheet_path(question_sheet), :class => "questionnaire" %></td>
|
|
18
|
+
<td class="actions"><%= link_to 'Duplicate', duplicate_admin_question_sheet_path(question_sheet), data: {confirm: 'This will take some time depending on the number of questions. Please be patient.'}, :method => :post, :class => 'duplicate' %></td>
|
|
19
|
+
<td class="actions"><%= link_to 'Archive', archive_admin_question_sheet_path(question_sheet), data: {confirm: 'Are you sure you want to archive this Question Sheet?'}, :method => :post, :class => 'archive' %></td>
|
|
20
|
+
<td class="actions"><%= link_to 'Destroy', admin_question_sheet_path(question_sheet), data: {confirm: 'Are you sure you want to delete this Question Sheet?'}, :method => :delete, :class => "destroy", :class => 'delete' %></td>
|
|
21
|
+
</tr>
|
|
22
|
+
<% end %>
|
|
23
|
+
</table>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<table cellspacing="0" class="list">
|
|
27
|
+
<tr>
|
|
28
|
+
<th>Archived Question Sheets</th>
|
|
29
|
+
<th> </th>
|
|
30
|
+
<th> </th>
|
|
31
|
+
</tr>
|
|
32
|
+
<% for question_sheet in @archived_question_sheets %>
|
|
33
|
+
<tr class="<%= cycle("","alt") %>">
|
|
34
|
+
<td class="title"><%= link_to question_sheet.label, admin_question_sheet_path(question_sheet), :class => "questionnaire" %></td>
|
|
35
|
+
<td class="actions"><%= link_to 'Duplicate', duplicate_admin_question_sheet_path(question_sheet), data: {confirm: 'This will take some time depending on the number of questions. Please be patient.'}, :method => :post, :class => 'duplicate' %></td>
|
|
36
|
+
<td class="actions"><%= link_to 'Un-Archive', unarchive_admin_question_sheet_path(question_sheet), :method => :post, :class => 'unarchive' %></td>
|
|
37
|
+
</tr>
|
|
38
|
+
<% end %>
|
|
39
|
+
</table>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<h1>New Form</h1>
|
|
2
|
+
|
|
3
|
+
<%= error_messages_for :question_sheet %>
|
|
4
|
+
|
|
5
|
+
<% form_for(:question_sheet, :url => admin_question_sheets_path) do |f| %>
|
|
6
|
+
<p>
|
|
7
|
+
<label for="question_sheet_label">Label</label>
|
|
8
|
+
<%= f.text_field :label, :maxlength => 60 %>
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
<%= submit_tag "Create" %>
|
|
12
|
+
</p>
|
|
13
|
+
<% end %>
|
|
14
|
+
|
|
15
|
+
<%= link_to 'Back', admin_question_sheets_path %>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script language="javascript">
|
|
2
|
+
var activeElement = "";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<div id="controls">
|
|
7
|
+
<ul id="nav-controls">
|
|
8
|
+
<%= render :partial => 'admin/panels/nav_controls' %>
|
|
9
|
+
</ul>
|
|
10
|
+
|
|
11
|
+
<div id="panel">
|
|
12
|
+
<%= render :partial => 'admin/panels/pages_list' %>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<div id="preview">
|
|
18
|
+
<h2 id='sheet-name'>
|
|
19
|
+
<%= link_to @question_sheet.label, edit_admin_question_sheet_path(@question_sheet), :remote => true, :method => :get , :class => "ctl" -%>
|
|
20
|
+
</h2>
|
|
21
|
+
<div id="page-preview">
|
|
22
|
+
<%= render :partial => 'admin/question_pages/question_page' %>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div style="clear:both;"> </div>
|
|
27
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<% if @presenter.active_page %>
|
|
2
|
+
<% page_dom = @presenter.active_page_link.dom_id
|
|
3
|
+
next_js = load_page_js(@presenter.next_page) -%>
|
|
4
|
+
|
|
5
|
+
<div id="<%= page_dom %>" class="answer-page" style="<% if show_first.nil? -%>display: none;<% end -%>"> <!-- this id is parsed by fe.public.js -->
|
|
6
|
+
|
|
7
|
+
<div class="page">
|
|
8
|
+
<h3 id='page-name'><%= @presenter.active_page.label %></h3>
|
|
9
|
+
|
|
10
|
+
<% if @elements.length > 0 -%>
|
|
11
|
+
<%= form_tag @presenter.active_page_link.save_path, :id => "#{page_dom}-form", :onsubmit => "$.fe.pageHandler.savePage($('#sp_application_55716-page_331')); return false;", :multipart => true do -%>
|
|
12
|
+
<ul class="questions" id="questions_list">
|
|
13
|
+
<% @elements.each do |element| %>
|
|
14
|
+
<li class="<%= element.class.to_s.downcase %>" id="element_<%= element.id %>">
|
|
15
|
+
<%= render 'answer_pages/element', :element => element %>
|
|
16
|
+
</li>
|
|
17
|
+
<% end %>
|
|
18
|
+
</ul>
|
|
19
|
+
|
|
20
|
+
<% if next_js.empty? -%>
|
|
21
|
+
<div id="submit_message" class="validation-advice" style="display: none;"></div>
|
|
22
|
+
<div>
|
|
23
|
+
<button type="submit" onclick="page_handler.completeAll(); return false;" id="submit_button"><span>Submit</span></button>
|
|
24
|
+
<button type="button" class="save_button" style="font-family: Arial; cursor: pointer;"><span>Save Now</span></button>
|
|
25
|
+
</div>
|
|
26
|
+
<% else -%>
|
|
27
|
+
<div class="savestatus">
|
|
28
|
+
Last Saved: <span class="last-saved"><%= l(@answer_sheet.updated_at, :format => :datetime) %></span><%= spinner(page_dom) %>
|
|
29
|
+
</div>
|
|
30
|
+
<div>
|
|
31
|
+
<button type="button" class="save_button" style="font-family: Arial; cursor: pointer;"><span>Save Now</span></button>
|
|
32
|
+
<button type="button" onclick="<%= next_js %>" style="font-family: Arial; cursor: pointer;"><span>Next >></span></button>
|
|
33
|
+
</div>
|
|
34
|
+
<% end -%>
|
|
35
|
+
|
|
36
|
+
<% end -%>
|
|
37
|
+
|
|
38
|
+
<% else -%>
|
|
39
|
+
|
|
40
|
+
<div style="background: #ffc;">
|
|
41
|
+
<p>There are no questions on this page.</p>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<% end -%>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
<% if session[:attempted_submit] %>
|
|
50
|
+
<script type="text/javascript" charset="utf-8">
|
|
51
|
+
$(function() {
|
|
52
|
+
$.fe.pageHandler.validatePage('<%= page_dom %>')
|
|
53
|
+
});
|
|
54
|
+
</script>
|
|
55
|
+
<% end %>
|
|
56
|
+
<% end %>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<% if element.question? && element.default_label? && element.label.present? && !element.hide_label? -%>
|
|
2
|
+
<label for="<%= dom_id(element) %>" class="desc">
|
|
3
|
+
<%= raw element.label %>
|
|
4
|
+
<% if element.required?(@answer_sheet) -%><span class="required">required</span><% end -%>
|
|
5
|
+
<%= tip(element.tooltip) if element.tooltip.present? %>
|
|
6
|
+
</label>
|
|
7
|
+
<% end -%>
|
|
8
|
+
|
|
9
|
+
<%= render :partial => 'questions/' + element.ptemplate, :object => element, :locals => {:col => nil} %>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
$('.last-saved').html('<%= escape_javascript(l(@answer_sheet.updated_at, :format => :datetime)) %>')
|
|
2
|
+
<% if @answer && @answer.attachment_file_name %>
|
|
3
|
+
$('#attachment_field_<%= @answer.question_id %>_filename').html('Current File: <%= link_to(@answer.attachment_file_name, @answer.attachment.url) %>')
|
|
4
|
+
$('#attachment_field_<%= @answer.question_id %>_filename').effect('highlight')
|
|
5
|
+
<% end %>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<h2 id='sheet-name'><%= answer_sheet.question_sheet.label %></h2>
|
|
2
|
+
|
|
3
|
+
<% if elements.length > 0 -%>
|
|
4
|
+
|
|
5
|
+
<% elements.each do |page, page_elements| -%>
|
|
6
|
+
|
|
7
|
+
<div class="page">
|
|
8
|
+
<h3><%= page.label %></h3>
|
|
9
|
+
<ul class="questions readonly" start="<%= @question_number %>">
|
|
10
|
+
<%= render :partial => 'answer_sheets/element', :collection => page_elements, :locals => {:elements => page_elements} %>
|
|
11
|
+
</ul>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<br />
|
|
15
|
+
|
|
16
|
+
<% end -%>
|
|
17
|
+
|
|
18
|
+
<% else -%>
|
|
19
|
+
|
|
20
|
+
<div style="background: #ffc;">
|
|
21
|
+
<p>That's odd. There are no answers to review.</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<% end -%>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<% if element.kind == "Fe::QuestionGrid" -%>
|
|
2
|
+
<li>
|
|
3
|
+
<label class="desc"><%= raw element.label %></label>
|
|
4
|
+
<table class="grid">
|
|
5
|
+
<%- if element.cols -%>
|
|
6
|
+
<tr>
|
|
7
|
+
<%- element.cols.split(';').each do |header| -%>
|
|
8
|
+
<th><%= raw header || ' ' %></th>
|
|
9
|
+
<%- end -%>
|
|
10
|
+
</tr>
|
|
11
|
+
<%- end -%>
|
|
12
|
+
<tr>
|
|
13
|
+
<%- col_count = 0
|
|
14
|
+
element.elements.each do |grid_element| -%>
|
|
15
|
+
<td id="element_<%= element.id %>">
|
|
16
|
+
<% if %w(Fe::Paragraph).include?(grid_element.kind) -%>
|
|
17
|
+
<%= simple_format grid_element.content %>
|
|
18
|
+
<% else -%>
|
|
19
|
+
<%# el = elements.detect {|el| el.id == grid_element.id } -%>
|
|
20
|
+
<% if grid_element.question? -%>
|
|
21
|
+
<label class="desc"><%= raw grid_element.label %></label>
|
|
22
|
+
<% end %>
|
|
23
|
+
<span class="answer"><%= simple_format grid_element.display_response(@answer_sheet) %></span>
|
|
24
|
+
<% end -%>
|
|
25
|
+
</td>
|
|
26
|
+
<%- col_count += 1
|
|
27
|
+
if col_count % element.num_cols == 0 then col_count = 0 -%></tr><tr><%- end -%>
|
|
28
|
+
<%- end -%>
|
|
29
|
+
<%- while col_count < element.num_cols do
|
|
30
|
+
col_count += 1-%>
|
|
31
|
+
<td> </td>
|
|
32
|
+
<%- end unless col_count == 0-%>
|
|
33
|
+
</tr>
|
|
34
|
+
</table>
|
|
35
|
+
</li>
|
|
36
|
+
<% elsif element.question_grid_id.nil? && element.conditional_id.nil? -%>
|
|
37
|
+
<li>
|
|
38
|
+
<% if element.question? -%>
|
|
39
|
+
<label class="desc"><%= raw element.label %></label>
|
|
40
|
+
<%- if @collating -%>
|
|
41
|
+
<%- for answer_sheet in @collated_answer_sheets[@answer_sheet] -%>
|
|
42
|
+
<div class="answer collate">
|
|
43
|
+
<span class="reviewer_name"><%= answer_sheet.collat_title %>:</span>
|
|
44
|
+
<span class="reviewer_answer"><%= simple_format element.display_response(answer_sheet) %></span>
|
|
45
|
+
</div>
|
|
46
|
+
<%- end -%>
|
|
47
|
+
<%- else -%>
|
|
48
|
+
<span class="answer"><%= simple_format element.display_response(@answer_sheet) %></span>
|
|
49
|
+
<%- end -%>
|
|
50
|
+
<% else -%>
|
|
51
|
+
<%= render :partial => 'questions/' + element.ptemplate, :object => element %>
|
|
52
|
+
<% end -%>
|
|
53
|
+
</li>
|
|
54
|
+
<% end -%>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<% css_class = '' %>
|
|
2
|
+
<% if session[:attempted_submit] && page_link.page.has_questions? %>
|
|
3
|
+
<% css_class = page_link.page.complete?(@answer_sheet) ? 'complete' : 'incomplete' %>
|
|
4
|
+
<% end %>
|
|
5
|
+
<%= li_page_active_if(@presenter.active_page && page_link.dom_id == @presenter.active_page, :id => page_link.dom_id + '-li', :class => css_class) do %>
|
|
6
|
+
<%= link_to_function(page_link.label, load_page_js(page_link), :id => page_link.dom_id + '-link', 'data-page-id' => page_link.dom_id, :class => 'page_link', :href => page_link.load_path) %>
|
|
7
|
+
<% end -%>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div id="panel-pages" class="panel" style="display:block;">
|
|
2
|
+
<div id="page_ajax_spinner" style="display:none;">
|
|
3
|
+
<div>
|
|
4
|
+
<%= image_tag 'fe/ajax-loader.gif' %> Loading...
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
<ul id="list-pages">
|
|
8
|
+
<%= render :partial => 'fe/answer_sheets/page_link', :collection => @presenter.page_links %>
|
|
9
|
+
</ul>
|
|
10
|
+
|
|
11
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h2 id='sheet-name'><%= @presenter.sheet_title %></h2>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<div id="controls">
|
|
2
|
+
<div id="panel">
|
|
3
|
+
<%= render :partial => 'answer_sheets/pages_list' %>
|
|
4
|
+
</div>
|
|
5
|
+
<div id="legend">
|
|
6
|
+
<%= image_tag('fe/icons/question-balloon.png') %> Rolling over this symbol gives you help<br/>
|
|
7
|
+
<%= image_tag('fe/icons/star-small.png') %> Marks a required field
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div id="preview">
|
|
12
|
+
<%= render :partial => 'answer_sheets/title' %>
|
|
13
|
+
<%= render :partial => 'answer_pages/answer_page', :locals => { :show_first => true } %>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<script type="text/javascript">
|
|
17
|
+
$(function() {
|
|
18
|
+
page_handler = $.fe.pageHandler;
|
|
19
|
+
page_handler.initialize('<%= @presenter.active_page.try(:dom_id) %>');
|
|
20
|
+
// Event.observe(window, 'unload', page_handler.savePage);
|
|
21
|
+
|
|
22
|
+
// Validation.add('validate-phone', 'Please enter a valid phone number +1-800-555-1234 x102', {
|
|
23
|
+
// pattern: /((\(\d{3}\)?)|(\d{3}))((\s|-|\.|\/)?)(\d{3})((\s|-|\.|\/)?)(\d{4})\s*([xX]|[eE][xX][tT])?\.?\s*\d*$/
|
|
24
|
+
// });
|
|
25
|
+
// Validation.add('validate-rating', 'Please select one of the above options.', function(v,elm) {
|
|
26
|
+
// var p = elm.parentNode.parentNode;
|
|
27
|
+
// var options = p.getElementsByTagName('INPUT');
|
|
28
|
+
// return $A(options).any(function(elm) {
|
|
29
|
+
// return $F(elm);
|
|
30
|
+
// });
|
|
31
|
+
// })
|
|
32
|
+
|
|
33
|
+
// global responders for all Ajax requests
|
|
34
|
+
$(function() {
|
|
35
|
+
$('#page_ajax_spinner').ajaxStart(function() {
|
|
36
|
+
$(this).show();
|
|
37
|
+
}).ajaxComplete(function() {
|
|
38
|
+
$(this).hide();
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
function updateTotals() {
|
|
43
|
+
// Set up js for all question grids with totals
|
|
44
|
+
<% if @page %>
|
|
45
|
+
<% @page.question_sheet.pages.collect(&:question_grid_with_totals).flatten.each do |question_grid_with_total|
|
|
46
|
+
question_grid_with_total.total_cols.split(',').collect(&:to_i).each do |col| -%>
|
|
47
|
+
try {
|
|
48
|
+
updateTotal('<%= "#{question_grid_with_total.id}_#{col - 1}" %>')
|
|
49
|
+
$$(".col_<%= "#{question_grid_with_total.id}_#{col - 1}" %>").each(function(e) {
|
|
50
|
+
Event.observe(e, 'blur', function(event) {
|
|
51
|
+
updateTotal('<%= "#{question_grid_with_total.id}_#{col - 1}" %>')
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
} catch(e) {}
|
|
55
|
+
<% end
|
|
56
|
+
end %>
|
|
57
|
+
<% end %>
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
<%= hidden_field_tag 'submit_to', submit_answer_sheet_path(@answer_sheet), :id => 'submit_to' %>
|