surveyor_gui 0.0.3 → 0.1.0
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 +4 -4
- data/CHANGELOG.md +32 -0
- data/README.md +22 -2
- data/app/controllers/surveyor_gui/answers_controller.rb +3 -0
- data/app/controllers/surveyor_gui/application_controller.rb +3 -0
- data/app/controllers/{dependencys_controller.rb → surveyor_gui/dependencys_controller.rb} +5 -5
- data/app/controllers/{question_groups_controller.rb → surveyor_gui/question_groups_controller.rb} +13 -7
- data/app/controllers/{questions_controller.rb → surveyor_gui/questions_controller.rb} +6 -6
- data/app/controllers/surveyor_gui/reports_controller.rb +6 -6
- data/app/controllers/surveyor_gui/responses_controller.rb +3 -1
- data/app/controllers/surveyor_gui/survey_controller.rb +1 -1
- data/app/controllers/{survey_sections_controller.rb → surveyor_gui/survey_sections_controller.rb} +5 -5
- data/app/controllers/{surveyforms_controller.rb → surveyor_gui/surveyforms_controller.rb} +1 -1
- data/app/controllers/{surveyor_controller.rb → surveyor_gui/surveyor_controller.rb} +2 -2
- data/app/helpers/surveyor_gui/application_helper.rb +2 -0
- data/app/helpers/{dependency_helper.rb → surveyor_gui/dependencys_helper.rb} +1 -1
- data/app/helpers/surveyor_gui/question_groups_helper.rb +3 -0
- data/app/helpers/{question_helper.rb → surveyor_gui/questions_helper.rb} +1 -1
- data/app/helpers/surveyor_gui/{report_helper.rb → reports_helper.rb} +1 -1
- data/app/helpers/surveyor_gui/surveyforms_helper.rb +160 -0
- data/app/helpers/{surveyor_helper.rb → surveyor_gui/surveyor_helper.rb} +1 -1
- data/app/models/question_group_tracker.rb +19 -0
- data/app/views/layouts/{application.html.erb → surveyor_gui/application.html.erb} +0 -0
- data/app/views/layouts/{surveyor_gui_blank.html.erb → surveyor_gui/surveyor_gui_blank.html.erb} +1 -0
- data/app/views/layouts/{surveyor_gui_default.html.erb → surveyor_gui/surveyor_gui_default.html.erb} +1 -0
- data/app/views/layouts/{surveyor_modified.html.erb → surveyor_gui/surveyor_modified.html.erb} +0 -0
- data/app/views/{dependencys → surveyor_gui/dependencys}/_column.html.erb +0 -0
- data/app/views/{dependencys → surveyor_gui/dependencys}/_dependency.html.erb +0 -0
- data/app/views/{dependencys → surveyor_gui/dependencys}/_dependency_condition_fields.html.erb +0 -0
- data/app/views/{dependencys → surveyor_gui/dependencys}/_form.html.erb +0 -0
- data/app/views/{dependencys → surveyor_gui/dependencys}/blank.html.erb +0 -0
- data/app/views/{dependencys → surveyor_gui/dependencys}/edit.html.erb +0 -0
- data/app/views/{dependencys → surveyor_gui/dependencys}/new.html.erb +0 -0
- data/app/views/{partials → surveyor_gui/partials}/_answer.html.haml +0 -0
- data/app/views/{partials → surveyor_gui/partials}/_question.html.haml +0 -0
- data/app/views/{partials → surveyor_gui/partials}/_question_group.html.haml +0 -0
- data/app/views/{partials → surveyor_gui/partials}/_section.html.haml +0 -0
- data/app/views/surveyor_gui/partials/_url_helpers.html.erb +5 -0
- data/app/views/{question_groups → surveyor_gui/question_groups}/_form.html.erb +2 -1
- data/app/views/{question_groups → surveyor_gui/question_groups}/_group_inline_field.html.erb +0 -0
- data/app/views/{question_groups → surveyor_gui/question_groups}/_group_inline_fields.html.erb +0 -0
- data/app/views/{question_groups → surveyor_gui/question_groups}/blank.html.erb +0 -0
- data/app/views/{question_groups → surveyor_gui/question_groups}/edit.html.erb +0 -0
- data/app/views/{question_groups → surveyor_gui/question_groups}/new.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/_answer_fields.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/_answer_options.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/_form.html.erb +2 -1
- data/app/views/{questions → surveyor_gui/questions}/_grid_dropdown_columns.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/_grid_dropdown_fields.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/_grid_fields.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/_no_picks.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/_pick.html +0 -0
- data/app/views/{questions → surveyor_gui/questions}/_picks.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/blank.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/edit.html.erb +0 -0
- data/app/views/{questions → surveyor_gui/questions}/new.html.erb +0 -0
- data/app/views/surveyor_gui/responses/_survey_results.html.haml +1 -1
- data/app/views/surveyor_gui/responses/index.html.haml +1 -1
- data/app/views/surveyor_gui/shared/_report_data.html.haml +17 -14
- data/app/views/{survey_sections → surveyor_gui/survey_sections}/_form.html.erb +0 -0
- data/app/views/{survey_sections → surveyor_gui/survey_sections}/blank.html.erb +0 -0
- data/app/views/{survey_sections → surveyor_gui/survey_sections}/edit.html.erb +0 -0
- data/app/views/{survey_sections → surveyor_gui/survey_sections}/new.html.erb +0 -0
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/_form.html.erb +4 -4
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/_question_field.html.erb +0 -0
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/_question_group.html.erb +14 -14
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/_question_group_fields.html.erb +0 -0
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/_question_name_and_number.html.erb +0 -0
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/_question_section.html.erb +0 -0
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/_question_wrapper.html.erb +14 -15
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/_survey_section_fields.html.erb +11 -12
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/clone_survey.html.erb +0 -0
- data/app/views/surveyor_gui/surveyforms/edit.html.erb +5 -0
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/index.html.erb +2 -2
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/new.html.erb +0 -0
- data/app/views/{surveyforms → surveyor_gui/surveyforms}/show.html.erb +0 -0
- data/config/routes.rb +20 -22
- data/lib/assets/javascripts/surveyor_gui/surveyor_gui.js +25 -14
- data/lib/assets/stylesheets/surveyor_gui/surveyor_gui.sass +2 -0
- data/lib/generators/surveyor_gui/install_generator.rb +1 -1
- data/lib/generators/surveyor_gui/templates/app/views/layouts/{surveyor_gui_default.html.erb → surveyor_gui/surveyor_gui_default.html.erb} +1 -0
- data/lib/surveyor_gui/engine.rb +2 -1
- data/lib/surveyor_gui/models/response_set_methods.rb +2 -1
- data/lib/surveyor_gui/surveyforms_controller_methods.rb +1 -1
- data/lib/surveyor_gui/version.rb +1 -1
- data/spec/controllers/surveyforms_controller_spec.rb +10 -9
- data/spec/features/create_survey_spec.rb +2 -3
- data/spec/features/dependencies_spec.rb +1 -1
- data/spec/support/surveyforms_creation_helpers.rb +4 -4
- data/spec/views/questions/edit.html.erb_spec.rb +4 -3
- data/spec/views/surveyforms/edit.html.erb_spec.rb +1 -1
- metadata +71 -67
- data/app/controllers/answers_controller.rb +0 -3
- data/app/controllers/application_controller.rb +0 -3
- data/app/helpers/application_helper.rb +0 -2
- data/app/helpers/surveyform_helper.rb +0 -179
- data/app/views/surveyforms/edit.html.erb +0 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class QuestionGroupTracker
|
|
2
|
+
attr_reader :questions, :question_group_id, :question_group
|
|
3
|
+
def initialize(question_group_id)
|
|
4
|
+
@questions = Question.where('question_group_id=?',question_group_id)
|
|
5
|
+
@counter = 0
|
|
6
|
+
@question_group_id = question_group_id
|
|
7
|
+
@question_group = QuestionGroup.find(question_group_id)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def check_for_new_group(question)
|
|
11
|
+
if question.question_group_id != @question_group_id || !defined?(@initial_check)
|
|
12
|
+
initialize(question.question_group_id)
|
|
13
|
+
@initial_check = true
|
|
14
|
+
return true
|
|
15
|
+
else
|
|
16
|
+
return false
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
File without changes
|
data/app/views/layouts/{surveyor_modified.html.erb → surveyor_gui/surveyor_modified.html.erb}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/app/views/{dependencys → surveyor_gui/dependencys}/_dependency_condition_fields.html.erb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<div id="no_picks_partial_url" data-render_no_picks_partial_url="<%= surveyor_gui.render_no_picks_partial_questions_url%>"></div>
|
|
2
|
+
<div id="answer_fields_partial_url" data-answer_fields_partial_url="<%= surveyor_gui.render_answer_fields_partial_questions_url%>"></div>
|
|
3
|
+
<div id="render_grid_partial_url" data-render_grid_partial_url="<%= surveyor_gui.render_grid_partial_questions_url%>"></div>
|
|
4
|
+
<div id="render_group_inline_partial_url" data-render_group_inline_partial_url="<%= surveyor_gui.render_group_inline_partial_questions_url%>"></div>
|
|
5
|
+
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<div class="question_group_editor shadebox">
|
|
2
|
+
<%= render "surveyor_gui/partials/url_helpers" %>
|
|
2
3
|
<h1 ><%= @title %></h1>
|
|
3
4
|
<%= simple_form_for @question_group do |qg| %>
|
|
4
5
|
<div class = 'questions'>
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
<%= qg.hidden_field :id %>
|
|
7
8
|
<%= qg.hidden_field :display_type %>
|
|
8
9
|
<%= qg.hidden_field :question_id %>
|
|
9
|
-
<%= qg.
|
|
10
|
+
<%= qg.input :survey_section_id, as: :hidden, input_html: { value: @survey_section_id }%>
|
|
10
11
|
|
|
11
12
|
<%= qg.label :Question, :input_html=>{:size=>'15'} %>
|
|
12
13
|
<%= qg.input :text , :input_html=>{:size=>'55'}, :label => false%>
|
data/app/views/{question_groups → surveyor_gui/question_groups}/_group_inline_field.html.erb
RENAMED
|
File without changes
|
data/app/views/{question_groups → surveyor_gui/question_groups}/_group_inline_fields.html.erb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<div class="question_editor shadebox">
|
|
2
|
+
<%= render "surveyor_gui/partials/url_helpers" %>
|
|
2
3
|
<h1 ><%= @title %></h1>
|
|
3
|
-
<%= simple_form_for @question do |f| %>
|
|
4
|
+
<%= simple_form_for [surveyor_gui, @question] do |f| %>
|
|
4
5
|
<div class = 'questions'>
|
|
5
6
|
<%= f.error_messages %>
|
|
6
7
|
<%= f.hidden_field :id %>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
- r = @response_set.responses.where(:question_id => q.id).first
|
|
32
32
|
= q.prefix
|
|
33
33
|
- if [:number, :date, :datetime, :time].include? q.question_type_id
|
|
34
|
-
= ReportFormatter.new(q,r).format_stats(r.response_value.to_f)
|
|
34
|
+
= ReportFormatter.new(q,r).format_stats(r.response_value.to_f) if r
|
|
35
35
|
- else
|
|
36
36
|
= r.response_value if r
|
|
37
37
|
\
|
|
@@ -6,19 +6,22 @@
|
|
|
6
6
|
%tr{:style => "font-weight:bold;"}
|
|
7
7
|
%td User Id
|
|
8
8
|
%td Response
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
%
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
- response_formatter = ReportFormatter.new(q, @responses)
|
|
10
|
+
- @response_sets.each do |response_set|
|
|
11
|
+
- @responses.where(question_id: q.id, response_set_id: response_set).each do |r|
|
|
12
|
+
%tr
|
|
13
|
+
%td= r.response_set.report_user_name
|
|
14
|
+
%td.table_number
|
|
15
|
+
= q.prefix
|
|
16
|
+
- if [:number, :date, :datetime, :time].include? q.question_type_id
|
|
17
|
+
= response_formatter.format_stats(r.response_value.to_f)
|
|
18
|
+
- else
|
|
19
|
+
= r.response_value
|
|
20
|
+
\
|
|
21
|
+
= q.suffix
|
|
22
|
+
- if q.answers.is_comment.count > 0
|
|
23
|
+
= render "surveyor_gui/shared/new_line"
|
|
24
|
+
= render "surveyor_gui/shared/pick_comments", q: q, extra_column: false
|
|
25
|
+
- if q.question_type_id == :pick_any
|
|
22
26
|
= render "surveyor_gui/shared/new_line"
|
|
23
|
-
= render "surveyor_gui/shared/pick_comments", q: q, extra_column: false
|
|
24
27
|
= render "surveyor_gui/shared/new_line"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
<h1 class="round-top">
|
|
7
7
|
<%= @title %>
|
|
8
8
|
<% if @surveyform.id -%>
|
|
9
|
-
<input class="preview-button" onclick="preview_cbox('<%=
|
|
9
|
+
<input class="preview-button" onclick="preview_cbox('<%= surveyor_gui.survey_url(@surveyform.id) %>',
|
|
10
10
|
<%= @surveyform.id %>);" type="button" value="Preview Survey" />
|
|
11
|
-
<input class="preview-button" onclick="preview_cbox('<%=
|
|
11
|
+
<input class="preview-button" onclick="preview_cbox('<%= surveyor_gui.preview_response_url(@surveyform.id) %>',
|
|
12
12
|
<%= @surveyform.id %>);" type="button" value="Preview Response" />
|
|
13
|
-
<input class="preview-button" onclick="preview_cbox('<%=
|
|
13
|
+
<input class="preview-button" onclick="preview_cbox('<%= surveyor_gui.preview_report_url(@surveyform.id) %>',
|
|
14
14
|
<%= @surveyform.id %>);" type="button" value="Preview Report" />
|
|
15
15
|
<% end %>
|
|
16
16
|
</h1>
|
|
17
|
-
<%= simple_form_for
|
|
17
|
+
<%= simple_form_for [surveyor_gui, @surveyform] do |f| %>
|
|
18
18
|
<%= f.error_messages %>
|
|
19
19
|
<br/>
|
|
20
20
|
<%= f.hidden_field :id %>
|
|
File without changes
|
|
@@ -23,23 +23,23 @@
|
|
|
23
23
|
<span class="question_button_bar">
|
|
24
24
|
|
|
25
25
|
<button type="button" id="edit_question"
|
|
26
|
-
data-replace_question_url="<%=
|
|
26
|
+
data-replace_question_url="<%=surveyor_gui.replace_question_surveyform_path(
|
|
27
27
|
id: f.object.survey_section.survey.id,
|
|
28
28
|
question_id: f.object.id)%>"
|
|
29
|
-
data-edit_question_url="<%= (f.object.part_of_group? && f.object.question_group.display_type != 'grid') ? edit_question_group_url(f.object.question_group.id) : edit_question_url(f.object.id)%>"
|
|
29
|
+
data-edit_question_url="<%= (f.object.part_of_group? && f.object.question_group.display_type != 'grid') ? surveyor_gui.edit_question_group_url(f.object.question_group.id) : surveyor_gui.edit_question_url(f.object.id)%>"
|
|
30
30
|
data-question_id="<%= f.object.id.to_s %>"
|
|
31
31
|
>Edit Question</button>
|
|
32
32
|
|
|
33
33
|
<button type="button" id="cut_question"
|
|
34
|
-
data-cut_question_surveyform_url="<%=cut_question_surveyform_url(
|
|
34
|
+
data-cut_question_surveyform_url="<%=surveyor_gui.cut_question_surveyform_url(
|
|
35
35
|
id: f.object.survey_section.survey.id,
|
|
36
36
|
question_id: f.object.id)%>"
|
|
37
37
|
data-question_already_cut="<%= session[:cut_question] %>"
|
|
38
38
|
>Cut Question</button>
|
|
39
39
|
|
|
40
40
|
<button type="button" id="delete_question"
|
|
41
|
-
data-question_url="<%=question_url(f.object.id)%>"
|
|
42
|
-
data-replace_form_surveyform_url="<%= replace_form_surveyform_url(
|
|
41
|
+
data-question_url="<%=surveyor_gui.question_url(f.object.id)%>"
|
|
42
|
+
data-replace_form_surveyform_url="<%= surveyor_gui.replace_form_surveyform_url(
|
|
43
43
|
id: f.object.survey_section.survey.id,
|
|
44
44
|
survey_section_id: f.object.survey_section_id) %>"
|
|
45
45
|
>Delete Question</button>
|
|
@@ -49,24 +49,24 @@
|
|
|
49
49
|
<% if f.object.question_group.dependent? -%>
|
|
50
50
|
|
|
51
51
|
<button type="button" id="delete_logic"
|
|
52
|
-
data-replace_question_url="<%=
|
|
53
|
-
data-dependency_url="<%= dependency_url(f.object.id) %>"
|
|
52
|
+
data-replace_question_url="<%=surveyor_gui.replace_question_surveyform_path(:question_id => f.object.id)%>"
|
|
53
|
+
data-dependency_url="<%= surveyor_gui.dependency_url(f.object.id) %>"
|
|
54
54
|
data-question_id="<%= f.object.id.to_s %>"
|
|
55
55
|
>Delete Logic</button>
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
<button type="button" id="edit_logic"
|
|
59
|
-
data-replace_question_url="<%=
|
|
60
|
-
data-edit_dependency_url="<%= edit_dependency_url(f.object.id) %>"
|
|
59
|
+
data-replace_question_url="<%=surveyor_gui.replace_question_surveyform_path(:question_id => f.object.id)%>"
|
|
60
|
+
data-edit_dependency_url="<%= surveyor_gui.edit_dependency_url(f.object.id) %>"
|
|
61
61
|
data-question_id="<%= f.object.id.to_s %>"
|
|
62
62
|
>Edit Logic</button>
|
|
63
63
|
|
|
64
64
|
<% else -%>
|
|
65
65
|
<button type="button" id="add_logic"
|
|
66
|
-
data-replace_question_url="<%=
|
|
66
|
+
data-replace_question_url="<%=surveyor_gui.replace_question_surveyform_path(
|
|
67
67
|
id: f.object.survey_section.survey.id,
|
|
68
68
|
question_id: f.object.id)%>"
|
|
69
|
-
data-new_dependency_url="<%= new_dependency_url(:id=>f.object.id) %>"
|
|
69
|
+
data-new_dependency_url="<%= surveyor_gui.new_dependency_url(:id=>f.object.id) %>"
|
|
70
70
|
data-question_id="<%= f.object.id.to_s %>"
|
|
71
71
|
>Add Logic</button>
|
|
72
72
|
<% end %>
|
|
@@ -95,15 +95,15 @@
|
|
|
95
95
|
<div class="question_buttons_bottom">
|
|
96
96
|
|
|
97
97
|
<button type="button" id="add_question" class="cut"
|
|
98
|
-
data-insert_new_question_url="<%=insert_new_question_surveyform_url(id: f.object.survey_section.survey.id, ) %>"
|
|
99
|
-
data-new_question_url="<%=new_question_url%>"
|
|
98
|
+
data-insert_new_question_url="<%=surveyor_gui.insert_new_question_surveyform_url(id: f.object.survey_section.survey.id, ) %>"
|
|
99
|
+
data-new_question_url="<%=surveyor_gui.new_question_url%>"
|
|
100
100
|
data-prev_question_id="<%= f.object.id.to_s %>"
|
|
101
101
|
>Add Question</button>
|
|
102
102
|
|
|
103
103
|
<% if session[:cut_question] -%>
|
|
104
104
|
|
|
105
105
|
<button type="button" id="paste_question"
|
|
106
|
-
data-paste_question_surveyform_url="<%= paste_question_surveyform_url(
|
|
106
|
+
data-paste_question_surveyform_url="<%= surveyor_gui.paste_question_surveyform_url(
|
|
107
107
|
id: f.object.survey_section.survey.id,
|
|
108
108
|
question_id: f.object.id) %>"
|
|
109
109
|
>Paste Question</button>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -23,23 +23,22 @@
|
|
|
23
23
|
<span class="question_button_bar">
|
|
24
24
|
|
|
25
25
|
<button type="button" id="edit_question"
|
|
26
|
-
data-replace_question_url="<%=
|
|
27
|
-
id: f.object.survey_section.survey.id,
|
|
26
|
+
data-replace_question_url="<%=surveyor_gui.replace_question_surveyform_path(id: f.object.survey_section.survey.id,
|
|
28
27
|
question_id: f.object.id)%>"
|
|
29
|
-
data-edit_question_url="<%=edit_question_url(f.object.id)%>"
|
|
28
|
+
data-edit_question_url="<%=surveyor_gui.edit_question_url(f.object.id)%>"
|
|
30
29
|
data-question_id="<%= f.object.id.to_s %>"
|
|
31
30
|
>Edit Question</button>
|
|
32
31
|
|
|
33
32
|
<button type="button" id="cut_question"
|
|
34
|
-
data-cut_question_surveyform_url="<%=cut_question_surveyform_url(
|
|
33
|
+
data-cut_question_surveyform_url="<%=surveyor_gui.cut_question_surveyform_url(
|
|
35
34
|
id: f.object.survey_section.survey.id,
|
|
36
35
|
question_id: f.object.id)%>"
|
|
37
36
|
data-question_already_cut="<%= session[:cut_question] %>"
|
|
38
37
|
>Cut Question</button>
|
|
39
38
|
|
|
40
39
|
<button type="button" id="delete_question"
|
|
41
|
-
data-question_url="<%=question_url(f.object.id)%>"
|
|
42
|
-
data-replace_form_surveyform_url="<%= replace_form_surveyform_url(
|
|
40
|
+
data-question_url="<%=surveyor_gui.question_url(f.object.id)%>"
|
|
41
|
+
data-replace_form_surveyform_url="<%= surveyor_gui.replace_form_surveyform_url(
|
|
43
42
|
id: f.object.survey_section.survey.id,
|
|
44
43
|
survey_section_id: f.object.survey_section_id) %>"
|
|
45
44
|
>Delete Question</button>
|
|
@@ -49,24 +48,24 @@
|
|
|
49
48
|
<% if f.object.dependent? -%>
|
|
50
49
|
|
|
51
50
|
<button type="button" id="delete_logic"
|
|
52
|
-
data-replace_question_url="<%=
|
|
53
|
-
data-dependency_url="<%= dependency_url(f.object.id) %>"
|
|
51
|
+
data-replace_question_url="<%=surveyor_gui.replace_question_surveyform_path(:question_id => f.object.id)%>"
|
|
52
|
+
data-dependency_url="<%= surveyor_gui.dependency_url(f.object.id) %>"
|
|
54
53
|
data-question_id="<%= f.object.id.to_s %>"
|
|
55
54
|
>Delete Logic</button>
|
|
56
55
|
|
|
57
56
|
|
|
58
57
|
<button type="button" id="edit_logic"
|
|
59
|
-
data-replace_question_url="<%=
|
|
60
|
-
data-edit_dependency_url="<%= edit_dependency_url(f.object.id) %>"
|
|
58
|
+
data-replace_question_url="<%=surveyor_gui.replace_question_surveyform_path(:question_id => f.object.id)%>"
|
|
59
|
+
data-edit_dependency_url="<%= surveyor_gui.edit_dependency_url(f.object.id) %>"
|
|
61
60
|
data-question_id="<%= f.object.id.to_s %>"
|
|
62
61
|
>Edit Logic</button>
|
|
63
62
|
|
|
64
63
|
<% else -%>
|
|
65
64
|
<button type="button" id="add_logic"
|
|
66
|
-
data-replace_question_url="<%=
|
|
65
|
+
data-replace_question_url="<%=surveyor_gui.replace_question_surveyform_path(
|
|
67
66
|
id: f.object.survey_section.survey.id,
|
|
68
67
|
question_id: f.object.id)%>"
|
|
69
|
-
data-new_dependency_url="<%= new_dependency_url(:id=>f.object.id) %>"
|
|
68
|
+
data-new_dependency_url="<%= surveyor_gui.new_dependency_url(:id=>f.object.id) %>"
|
|
70
69
|
data-question_id="<%= f.object.id.to_s %>"
|
|
71
70
|
>Add Logic</button>
|
|
72
71
|
<% end %>
|
|
@@ -88,15 +87,15 @@
|
|
|
88
87
|
<div class="question_buttons_bottom">
|
|
89
88
|
|
|
90
89
|
<button type="button" id="add_question" class="cut"
|
|
91
|
-
data-insert_new_question_url="<%=insert_new_question_surveyform_url(id: f.object.survey_section.survey.id, ) %>"
|
|
92
|
-
data-new_question_url="<%=new_question_url%>"
|
|
90
|
+
data-insert_new_question_url="<%=surveyor_gui.insert_new_question_surveyform_url(id: f.object.survey_section.survey.id, ) %>"
|
|
91
|
+
data-new_question_url="<%=surveyor_gui.new_question_url%>"
|
|
93
92
|
data-prev_question_id="<%= f.object.id.to_s %>"
|
|
94
93
|
>Add Question</button>
|
|
95
94
|
|
|
96
95
|
<% if session[:cut_question] -%>
|
|
97
96
|
|
|
98
97
|
<button type="button" id="paste_question"
|
|
99
|
-
data-paste_question_surveyform_url="<%= paste_question_surveyform_url(
|
|
98
|
+
data-paste_question_surveyform_url="<%= surveyor_gui.paste_question_surveyform_url(
|
|
100
99
|
id: f.object.survey_section.survey.id,
|
|
101
100
|
question_id: f.object.id) %>"
|
|
102
101
|
>Paste Question</button>
|
|
@@ -15,24 +15,23 @@
|
|
|
15
15
|
<% if !@survey_locked && (s.object.modifiable?) %>
|
|
16
16
|
|
|
17
17
|
<button type="button" id="edit_section_title"
|
|
18
|
-
data-replace_survey_section_url="<%=
|
|
19
|
-
action: 'replace_survey_section',
|
|
18
|
+
data-replace_survey_section_url="<%=surveyor_gui.replace_survey_section_surveyform_path(
|
|
20
19
|
survey_section_id: s.object.id,
|
|
21
20
|
id: f.object.id)%>"
|
|
22
|
-
data-edit_survey_section_url="<%=edit_survey_section_url(s.object.id)%>"
|
|
21
|
+
data-edit_survey_section_url="<%=surveyor_gui.edit_survey_section_url(s.object.id)%>"
|
|
23
22
|
data-survey_section_id="<%=s.object.id%>"
|
|
24
23
|
>Edit Section Title</button>
|
|
25
24
|
|
|
26
25
|
<% if session[:cut_section] -%>
|
|
27
26
|
|
|
28
27
|
<button type="button" id="paste_section"
|
|
29
|
-
data-paste_section_surveyform_url="<%= paste_section_surveyform_url(survey_section_id: s.object.id, position: 'over') %>"
|
|
28
|
+
data-paste_section_surveyform_url="<%= surveyor_gui.paste_section_surveyform_url(survey_section_id: s.object.id, position: 'over') %>"
|
|
30
29
|
>Paste Section</button>
|
|
31
30
|
|
|
32
31
|
<% else -%>
|
|
33
32
|
|
|
34
33
|
<button type="button" id="cut_section"
|
|
35
|
-
data-cut_section_surveyform_url="<%=cut_section_surveyform_url(
|
|
34
|
+
data-cut_section_surveyform_url="<%=surveyor_gui.cut_section_surveyform_url(
|
|
36
35
|
id: f.object.id,
|
|
37
36
|
survey_section_id: s.object.id)%>"
|
|
38
37
|
data-survey_section_id="<%=s.object.id%>"
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
|
|
44
43
|
<button type="button" id="delete_section"
|
|
45
44
|
data-survey_section_id="<%=s.object.id%>"
|
|
46
|
-
data-survey_section_url="<%= survey_section_url(s.object.id)%>"
|
|
45
|
+
data-survey_section_url="<%= surveyor_gui.survey_section_url(s.object.id)%>"
|
|
47
46
|
>Delete Section</button>
|
|
48
47
|
|
|
49
48
|
<% end -%>
|
|
@@ -62,14 +61,14 @@
|
|
|
62
61
|
<div class="question_buttons_top">
|
|
63
62
|
|
|
64
63
|
<button type="button" id="add_question" class="cut"
|
|
65
|
-
data-insert_new_question_url="<%=insert_new_question_surveyform_url(f.object.id)%>"
|
|
66
|
-
data-new_question_url="<%=new_question_url%>"
|
|
64
|
+
data-insert_new_question_url="<%=surveyor_gui.insert_new_question_surveyform_url(f.object.id)%>"
|
|
65
|
+
data-new_question_url="<%=surveyor_gui.new_question_url%>"
|
|
67
66
|
>Add Question</button>
|
|
68
67
|
|
|
69
68
|
<% if session[:cut_question] -%>
|
|
70
69
|
|
|
71
70
|
<button type="button" id="paste_question"
|
|
72
|
-
data-paste_question_surveyform_url="<%= paste_question_surveyform_url(
|
|
71
|
+
data-paste_question_surveyform_url="<%= surveyor_gui.paste_question_surveyform_url(
|
|
73
72
|
id: f.object.id,
|
|
74
73
|
survey_section_id: s.object.id) %>"
|
|
75
74
|
>Paste Question</button>
|
|
@@ -92,8 +91,8 @@
|
|
|
92
91
|
<div class="section_button_bar_bottom_inner">
|
|
93
92
|
|
|
94
93
|
<button type="button" id="add_section"
|
|
95
|
-
data-new_survey_section_url="<%=new_survey_section_url%>"
|
|
96
|
-
data-insert_survey_section_url="<%=
|
|
94
|
+
data-new_survey_section_url="<%=surveyor_gui.new_survey_section_url%>"
|
|
95
|
+
data-insert_survey_section_url="<%= surveyor_gui.insert_survey_section_surveyform_path(:action => 'insert_survey_section',:id => f.object.id) %>"
|
|
97
96
|
data-survey_section_id="<%= s.object.id.to_s %>"
|
|
98
97
|
data-survey_id="<%= s.object.survey.id.to_s %>"
|
|
99
98
|
>Add Section</button>
|
|
@@ -101,7 +100,7 @@
|
|
|
101
100
|
<% if session[:cut_section] -%>
|
|
102
101
|
|
|
103
102
|
<button type="button" id="paste_section"
|
|
104
|
-
data-paste_section_surveyform_url="<%= paste_section_surveyform_url(:survey_section_id => s.object.id) %>"
|
|
103
|
+
data-paste_section_surveyform_url="<%= surveyor_gui.paste_section_surveyform_url(:survey_section_id => s.object.id) %>"
|
|
105
104
|
>Paste Section</button>
|
|
106
105
|
|
|
107
106
|
<% end -%>
|