Skip to content

Commit

Permalink
Merge pull request #1534 from sparc-request/kg-question_disabled_visu…
Browse files Browse the repository at this point in the history
…al_bug

KG - Question Answered Warning Alignment
  • Loading branch information
Stuart-Johnson committed Sep 5, 2018
2 parents 39b7479 + 4073a97 commit c9eb171
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Expand Up @@ -17,7 +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.
%select.selectpicker.select-depender{ id: "question-#{question.id}-depender_id" }
%select.selectpicker.select-depender{ id: "question-#{question.id}-depender_id", disabled: question.survey.has_responses? }
%option{ value: "" }
= t(:constants)[:prompts][:none]
- question.previous_questions.each do |q|
Expand Down
21 changes: 11 additions & 10 deletions app/views/surveyor/surveys/form/_survey_question.html.haml
Expand Up @@ -36,19 +36,20 @@
.col-sm-1
= check_box_tag "question-#{question.id}-required", question.required, question.required, disabled: question.survey.has_responses?
= label_tag "question-#{question.id}-is_dependent", t(:surveyor)[:surveys][:form][:content][:question][:dependent][:label], class: 'col-sm-2 control-label no-padding-x text-right'
.col-sm-3
= check_box_tag "question-#{question.id}-is_dependent", question.is_dependent, question.is_dependent, class: 'is-dependent', disabled: question.previous_questions.empty?
.dependent-dropdown-container{ class: question.is_dependent ? '' : 'hidden' }
= label_tag "question-#{question.id}-depender_id", t(:surveyor)[:surveys][:form][:content][:question][:dependent][:dropdown][:label], class: 'col-sm-2 control-label no-padding-x'
.col-sm-4.no-padding
.col-sm-4
= render 'surveyor/surveys/form/dependent_dropdown', survey: survey, question: question
.col-sm-3{ style: 'color:red;' }
- if question.question_responses.any?
= t(:surveyor)[:surveys][:form][:content][:question][:warning]
.col-sm-1
= check_box_tag "question-#{question.id}-is_dependent", question.is_dependent, question.is_dependent, class: 'is-dependent', disabled: question.previous_questions.empty? || question.survey.has_responses?
.dependent-dropdown-container.col-sm-6{ class: question.is_dependent ? '' : 'hidden' }
= label_tag "question-#{question.id}-depender_id", t(:surveyor)[:surveys][:form][:content][:question][:dependent][:dropdown][:label], class: 'col-sm-4 control-label no-padding-x'
.col-sm-8
= render 'surveyor/surveys/form/dependent_dropdown', survey: survey, question: question
.col-sm-1.no-padding.pull-right
%button.btn.btn-sm.btn-danger.pull-right.delete-question{ title: t(:surveyor)[:surveys][:form][:content][:question][:delete], data: { toggle: 'tooltip', animation: 'false' } }
%span.glyphicon.glyphicon-trash
- if question.question_responses.any?
.form-group
.col-sm-12.no-padding
%span.text-danger
= t(:surveyor)[:surveys][:form][:content][:question][:warning]

.question-options{ data: { question_id: question.id } }
= render "surveyor/surveys/form/form_partials/#{question.question_type}_example", question: question

0 comments on commit c9eb171

Please sign in to comment.