Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed error #281

Merged
merged 1 commit into from
Feb 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/assets/javascripts/portal/studies.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $(document).ready ->
FormFxManager.registerListeners($('.user-edit-protocol-view'), Sparc.study.display_dependencies)


if $('#study_viewing_admin').val() == "portal"
if $('#viewing_admin').val() == "portal"

study_type_form = $('.study_type')
study_selected_for_epic_radio = $('input[name=\'study[selected_for_epic]\']')
Expand Down Expand Up @@ -192,7 +192,7 @@ $(document).ready ->
#### When you go from a virgin project (selected_for_epic = nil/ never been a study)
#### to a study, the Epic Box should be editable instead of only displaying the epic box data.

if $('#study_can_edit_admin_study').val() == "can_edit_study"
if $('#can_edit_admin_study').val() == "can_edit_study"
$('#actions input[type="submit"]').on 'click', (e) ->
if $('input[name=\'study[selected_for_epic]\']:checked').val() == 'true'
if certificate_of_confidence_dropdown.val() == ''
Expand Down
1 change: 0 additions & 1 deletion app/controllers/portal/protocols_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def update
else
Hash.new
end

if @protocol.update_attributes(attrs.merge(study_type_question_group_id: StudyTypeQuestionGroup.active.pluck(:id).first))
flash[:notice] = "Study updated"
redirect_to portal_root_path(:default_protocol => @protocol)
Expand Down
6 changes: 3 additions & 3 deletions app/views/portal/protocols/_study_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
.study_type{style: "#{f.object.selected_for_epic ? '' : 'display:none;'}"}
.field.study_type_questions
= f.label :study_type_questions, class: 'question_text'
= f.hidden_field :viewing_admin, value: "admin"
= hidden_field_tag :viewing_admin, "admin"
= f.fields_for :study_type_answers, study.study_type_answers do |answer|
- if answer.object.study_type_question.study_type_question_group.active && study.active? && answer.object.answer != nil
.field{id: "study_type_answer_#{answer.object.study_type_question.friendly_id}", style: ( answer.object.study_type_question.friendly_id == 'certificate_of_conf' || answer.object.answer != nil ? nil : "display:none;")}
Expand All @@ -137,8 +137,8 @@
.space_bar
= f.label :study_type_questions
- if admin
= f.hidden_field :can_edit_admin_study, value: "can_edit_study"
= f.hidden_field :viewing_admin, value: "portal"
= hidden_field_tag :can_edit_admin_study, "can_edit_study"
= hidden_field_tag :viewing_admin, "portal"
= f.fields_for :study_type_answers, study.study_type_answers do |answer|
- if answer.object.study_type_question.study_type_question_group.active
.field{id: "study_type_answer_#{answer.object.study_type_question.friendly_id}", style: "#{answer.object.answer != nil ? 'display:block' : 'display:none;'}"}
Expand Down