initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
= form_for @list, html: {class: 'form-horizontal' } do |f|
|
||||
= render 'error_messages', target: @list
|
||||
.control-group class=(@list.errors[:state].any? ? 'error' : nil)
|
||||
= f.label :state, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :state, class: 'text_field'
|
||||
.control-group class=(@list.errors[:closed_at].any? ? 'error' : nil)
|
||||
= f.label :closed_at, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :closed_at, class: 'text_field'
|
||||
.control-group class=(@list.errors[:table_id].any? ? 'error' : nil)
|
||||
= f.label :table_id, Table.model_name.human, class: 'control-label'
|
||||
.controls
|
||||
= f.select :table_id, options_for_select(@tables.map{|a| [a.number, a.id]}), include_blank: nil
|
||||
.form-actions
|
||||
= f.submit nil, class: 'btn btn-primary'
|
||||
'
|
||||
= link_to t("helpers.links.cancel"), lists_path, class: 'btn'
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = List
|
||||
.page-header
|
||||
= title :edit, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,26 @@
|
||||
- model_class = List
|
||||
div.page-header= title :index, model_class
|
||||
- if @lists.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th= model_class.human_attribute_name(:state)
|
||||
th= model_class.human_attribute_name(:closed_at)
|
||||
th= Table.model_name.human
|
||||
th= model_class.human_attribute_name(:created_at)
|
||||
th=t 'helpers.actions'
|
||||
tbody
|
||||
- @lists.each do |list|
|
||||
tr
|
||||
td= link_to list.state, list
|
||||
td= list.closed_at
|
||||
td= link_to list.table.number, list.table
|
||||
td=l list.created_at, format: :short
|
||||
td
|
||||
= link_to t('helpers.links.edit'), [:edit, list], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), list, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
||||
- else
|
||||
= no_content_given model_class
|
||||
= link_to t("helpers.links.new"), new_list_path, class: 'btn btn-primary'
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = List
|
||||
.page-header
|
||||
= title :new, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,18 @@
|
||||
- model_class = List
|
||||
.page-header= title :show, @list
|
||||
|
||||
dl.dl-horizontal.show-list
|
||||
dt= model_class.human_attribute_name(:state)
|
||||
dd= @list.state
|
||||
dt= model_class.human_attribute_name(:closed_at)
|
||||
dd= @list.closed_at
|
||||
- if @list.table.present?
|
||||
dt= Table.model_name.human
|
||||
dd= link_to @list.table.number, @list.table
|
||||
|
||||
.form-actions
|
||||
= link_to t("helpers.links.back"), lists_path, class: 'btn'
|
||||
'
|
||||
= link_to t('helpers.links.edit'), [:edit, @list], class: 'btn'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), @list, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
|
||||
Reference in New Issue
Block a user