Showing survey for users and handling authorization

This commit is contained in:
Shyukri Shyukriev 2016-06-30 13:04:07 +02:00
parent 9ce4ba6f6b
commit 67bccf0195
6 changed files with 44 additions and 6 deletions

View file

@ -14,11 +14,12 @@
choices )
- if survey_question.mandatory
%span.fa.fa-asterisk.text-danger
%p.pull-right
= link_to edit_admin_conference_survey_survey_question_path(@conference.short_title, @survey, survey_question) do
%span.fa.fa-edit
= 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.fa-times
- if can? :edit, @survey
%p.pull-right
= link_to edit_admin_conference_survey_survey_question_path(@conference.short_title, @survey, survey_question) do
%span.fa.fa-edit
= 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.fa-times
.panel-body
- if survey_question.boolean?
%input{type: 'radio', name: 'radio'}

View file

@ -48,7 +48,7 @@
%ul
- @conference.surveys.for_registration.each do |survey|
%li
= link_to survey.title, "#"
= link_to survey.title, conference_survey_path(@conference.short_title, survey)
- if @registration.events.any?
.row

View file

@ -0,0 +1,18 @@
.row
.col-md-12
.page-header
%h1
Survey #{@survey.title}
- if can? :edit, @survey
= link_to 'Edit Survey', admin_conference_survey_path(@conference.short_title, @survey), class: 'btn btn-primary pull-right'
%p.text-muted
From:
= @survey.start_date
to
= @survey.end_date
.row
.col-md-12
- @survey.survey_questions.each.with_index(1) do |survey_question, index|
.row
.col-md-12
= render partial: 'admin/surveys/survey_question', locals: { survey_question: survey_question, index: index }