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,11 @@
|
|
|
1
|
+
<% if @page_element %>
|
|
2
|
+
$('#question_modal').dialog('close');
|
|
3
|
+
$('#page-preview').html('<%= escape_javascript(render('admin/question_pages/question_page')) %>');
|
|
4
|
+
$('#element_<%= dom_id(@element) %>').hide();
|
|
5
|
+
$('#element_form_<%= dom_id(@element) %>').html('<%= escape_javascript(render('admin/panels/prop_element',:element => @element)) %>');
|
|
6
|
+
$('#element_form_<%= dom_id(@element) %>').show();
|
|
7
|
+
selectElement("#element_<%= @element.id %>");
|
|
8
|
+
$.scrollTo("#element_<%= @element.id %>");
|
|
9
|
+
<% else %>
|
|
10
|
+
alert('That question already exists on this question sheet')
|
|
11
|
+
<% end %>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
$('#element_<%= dom_id(@element) %>').hide()
|
|
2
|
+
$('#element_form_<%= dom_id(@element) %>').html('<%= escape_javascript(render('admin/panels/prop_element',:element => @element)) %>')
|
|
3
|
+
$('#element_form_<%= dom_id(@element) %>').show();
|
|
4
|
+
selectElement("#element_<%= @element.id %>")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
if ($('#question_modal')[0] == null) {
|
|
2
|
+
$('body').append('<div id="question_modal"></div>');
|
|
3
|
+
}
|
|
4
|
+
$('#question_modal').html('<%= link_to("Add \"#{params[:human_type]}\"", admin_question_sheet_page_elements_path(:question_sheet_id => @page.question_sheet_id, :page_id => @page.id,
|
|
5
|
+
:element_type => params[:element_type], "element[style]" => @style, format: :js),
|
|
6
|
+
:remote => true,
|
|
7
|
+
:method => :post,
|
|
8
|
+
:class => "add_type") %><p>Or you can also use an existing <%= params[:human_type] %> element. If you are unsure, just <strong>Add <%= params[:human_type] %>.</strong></p><div id="questions_div" title=""></div>');
|
|
9
|
+
$('#questions_div').html("<%= escape_javascript(render('questions/questions', :questions => @questions)) %>")
|
|
10
|
+
$('#question_modal').dialog({width: 500, height: 400});
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
$('#element_form_<%= dom_id(@element) %>').hide();
|
|
2
|
+
$('#element_<%= dom_id(@element) %>').html('<%= escape_javascript(render('admin/question_pages/element_show', :element => @element)) %>')
|
|
3
|
+
$('#element_<%= dom_id(@element) %>').show()
|
|
4
|
+
clearCurrentElement()
|
|
5
|
+
$('#questions_list').sortable('refresh');
|
|
6
|
+
|
|
7
|
+
<% @page.question_grids.each do |grid| %>
|
|
8
|
+
$('#questions_list_<%= grid.id %>').sortable('refresh');
|
|
9
|
+
<% end %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<p><label for="email_template_name" class="desc">Template Name</label>
|
|
2
|
+
<%= f.text_field :name, :class => "text", :size => 93 %></p>
|
|
3
|
+
|
|
4
|
+
<p><label for="email_template_subject" class="desc">Subject</label>
|
|
5
|
+
<%= f.text_field :subject, :class => "text", :size => 93 %></p>
|
|
6
|
+
|
|
7
|
+
<p><label for="email_template_content" class="desc">Content</label>
|
|
8
|
+
<%= f.text_area :content, :rows => 25, :cols => 80, :class => "text" %>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div id="content">
|
|
2
|
+
<h1>Edit Email Template</h1>
|
|
3
|
+
|
|
4
|
+
<%= error_messages_for :email_template %>
|
|
5
|
+
|
|
6
|
+
<%= form_for(:email_template, :url => admin_email_template_path(@email_template), :html => { :method => :put } ) do |f| %>
|
|
7
|
+
<%= render :partial => 'form', :locals => {:f => f} %>
|
|
8
|
+
|
|
9
|
+
<p><%= submit_tag "Update" %> or <%= link_to "Cancel", admin_email_templates_path, :class => "cancel" %></p>
|
|
10
|
+
<% end %>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<div id="content">
|
|
2
|
+
<h1>Email Templates</h1>
|
|
3
|
+
|
|
4
|
+
<table cellspacing="0" class="list">
|
|
5
|
+
<tr>
|
|
6
|
+
<th>Template Name</th>
|
|
7
|
+
<th> </th>
|
|
8
|
+
</tr>
|
|
9
|
+
<% for email_template in @email_templates %>
|
|
10
|
+
<tr class="<%= cycle("","alt") %>">
|
|
11
|
+
<td><%= link_to email_template.name, edit_admin_email_template_path(email_template), :class => "email-template" %></td>
|
|
12
|
+
<td class="actions"><%= link_to 'Destroy', admin_email_template_path(email_template), data: {confirm: 'Are you sure?'}, :method => :delete, :class => "destroy" %></td>
|
|
13
|
+
</tr>
|
|
14
|
+
<% end %>
|
|
15
|
+
</table>
|
|
16
|
+
|
|
17
|
+
<br />
|
|
18
|
+
|
|
19
|
+
<%= link_to 'New Template', new_admin_email_template_path, :method => :GET, :class => "add-link" %>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div id="content">
|
|
2
|
+
<h1>New Email Template</h1>
|
|
3
|
+
|
|
4
|
+
<%= error_messages_for :email_template %>
|
|
5
|
+
|
|
6
|
+
<%= form_for(:email_template, :url => admin_email_templates_path) do |f| %>
|
|
7
|
+
<%= render :partial => 'form', :locals => {:f => f}%>
|
|
8
|
+
|
|
9
|
+
<p><%= submit_tag "Create" %> or <%= link_to "Cancel", admin_email_templates_path, :class => "cancel" %></p>
|
|
10
|
+
<% end %>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h3 id="<%= dom_id(element) %>-h3-show-advanced-options">Advanced Options<br/>
|
|
2
|
+
<a style="font-size: 11px; font-weight: normal; " href="#" onclick="$('#<%= dom_id(element) %>-pnl-advanced').show();$('#<%= dom_id(element) %>-h3-show-advanced-options').hide();return false;">Show Advanced Options</a></h3>
|
|
3
|
+
|
|
4
|
+
<div id="<%= dom_id(element) %>-pnl-advanced" style="display: none;">
|
|
5
|
+
<h3>Advanced Options<br/>
|
|
6
|
+
<a style="font-size: 11px; font-weight: normal; " href="#" onclick="$('#<%= dom_id(element) %>-pnl-advanced').hide();$('#<%= dom_id(element) %>-h3-show-advanced-options').show();return false;">Hide Advanced Options</a></h3>
|
|
7
|
+
|
|
8
|
+
<p><label for="element_object" class="desc">Object Name</label>
|
|
9
|
+
<%= f.text_field :object_name %></p>
|
|
10
|
+
|
|
11
|
+
<p><label for="element_object" class="desc">Attribute Name</label>
|
|
12
|
+
<%= f.text_field :attribute_name %></p>
|
|
13
|
+
|
|
14
|
+
<p><label for="element_object" class="desc">Max Length</label>
|
|
15
|
+
<%= f.text_field :max_length %></p>
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<p>
|
|
2
|
+
<label for="element_label" class="desc">Label <span class="required">required</span></label>
|
|
3
|
+
<%= f.text_field :label, :maxlength => Element.max_label_length %>
|
|
4
|
+
</p>
|
|
5
|
+
<div class="field">
|
|
6
|
+
<label for="element_tooltip" class="desc">Tip</label>
|
|
7
|
+
<%= f.text_field :tooltip %>
|
|
8
|
+
</div>
|
|
9
|
+
<p>
|
|
10
|
+
<label for="element_slug" class="desc">Variable</label>
|
|
11
|
+
<%= f.text_field :slug %>
|
|
12
|
+
<p>
|
|
13
|
+
|
|
14
|
+
<p>
|
|
15
|
+
<%= f.check_box :required, :class => 'inlinecheck' %>
|
|
16
|
+
<label for="element_required" class="inline">This field is required</label>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p><%= f.check_box :is_confidential, :class => 'inlinecheck' %> <label for="element_is_confidential" class="inline">This field is confidential</label></p>
|
|
20
|
+
|
|
21
|
+
<p>
|
|
22
|
+
<%= f.check_box :hide_label, :class => 'inlinecheck' %>
|
|
23
|
+
<label for="element_hide_label" class="inline">Hide Label</label>
|
|
24
|
+
</p>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<% route = { :question_sheet_id => @page.question_sheet_id, :page_id => @page.id } %>
|
|
2
|
+
|
|
3
|
+
<div id="panel-elements" class="panel">
|
|
4
|
+
|
|
5
|
+
<p class="instruction">Click an element to add it to the end of
|
|
6
|
+
your page (you can drag and drop fields to reorder them later). <a href="/fe/help/builder.html" class="lbOn help" id="link-builder-help" >Help</a></p>
|
|
7
|
+
|
|
8
|
+
<ul id="list-elements" class="list-elements">
|
|
9
|
+
<li id="sp"><%= link_to "Heading", admin_question_sheet_page_elements_path(route.merge(:element_type => "Fe::Section")),
|
|
10
|
+
:remote => true,
|
|
11
|
+
:method => :post %></li>
|
|
12
|
+
<li id="pa"><%= link_to "Paragraph", admin_question_sheet_page_elements_path(route.merge(:element_type => "Fe::Paragraph")),
|
|
13
|
+
:remote => true,
|
|
14
|
+
:method => :post %></li>
|
|
15
|
+
<li id="sl"><%= link_to "Short Answer", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::TextField", :human_type => 'Short Answer')),
|
|
16
|
+
:remote => true %></li>
|
|
17
|
+
<li id="ml"><%= link_to "Long Answer", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::TextField", :human_type => 'Long Answer')),
|
|
18
|
+
:remote => true %></li>
|
|
19
|
+
<li id="co"><%= link_to "Choose One", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::ChoiceField", :human_type => 'Choose One')),
|
|
20
|
+
:remote => true %></li>
|
|
21
|
+
<li id="cm"><%= link_to "Choose Many", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::ChoiceField", :human_type => 'Choose Many')),
|
|
22
|
+
:remote => true %></li>
|
|
23
|
+
<li id="dt"><%= link_to "Date", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::DateField", :human_type => 'Date')),
|
|
24
|
+
:remote => true %></li>
|
|
25
|
+
<li id="qg"><%= link_to "Grid", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::QuestionGrid", :human_type => 'Grid')),
|
|
26
|
+
:remote => true %></li>
|
|
27
|
+
<li id="at"><%= link_to "Attachment", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::AttachmentField", :human_type => 'Attachment')),
|
|
28
|
+
:remote => true %></li>
|
|
29
|
+
<li id="qgt"><%= link_to "Grid w/Total", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::QuestionGridWithTotal", :human_type => 'Grid w/Total')),
|
|
30
|
+
:remote => true %></li>
|
|
31
|
+
<%- unless Form.respond_to?(:no_refs) && Form.no_refs -%>
|
|
32
|
+
<li id="ref"><%= link_to "Reference", new_admin_question_sheet_page_element_path(route.merge(:element_type => "Fe::ReferenceQuestion", :human_type => 'Reference')),
|
|
33
|
+
:remote => true %></li>
|
|
34
|
+
<%- end -%>
|
|
35
|
+
</ul>
|
|
36
|
+
|
|
37
|
+
<p style="clear: both;"> </p>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<% route = { :question_sheet_id => @question_sheet.id, :id => @page.id } -%>
|
|
2
|
+
|
|
3
|
+
<li id="tab-pages_list" class="active"><%= link_to "Pages", show_panel_admin_question_sheet_page_path( route.merge(:panel_name => 'pages_list')), :remote => true, :method => :get %></li>
|
|
4
|
+
<li id="tab-insert"><%= link_to "Elements", show_panel_admin_question_sheet_page_path(route.merge(:panel_name => 'insert')), :remote => true, :method => :get %></li>
|
|
5
|
+
<li id="tab-properties"><%= link_to "Properties", show_panel_admin_question_sheet_page_path(route.merge(:panel_name => 'properties')), :remote => true, :method => :get %></li>
|
|
6
|
+
<div class="clear"></div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div id="panel-pages" class="panel">
|
|
2
|
+
<div>
|
|
3
|
+
|
|
4
|
+
<%= link_to "Add a page", admin_question_sheet_pages_path(@page.question_sheet_id), :remote => true, :method => :post, :id => "link-page-add" %>
|
|
5
|
+
|
|
6
|
+
<ul id="list-pages" data-sortable="true" data-sortable-url="<%= reorder_admin_question_sheet_pages_path(@page.question_sheet_id) %>">
|
|
7
|
+
<%= render :partial => 'admin/panels/page', :collection => @all_pages, :locals => { :current_page => @page } %>
|
|
8
|
+
</ul>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<p class="instruction">Select a page to edit. Click 'Add a page'
|
|
16
|
+
to add a page to your form. <a href="/fe/help/builder.html" class="help" id="link-builder-help" >Help</a></p>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<%- options = [ OptionGroup.new('Choose One', [
|
|
2
|
+
Option.new('drop-down', 'Drop Down'),
|
|
3
|
+
Option.new('radio', 'Radio Buttons'),
|
|
4
|
+
Option.new('rating', 'Rating'),
|
|
5
|
+
Option.new('acceptance', 'Acceptance'),
|
|
6
|
+
Option.new('yes-no', 'Yes/No'),
|
|
7
|
+
Option.new('country', 'Country')
|
|
8
|
+
]),
|
|
9
|
+
OptionGroup.new('Choose Many', [
|
|
10
|
+
Option.new('checkbox', 'Checkboxes')
|
|
11
|
+
])
|
|
12
|
+
]
|
|
13
|
+
%>
|
|
14
|
+
<div class="field"><label for="element_style" class="desc">Style</label>
|
|
15
|
+
<%= select_tag 'element[style]', option_groups_from_collection_for_select(options, 'group', 'label', 'key', 'value', @element.style),
|
|
16
|
+
:onchange => "if(['acceptance', 'yes-no'].include($F('element[style]'))) $('choices_section').hide(); else $('choices_section').show();" %></div>
|
|
17
|
+
|
|
18
|
+
<%= render 'admin/panels/common_fields', :f => f %>
|
|
19
|
+
|
|
20
|
+
<div id="choices_section" style="display:<%= ['acceptance', 'yes-no'].include?(@element.style) ? 'none' : 'block' %>">
|
|
21
|
+
<h3>Choices<br/>
|
|
22
|
+
<% showXML = !@element.source.blank? %>
|
|
23
|
+
<a id="link-show-xml" style="font-size: 11px; font-weight: normal; display:<% if showXML -%>none<%else-%>block<%end-%>" href="javascript:void(0);" onclick="$('xmlChoices').show();$('link-show-csv').show();$('link-show-xml').hide();$('csvChoices').hide();">Use External XML Feed</a>
|
|
24
|
+
<a id="link-show-csv" style="font-size: 11px; font-weight: normal; display:<% if showXML -%>block<%else-%>none<%end-%>" href="javascript:void(0);" onclick="$('csvChoices').show();$('link-show-xml').show();$('link-show-csv').hide();$('xmlChoices').hide();">Manually Enter Choices</a></h3>
|
|
25
|
+
|
|
26
|
+
<div id="csvChoices" style="display:<% if showXML -%>none<%else-%>block<%end-%>">
|
|
27
|
+
<p><label for="element_content" class="desc">Choices</label>
|
|
28
|
+
<%= f.text_area :content, :rows => 4, :cols => 25 %></p>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<p>
|
|
32
|
+
<%= f.check_box :hide_option_labels, :class => 'inlinecheck' %>
|
|
33
|
+
<label for="element_hide_option_labels" class="inline">Hide Option Labels</label>
|
|
34
|
+
</p>
|
|
35
|
+
|
|
36
|
+
<div id="xmlChoices" style="display:<% if showXML -%>block<%else-%>none<%end-%>">
|
|
37
|
+
<p><label for="element_source" class="desc">XML Feed for Choices</label>
|
|
38
|
+
<%= f.text_field :source %></p>
|
|
39
|
+
|
|
40
|
+
<p><label for="element_text_xpath" class="desc">XPath to Choice Text</label>
|
|
41
|
+
<%= f.text_field :text_xpath %></p>
|
|
42
|
+
|
|
43
|
+
<p><label for="element_value_xpath" class="desc">XPath to Choice Value</label>
|
|
44
|
+
<%= f.text_field :value_xpath %></p>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<div id="panel-properties-element" class="panel" style="display:block;">
|
|
2
|
+
<p>Update the settings for this element.</p>
|
|
3
|
+
|
|
4
|
+
<div id="errors">
|
|
5
|
+
<%= render :partial => 'errors', :locals => { :element => element }%>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<%= form_for :element, :url => admin_question_sheet_page_element_path( @page.question_sheet_id, @page.id, element.id), :remote => true, :html => {:method => :put} do |f| -%>
|
|
9
|
+
|
|
10
|
+
<%= render :partial => 'admin/panels/prop_' + element.class.to_s.underscore, :locals => { :f => f, :element => element } %>
|
|
11
|
+
|
|
12
|
+
<% if element.question? -%>
|
|
13
|
+
<!-- <h3>Dependency</h3>
|
|
14
|
+
<p><strong>Ask this question if:</strong></p>
|
|
15
|
+
<% element.conditions.each_with_index do |condition, i| %>
|
|
16
|
+
<%#= render :partial => 'admin/panels/condition', :object => condition, :locals => {:i => i} %>
|
|
17
|
+
<% end %> -->
|
|
18
|
+
|
|
19
|
+
<%= render :partial => 'admin/panels/advanced_options', :locals => { :f => f, :element => element } %>
|
|
20
|
+
<% end-%>
|
|
21
|
+
|
|
22
|
+
<p class="buttons">
|
|
23
|
+
<button type="submit"><span>Update</span></button>
|
|
24
|
+
<%= link_to('Close', '#', 'data-dom_id' => dom_id(element), :class => 'close_prop') %>
|
|
25
|
+
<%#= link_to('Delete', admin_question_sheet_page_element_path( @page.question_sheet_id, @page.id, element.id), :remote => true, :method => :delete, data: {:confirm => "Are you sure you want to delete this element?"}) %>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<% end -%>
|
|
29
|
+
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div id="panel-properties-page" class="panel" style="display:block;">
|
|
2
|
+
<p>Update the settings for this page.</p>
|
|
3
|
+
|
|
4
|
+
<div id="errors">
|
|
5
|
+
<%= render :partial => 'errors', :locals => { :page => page }%>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<%= form_for(page, :url => admin_question_sheet_page_path(page.question_sheet_id, page.id), :remote => true, :html => {:method => :put}) do |f| %>
|
|
9
|
+
<p><label for="" class="desc">Label <span class="required">required</span></label>
|
|
10
|
+
<%= f.text_field :label, maxlength: 100, size: 40 %></p>
|
|
11
|
+
|
|
12
|
+
<p><label for="" class="desc">Hidden</label>
|
|
13
|
+
<%= f.check_box :hidden %></p>
|
|
14
|
+
|
|
15
|
+
<p class="buttons">
|
|
16
|
+
<%= submit_tag "Update »".html_safe %>
|
|
17
|
+
</p>
|
|
18
|
+
<p class="buttons"><%= link_to "Delete", admin_question_sheet_page_path(page.question_sheet_id, page.id), :remote => true, :method => :delete, data: {confirm: "Are you sure you want to delete this page?"} %></p>
|
|
19
|
+
<% end %>
|
|
20
|
+
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<p>
|
|
2
|
+
<label for="element_content" class="desc">Paragraph Content</label>
|
|
3
|
+
<%= f.text_area :content, :rows => 4, :cols => 25, :id => "element_content_#{element.id}" %>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
<script type="text/javascript" charset="utf-8">
|
|
7
|
+
$(function() {
|
|
8
|
+
if (CKEDITOR.instances['element_content_<%= element.id %>']) {
|
|
9
|
+
CKEDITOR.instances['element_content_<%= element.id %>'].destroy();
|
|
10
|
+
}
|
|
11
|
+
editor = CKEDITOR.replace( 'element_content_<%= element.id %>', {
|
|
12
|
+
toolbar : [['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link']],
|
|
13
|
+
on :
|
|
14
|
+
{
|
|
15
|
+
instanceReady : function( ev )
|
|
16
|
+
{
|
|
17
|
+
// Output paragraphs as <p>Text</p>.
|
|
18
|
+
this.dataProcessor.writer.setRules( 'p',
|
|
19
|
+
{
|
|
20
|
+
indent : false,
|
|
21
|
+
breakBeforeOpen : true,
|
|
22
|
+
breakAfterOpen : false,
|
|
23
|
+
breakBeforeClose : false,
|
|
24
|
+
breakAfterClose : true
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<p><%= link_to "Question Grid Help", "/fe/help/question_grid.html", { :class=>"lbOn", :id => "link-question-grid-help" } %></p>
|
|
2
|
+
|
|
3
|
+
<%= render 'admin/panels/common_fields', :f => f %>
|
|
4
|
+
|
|
5
|
+
<p>
|
|
6
|
+
<label for="element_style" class="desc">Style</label>
|
|
7
|
+
<%= f.select :style, [["Standard", "standard"], ["Radio Grid", "radio"]] %>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<div class="field">
|
|
11
|
+
<label for="element_slug" class="desc">Column Headings <span class="required">required</span></label>
|
|
12
|
+
<%= f.text_field :cols %><br/>
|
|
13
|
+
<span class="help">Separate column headings by a semi-colon. This determines how many columns the grid will contain and what the column headings will be. </span>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="field">
|
|
17
|
+
<label for="css_id" class="desc">Css ID</label>
|
|
18
|
+
<%= f.text_field :css_id %>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="field">
|
|
21
|
+
<label for="css_class" class="desc">Css Class</label>
|
|
22
|
+
<%= f.text_field :css_class %>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<p><%= link_to "Question Grid Help", "/fe/help/question_grid.html", { :class=>"lbOn", :id => "link-question-grid-help" } %></p>
|
|
2
|
+
|
|
3
|
+
<div class="field">
|
|
4
|
+
<label for="element_slug" class="desc">Column Headings <span class="required">required</span></label>
|
|
5
|
+
<%= f.text_field :cols %><br/>
|
|
6
|
+
<span class="help">Separate column headings by a semi-colon. This determines how many columns the grid will contain and what the column headings will be. </span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="field">
|
|
9
|
+
<label for="element_slug" class="desc">Total Columns <span class="required">required</span></label>
|
|
10
|
+
<%= f.text_field :total_cols %><br/>
|
|
11
|
+
<span class="help">Which columns should be totaled? e.g. 2 OR 2,3</span>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<%= render 'admin/panels/common_fields', :f => f %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div class="field">
|
|
2
|
+
<label for="element_style" class="desc">Related Question Sheet
|
|
3
|
+
<%= image_tag('fe/icons/question-balloon.png', :title => "This list includes any template with 'Reference' in the name.") %></label>
|
|
4
|
+
<%= f.select :related_question_sheet_id, (QuestionSheet.active.where("label like '%reference%'").order(:label).all - [@page.question_sheet]).collect {|qs| [qs.label, qs.id]} %>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div class="field">
|
|
8
|
+
<label for="element_style" class="desc">Style</label>
|
|
9
|
+
<%= f.select :style, [["Peer", "peer"], ["Spiritual", "spiritual"], ["Parent", "parent"]] %>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<%= render 'admin/panels/common_fields', :f => f %>
|