Add track type to admin dashboard

This commit is contained in:
Rishabh Singh 2019-06-22 19:23:40 +05:30
parent 770a63e15c
commit abc59bb3d7
18 changed files with 252 additions and 2 deletions

View 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' }

View file

@ -0,0 +1 @@
= render 'form', track_type: @track_type, conference: @conference

View 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'

View file

@ -0,0 +1 @@
= render 'form', track_type: @track_type, conference: @conference

View file

@ -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)