osem-fcy/app/views/admin/questions/_questions.html.haml
Henne Vogelsang 28063129c7 Implement consistent admin interface
* Consistent route/model/controller/view layout
* Get rid of unused photos, speakers, dietchoices, social_events controllers
* Drop unused :public from Rooms and :description from CallForPapers
2014-11-25 10:47:18 +01:00

26 lines
933 B
Text

%table.table.table-hover#questions
%th Enabled
%th Question
%th Type
%th Answers
%th Actions
- @questions.each do |q|
%tr
%td
= hidden_field_tag "conference[question_ids][]", nil
= check_box_tag "conference[question_ids][]", q.id,
@conference.question_ids.include?(q.id), id: dom_id(q)
%td
= q.title
%td
= q.question_type.title
%td
= q.answers.map {|a| a.title}.join(', ')
%td
.btn-group
= link_to 'Edit', edit_admin_conference_question_path(@conference.short_title, q),
class: 'btn btn-primary', disabled: !(can? :update, q)
= link_to 'Delete', admin_conference_question_path(@conference.short_title, q),
method: :delete, remote: true, class: 'btn btn-danger',
confirm: "Delete question '#{q.title}'?", disabled: !(can? :destroy, q)