ability to track resources used in conference
This commit is contained in:
parent
945b4aac60
commit
3065766da9
17 changed files with 281 additions and 2 deletions
38
app/views/admin/resources/index.html.haml
Normal file
38
app/views/admin/resources/index.html.haml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1 Resources
|
||||
%p.text-muted
|
||||
Manage resources in conference
|
||||
- if @conference.resources.any?
|
||||
.row
|
||||
.col-md-12
|
||||
%table.table.table-hover.datatable
|
||||
%thead
|
||||
%th Name
|
||||
%th Left( Left/Total )
|
||||
%th Used
|
||||
%th Actions
|
||||
%tbody
|
||||
- @conference.resources.each do |resource|
|
||||
%tr
|
||||
=semantic_form_for(resource, url: admin_conference_resource_path(@conference.short_title, resource.id), html: { method: :put }) do |f|
|
||||
%td
|
||||
= link_to(admin_conference_resource_path(@conference.short_title, resource.id)) do
|
||||
= resource.name
|
||||
%td
|
||||
= quantity_left_of(resource)
|
||||
%td.col-sm-1.col-md-1
|
||||
= f.input :used, label: false
|
||||
%td
|
||||
.btn-group
|
||||
= f.action :submit, as: :button, label: 'Save', button_html: { class: 'btn btn-success' }
|
||||
= link_to 'Edit', edit_admin_conference_resource_path(@conference.short_title, resource.id),
|
||||
method: :get, class: 'btn btn-primary', disabled: !(can? :update, resource)
|
||||
= link_to 'Delete', admin_conference_resource_path(@conference.short_title, resource.id),
|
||||
method: :delete, class: 'btn btn-danger', disabled: !(can? :destroy, resource),
|
||||
data: { confirm: "Do you really want to delete #{resource.name}?" }
|
||||
.row
|
||||
.col-md-12
|
||||
= link_to 'Add Resource', new_admin_conference_resource_path, class: 'btn btn-success pull-right', disabled: !(can? :create, Resource.new(conference_id: @conference_id))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue