Skip to content

Commit

Permalink
Merge pull request sparc-request#255 from bmic-development/kg-catalog…
Browse files Browse the repository at this point in the history
…_manager_survey_url_bug

KG - Associated Survey URL Bug
  • Loading branch information
Stuart-Johnson committed May 8, 2017
2 parents f0d50de + a6ba4cb commit 05f9c1c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/controllers/surveyor/surveys_controller.rb
Expand Up @@ -66,6 +66,7 @@ def preview
@response.question_responses.build

respond_to do |format|
format.html
format.js
end
end
Expand Down
Expand Up @@ -29,11 +29,7 @@
- entity.associated_surveys.each do |associated_survey|
%tr
%td
= "#{associated_survey.survey.title} - Version #{associated_survey.survey.version}"
%br
- survey_link = new_surveyor_response_path(access_code: associated_survey.survey.access_code, survey_version: associated_survey.survey.version, format: :html)
%a.associated_survey_link{href: survey_link, target: 'blank'}
= survey_link
= link_to "#{associated_survey.survey.title} - Version #{associated_survey.survey.version}", surveyor_survey_preview_path(associated_survey.survey, format: :html), target: 'blank', class: 'associated_survey_link'
%td= image_tag 'cancel.png', :"data-associated_survey_id" => associated_survey.id, :class => 'associated_survey_delete'

%table
Expand Down
4 changes: 1 addition & 3 deletions app/views/surveyor/responses/new.html.haml
Expand Up @@ -17,8 +17,7 @@
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
-# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.col-sm-2
.col-sm-8
.col-sm-8.col-sm-offset-2
.panel.panel-default#survey-panel
.panel-heading.text-center
%h4.panel-title
Expand All @@ -29,4 +28,3 @@
.panel-footer
.clearfix
= f.submit t(:actions)[:submit], class: 'btn btn-primary pull-right'
.col-sm-2
31 changes: 31 additions & 0 deletions app/views/surveyor/surveys/preview.html.haml
@@ -0,0 +1,31 @@
-# Copyright © 2011-2016 MUSC Foundation for Research Development
-# All rights reserved.
-# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the distribution.
-# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
-# derived from this software without specific prior written permission.
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
-# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.col-sm-8.col-sm-offset-2
.panel.panel-default#survey-panel
= form_for @response, url: surveyor_responses_path(@response), remote: true do |f|
.panel-heading.text-center
%h4.panel-title
= @survey.title
.panel-body
= render 'surveyor/responses/form/response_content', f: f, survey: @survey, sub_service_request: nil
.panel-footer
.clearfix
%button.btn.btn-primary.pull-right.disabled
= t(:actions)[:submit]

0 comments on commit 05f9c1c

Please sign in to comment.