Add track type to admin dashboard
This commit is contained in:
parent
770a63e15c
commit
abc59bb3d7
18 changed files with 252 additions and 2 deletions
17
app/views/admin/track_types/_form.html.haml
Normal file
17
app/views/admin/track_types/_form.html.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
- if track_type.new_record?
|
||||
New
|
||||
Track Type
|
||||
= track_type.title
|
||||
.row
|
||||
.col-md-12
|
||||
= semantic_form_for(track_type,
|
||||
url: (track_type.new_record? ? admin_conference_program_track_types_path : admin_conference_program_track_type_path(conference,
|
||||
track_type))) do |f|
|
||||
= f.input :title, input_html: { autofocus: true }
|
||||
= f.input :description
|
||||
%p.text-right
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||
1
app/views/admin/track_types/edit.html.haml
Normal file
1
app/views/admin/track_types/edit.html.haml
Normal file
|
|
@ -0,0 +1 @@
|
|||
= render 'form', track_type: @track_type, conference: @conference
|
||||
29
app/views/admin/track_types/index.html.haml
Normal file
29
app/views/admin/track_types/index.html.haml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1 Track Types
|
||||
%p.text-muted
|
||||
The different types of tracks in your conference
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover#track-types
|
||||
%thead
|
||||
%th Title
|
||||
%th Description
|
||||
%th Actions
|
||||
%tbody
|
||||
- @conference.program.track_types.each do |track_type|
|
||||
%tr
|
||||
%td
|
||||
= track_type.title
|
||||
%td
|
||||
= track_type.description
|
||||
%td
|
||||
.btn-group{ role: 'group' }
|
||||
= link_to 'Edit', edit_admin_conference_program_track_type_path(@conference.short_title, track_type.id),
|
||||
method: :get, class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_conference_program_track_type_path(@conference.short_title, track_type.id),
|
||||
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete #{track_type.title}?" }
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= link_to 'Add Track Type', new_admin_conference_program_track_type_path(@conference.short_title), class: 'btn btn-primary'
|
||||
1
app/views/admin/track_types/new.html.haml
Normal file
1
app/views/admin/track_types/new.html.haml
Normal file
|
|
@ -0,0 +1 @@
|
|||
= render 'form', track_type: @track_type, conference: @conference
|
||||
|
|
@ -78,6 +78,9 @@
|
|||
- if can? :update, @conference.program.event_types.build
|
||||
%li{class: active_nav_li(admin_conference_program_event_types_path(@conference.short_title))}
|
||||
= link_to 'Event Types', admin_conference_program_event_types_path(@conference.short_title)
|
||||
- if can? :update, @conference.program.track_types.build
|
||||
%li{class: active_nav_li(admin_conference_program_track_types_path(@conference))}
|
||||
= link_to 'Track Types', admin_conference_program_track_types_path(@conference.short_title)
|
||||
- if can? :update, @conference.program.difficulty_levels.build, conference_id: @conference.id
|
||||
%li{class: active_nav_li(admin_conference_program_difficulty_levels_path(@conference.short_title))}
|
||||
= link_to 'Difficulty Levels', admin_conference_program_difficulty_levels_path(@conference.short_title)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue