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

KG - Question Answered Warning Alignment #1534

Merged
merged 1 commit into from Sep 5, 2018
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
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