-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show survey answers and allow to print them
- Loading branch information
1 parent
c8fc72c
commit 49ee75a
Showing
8 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<% if current_user.can_view_survey_answers?(order) %> | ||
<% if order.survey_answers.present? %> | ||
<% if local_assigns[:print] != false %> | ||
<%= link_to "Print Survey Answers", survey_answers_order_path(order), class: "btn btn-default" %> | ||
<% end %> | ||
<% order.survey_answers.each do |answer| %> | ||
<h3><%= answer.survey_revision.survey.title %></h3> | ||
<%= render partial: "surveys/survey_answers", locals: { survey: answer.survey_revision.survey, revision: answer.survey_revision, answers: answer.answers } %> | ||
<% end %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% content_for :title, "Print Survey Answers for Order ##{@order.id}" %> | ||
<% content_for :content do %> | ||
<div class="hidden-print"> | ||
<%= link_to "Return to Order", edit_order_path(@order), class: "btn btn-primary" %> | ||
</div> | ||
|
||
<h2 class="visible-print-block">Survey answers for Order #<%= @order.id %></h2> | ||
<%= render partial: "order_survey_answers", locals: { order: @order, print: false } %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ | |
|
||
member do | ||
post :sync | ||
get :survey_answers | ||
end | ||
end | ||
|
||
|