Adding surveys
This commit is contained in:
parent
69a0d12793
commit
335608e6c4
28 changed files with 434 additions and 21 deletions
14
app/views/admin/surveys/_form.html.haml
Normal file
14
app/views/admin/surveys/_form.html.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1 New Survey
|
||||
|
||||
.col-md-6
|
||||
= semantic_form_for @survey, url: @url do |f|
|
||||
= f.hidden_field :surveyable_type
|
||||
= f.hidden_field :surveyable_id
|
||||
= f.input :title
|
||||
= f.input :description, input_html: { rows: 3 }
|
||||
= f.input :start_date, as: :string, input_html: { class: 'datetimepicker' }
|
||||
= f.input :end_date, as: :string, input_html: { class: 'datetimepicker' }
|
||||
= f.submit 'Save', class: 'btn btn-primary'
|
||||
1
app/views/admin/surveys/edit.html.haml
Normal file
1
app/views/admin/surveys/edit.html.haml
Normal file
|
|
@ -0,0 +1 @@
|
|||
= render partial: 'form'
|
||||
34
app/views/admin/surveys/index.html.haml
Normal file
34
app/views/admin/surveys/index.html.haml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Surveys
|
||||
= link_to 'New', new_admin_conference_survey_path(@conference.short_title, survey: { surveyable_type: 'Conference', surveyable_id: @conference.id }), class: 'btn btn-success pull-right'
|
||||
%p.text-muted
|
||||
Available surveys for this conference
|
||||
|
||||
|
||||
- if @surveys.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover#surveys
|
||||
%thead
|
||||
%th Title
|
||||
%th Start Date
|
||||
%th End Date
|
||||
%th Actions
|
||||
%tbody
|
||||
- @surveys.each_with_index do |survey, index|
|
||||
%tr
|
||||
%td
|
||||
= survey.title
|
||||
%td
|
||||
= survey.start_date
|
||||
%td
|
||||
= survey.end_date
|
||||
%td
|
||||
= link_to 'Edit', edit_admin_conference_survey_path(@conference.short_title, survey.id),
|
||||
method: :get, class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_conference_survey_path(@conference.short_title, survey.id),
|
||||
method: :delete, class: 'btn btn-danger',
|
||||
data: { confirm: "Do you really want to delete #{survey.title}?"}
|
||||
14
app/views/admin/surveys/new.html.haml
Normal file
14
app/views/admin/surveys/new.html.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1 New Survey
|
||||
|
||||
.col-md-6
|
||||
= semantic_form_for @survey, url: @url do |f|
|
||||
= f.hidden_field :surveyable_type
|
||||
= f.hidden_field :surveyable_id
|
||||
= f.input :title
|
||||
= f.input :description, input_html: { rows: 3 }
|
||||
= f.input :start_date, as: :string, input_html: { class: 'datetimepicker' }
|
||||
= f.input :end_date, as: :string, input_html: { class: 'datetimepicker' }
|
||||
= f.submit 'Save', class: 'btn btn-primary'
|
||||
6
app/views/admin/surveys/show.html.haml
Normal file
6
app/views/admin/surveys/show.html.haml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
%p#notice= notice
|
||||
|
||||
|
||||
= link_to 'Edit', edit_admin_survey_path(@admin_survey)
|
||||
\|
|
||||
= link_to 'Back', admin_surveys_path
|
||||
Loading…
Add table
Add a link
Reference in a new issue