openSUSE/osem

View on GitHub
app/views/admin/surveys/_survey_question_title.html.haml

Summary

Maintainability
Test Coverage
%span.badge
  = question_index
= survey_question.title

- if survey_question.multiple_choice?
  ( Select
  - if survey_question.min_choices != survey_question.max_choices
    a minimum of
  = survey_question.min_choices
  - if survey_question.min_choices != survey_question.max_choices
    and a maximum of
    = survey_question.max_choices
  choices )
- if survey_question.mandatory
  %span.fa-solid.fa-asterisk.text-danger
- if can? :edit, @survey
  %p.pull-right
    = "(#{survey_question.survey_replies.count} replies)"
    = link_to edit_admin_conference_survey_survey_question_path(@conference.short_title, @survey, survey_question) do
      %span.fa-solid.fa-pen-to-square
    = link_to admin_conference_survey_survey_question_path(@conference.short_title, @survey, survey_question), method: :delete, data: { confirm: 'Are you sure you want to delete this question?' } do
      %span.fa-solid.fa-xmark