end of day commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
= form_for [:suppliers, @product_category], html: {class: 'form-horizontal' } do |f|
|
||||
= render 'error_messages', target: @product_category
|
||||
.control-group class=(@product_category.errors[:name].any? ? 'error' : nil)
|
||||
= f.label :name, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :name, class: 'text_field'
|
||||
.control-group class=(@product_category.errors[:position].any? ? 'error' : nil)
|
||||
= f.label :position, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :position, class: 'text_field'
|
||||
.form-actions
|
||||
= f.submit nil, class: 'btn btn-primary'
|
||||
'
|
||||
= link_to t("helpers.links.cancel"), suppliers_product_categories_path, class: 'btn'
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = ProductCategory
|
||||
.page-header
|
||||
= title :edit, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,24 @@
|
||||
- model_class = ProductCategory
|
||||
.page-header= title :index, model_class
|
||||
- if @product_categories.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th= model_class.human_attribute_name(:name)
|
||||
th= model_class.human_attribute_name(:position)
|
||||
th.timestamp= model_class.human_attribute_name(:created_at)
|
||||
th.actions=t 'helpers.actions'
|
||||
tbody
|
||||
- @product_categories.each do |product_category|
|
||||
tr
|
||||
td.link= link_to product_category.name, [:suppliers, product_category]
|
||||
td= product_category.position
|
||||
td.timestamp=l product_category.created_at, format: :short
|
||||
td.actions
|
||||
= link_to t('helpers.links.edit'), [:edit, :suppliers, product_category], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), [:suppliers, product_category], 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_suppliers_product_category_path, class: 'btn btn-primary'
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = ProductCategory
|
||||
.page-header
|
||||
= title :new, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,18 @@
|
||||
- model_class = ProductCategory
|
||||
.page-header= title :show, @product_category
|
||||
|
||||
dl.dl-horizontal.show-list
|
||||
dt= model_class.human_attribute_name(:name)
|
||||
dd= @product_category.name
|
||||
dt= model_class.human_attribute_name(:position)
|
||||
dd= @product_category.position
|
||||
|
||||
.form-actions
|
||||
= link_to t("helpers.links.back"), suppliers_product_categories_path, class: 'btn'
|
||||
'
|
||||
= link_to t('helpers.links.edit'), [:edit, :suppliers, @product_category], class: 'btn'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), [:suppliers, @product_category], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
|
||||
- content_for :row do
|
||||
- @products = @product_category.products
|
||||
= render template: 'suppliers/products/index'
|
||||
@@ -0,0 +1,22 @@
|
||||
= form_for [:suppliers, @product], html: {class: 'form-horizontal' } do |f|
|
||||
= render 'error_messages', target: @product
|
||||
.control-group class=(@product.errors[:name].any? ? 'error' : nil)
|
||||
= f.label :name, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :name, class: 'text_field'
|
||||
.control-group class=(@product.errors[:code].any? ? 'error' : nil)
|
||||
= f.label :code, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :code, class: 'text_field'
|
||||
.control-group class=(@product.errors[:price].any? ? 'error' : nil)
|
||||
= f.label :price, class: 'control-label'
|
||||
.controls
|
||||
= f.text_field :price, class: ['text_field', :currency]
|
||||
.control-group class=(@product.errors[:product_category_id].any? ? 'error' : nil)
|
||||
= f.label :product_category_id, ProductCategory.model_name.human, class: 'control-label'
|
||||
.controls
|
||||
= f.collection_select :product_category_id, current_supplier.product_categories, :id, :name, include_blank: ''
|
||||
.form-actions
|
||||
= f.submit nil, class: 'btn btn-primary'
|
||||
'
|
||||
= link_to t("helpers.links.cancel"), suppliers_products_path, class: 'btn'
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = Product
|
||||
.page-header
|
||||
= title :edit, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,28 @@
|
||||
- model_class = Product
|
||||
.page-header= title :index, model_class
|
||||
- if @products.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th= model_class.human_attribute_name(:name)
|
||||
th= model_class.human_attribute_name(:code)
|
||||
th.currency= model_class.human_attribute_name(:price)
|
||||
th= ProductCategory.model_name.human
|
||||
th.timestamp= model_class.human_attribute_name(:created_at)
|
||||
th.actions=t 'helpers.actions'
|
||||
tbody
|
||||
- @products.each do |product|
|
||||
tr
|
||||
td.link= link_to product.name, product
|
||||
td= product.code
|
||||
td.currency=currency product.price
|
||||
td.link= link_to_if product.product_category.present?, product.product_category.try(:name), [:suppliers, product.product_category]
|
||||
td.timestamp=l product.created_at, format: :short
|
||||
td.actions
|
||||
= link_to t('helpers.links.edit'), [:edit, :suppliers, product], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), [:suppliers, product], 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_suppliers_product_path(product_category_id: @product_category.try(:id)), class: 'btn btn-primary'
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = Product
|
||||
.page-header
|
||||
= title :new, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,20 @@
|
||||
- model_class = Product
|
||||
.page-header= title :show, @product
|
||||
|
||||
dl.dl-horizontal.show-list
|
||||
dt= model_class.human_attribute_name(:name)
|
||||
dd= @product.name
|
||||
dt= model_class.human_attribute_name(:code)
|
||||
dd= @product.code
|
||||
dt= model_class.human_attribute_name(:price)
|
||||
dd= @product.price
|
||||
- if @product.product_category.present?
|
||||
dt= ProductCategory.model_name.human
|
||||
dd= link_to @product.product_category.name, @product.product_category
|
||||
|
||||
.form-actions
|
||||
= link_to t("helpers.links.back"), suppliers_products_path, class: 'btn'
|
||||
'
|
||||
= link_to t('helpers.links.edit'), [:edit, :suppliers, @product], class: 'btn'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), [:suppliers, @product], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
|
||||
@@ -16,7 +16,8 @@
|
||||
- for table in @section.tables
|
||||
.section-table.hide{ id="section-table-#{table.id}" data-position-x=table.position_x data-position-y=table.position_y data-table-id=table.id}
|
||||
.pull-right.action-button-container
|
||||
= link_to table.number, [:suppliers, table], class: 'btn btn-mini table-number'
|
||||
= link_to :i, [:suppliers, table], class: 'btn btn-mini table-link'
|
||||
.table-number = table.number
|
||||
.span3
|
||||
h3= t('table.has_no_section')
|
||||
.well.section-tables-container.section-tables-inactive
|
||||
@@ -24,7 +25,8 @@
|
||||
.section-table{ id="section-table-#{table.id}" data-position-x=table.position_x data-position-y=table.position_y data-table-id=table.id}
|
||||
.pull-right.action-button-container
|
||||
button.btn.btn-primary.btn-mini onClick="Qsupplier.move_table_to_active_section('#{table.id}')" +
|
||||
= link_to table.number, [:suppliers, table], class: 'btn btn-mini table-number'
|
||||
= link_to :i, [:suppliers, table], class: 'btn btn-mini table-link'
|
||||
.table-number = table.number
|
||||
.clearfix
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
|
||||
Reference in New Issue
Block a user