osem-fcy/app/views/admin/questions/_questions.html.haml

28 lines
1 KiB
Text
Raw Normal View History

%table.table.table-hover#questions
%th Enabled
%th Question
%th Type
%th Answers
%th Actions
2014-02-09 18:05:57 +02:00
- @questions.each do |q|
%tr
%td
= hidden_field_tag "conference[question_ids][]", nil
2014-07-14 21:13:32 +03:00
= check_box_tag "conference[question_ids][]", q.id,
@conference.question_ids.include?(q.id), id: dom_id(q)
2014-02-09 18:05:57 +02:00
%td
= q.title
%td
= q.question_type.title
%td
= q.answers.map {|a| a.title}.join(', ')
2014-02-09 18:05:57 +02:00
%td
.btn-group
2015-04-22 18:55:51 +03:00
= link_to 'Show', admin_conference_question_path(@conference.short_title, q), class: 'btn btn-success'
= link_to 'Edit', edit_admin_conference_question_path(@conference.short_title, q),
2014-08-12 16:33:01 +03:00
class: 'btn btn-primary', disabled: !(can? :update, q)
= link_to 'Delete', admin_conference_question_path(@conference.short_title, q),
2014-08-12 16:33:01 +03:00
method: :delete, remote: true, class: 'btn btn-danger',
confirm: "Delete question '#{q.title}'?", disabled: !(can? :destroy, q)