end of day commit

This commit is contained in:
2012-08-28 20:08:13 +02:00
parent 0b16614d41
commit 89700f36e9
43 changed files with 896 additions and 26 deletions
+5
View File
@@ -0,0 +1,5 @@
.phone-wrapper
iframe.phone-content-frame src=user_root_path
.tablet-wrapper
iframe.tablet-content-frame src=supplier_root_path
+2 -5
View File
@@ -1,5 +1,2 @@
.phone-wrapper
iframe.phone-content-frame src=user_root_path
.tablet-wrapper
iframe.tablet-content-frame src=supplier_root_path
.page-header
h1 Home
+4
View File
@@ -32,6 +32,8 @@ html lang="en"
ul.nav#top-navigation-list
li= link_to t('supplier.menu.active_orders', orders: Order.model_name.human_plural), supplier_active_orders_path
li= link_to t('supplier.menu.active_lists', lists: List.model_name.human_plural), supplier_active_lists_path
li= link_to Section.model_name.human_plural, suppliers_sections_path
li= link_to Table.model_name.human_plural, suppliers_tables_path
.container.nav-collapse
.container
@@ -48,6 +50,8 @@ html lang="en"
.row
.span12
= content_for?(:content) ? yield(:content) : yield
- if content_for?(:row)
.row= yield :row
/!
Javascripts
\==================================================
+18
View File
@@ -0,0 +1,18 @@
= form_for @section, html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @section
.control-group class=(@section.errors[:title].any? ? 'error' : nil)
= f.label :title, class: 'control-label'
.controls
= f.text_field :title, class: 'text_field'
.control-group class=(@section.errors[:path].any? ? 'error' : nil)
= f.label :path, class: 'control-label'
.controls
= f.text_field :path, class: 'text_field'
.control-group class=(@section.errors[:supplier_id].any? ? 'error' : nil)
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
.controls
= f.collection_select :supplier_id, @suppliers, :id, :name, include_blank: nil
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), sections_path, class: 'btn'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Section
.page-header
= title :edit, model_class
= render 'form'
+26
View File
@@ -0,0 +1,26 @@
- model_class = Section
.page-header= title :index, model_class
- if @sections.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:title)
th= model_class.human_attribute_name(:path)
th= Supplier.model_name.human
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @sections.each do |section|
tr
td= link_to section.title, section
td= section.path
td= link_to_if section.supplier.present?, section.supplier.try(:name), section.supplier
td=l section.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, section], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), section, 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_section_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Section
.page-header
= title :new, model_class
= render 'form'
+18
View File
@@ -0,0 +1,18 @@
- model_class = Section
.page-header= title :show, @section
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:title)
dd= @section.title
dt= model_class.human_attribute_name(:path)
dd= @section.path
- if @section.supplier.present?
dt= Supplier.model_name.human
dd= link_to @section.supplier.name, @section.supplier
.form-actions
= link_to t("helpers.links.back"), sections_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @section], class: 'btn'
'
= link_to t("helpers.links.destroy"), @section, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
@@ -0,0 +1,18 @@
= form_for [:suppliers, @section], html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @section
.control-group class=(@section.errors[:title].any? ? 'error' : nil)
= f.label :title, class: 'control-label'
.controls
= f.text_field :title, class: 'text_field'
.control-group class=(@section.errors[:width].any? ? 'error' : nil)
= f.label :width, class: 'control-label'
.controls
= f.text_field :width, class: ['text_field', :numeric]
.control-group class=(@section.errors[:height].any? ? 'error' : nil)
= f.label :height, class: 'control-label'
.controls
= f.text_field :height, class: ['text_field', :numeric]
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), suppliers_sections_path, class: 'btn'
@@ -0,0 +1,4 @@
- model_class = Section
.page-header
= title :edit, model_class
= render 'form'
@@ -0,0 +1,25 @@
- model_class = Section
.page-header= title :index, model_class
- if @sections.any?
table.table.table-striped
thead
tr
th.link= model_class.human_attribute_name(:title)
th.numeric= model_class.human_attribute_name(:width)
th.numeric= model_class.human_attribute_name(:height)
th.timestamp= model_class.human_attribute_name(:created_at)
th.actions=t 'helpers.actions'
tbody
- @sections.each do |section|
tr
td.link= link_to section.title, [:suppliers, section]
td.numeric= section.width
td.numeric= section.height
td.timestamp=l section.created_at, format: :short
td.actions
= link_to t('helpers.links.edit'), [:edit, :suppliers, section], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), [:suppliers, section], 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_section_path, class: 'btn btn-primary'
@@ -0,0 +1,4 @@
- model_class = Section
.page-header
= title :new, model_class
= render 'form'
@@ -0,0 +1,41 @@
- model_class = Section
.page-header= title :show, @section
.form-actions
= link_to t("helpers.links.back"), suppliers_sections_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, :suppliers, @section], class: 'btn'
'
= link_to t("helpers.links.destroy"), [:suppliers, @section], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
- content_for :row do
ul.nav.nav-pills
- for section in @section.supplier.sections
li class=(section == @section ? 'active' : nil) = link_to section.title, [:suppliers, section]
.span9
.well.section-tables-container.section-tables-active
- 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'
.span3
h3= t('table.has_no_section')
.well.section-tables-container.section-tables-inactive
- for table in @section.supplier.non_placed_tables
.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'
.clearfix
- content_for :footer do
javascript:
var current_section_id = '#{@section.id}';
var current_section_width = #{@section.width};
var current_section_height = #{@section.height};
$(function(){
var active_section_container = $('.section-tables-active')
active_section_container.css('width', active_section_container.width()); // break fluid layout
active_section_container.css('height', #{@section.height/@section.width}*active_section_container.width());
active_section_container.find('.section-table').each(function(){
Qsupplier.position_table_in_active_section(active_section_container, $(this));
});
});
@@ -0,0 +1,14 @@
= form_for [:suppliers, @table], html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @table
.control-group class=(@table.errors[:number].any? ? 'error' : nil)
= f.label :number, class: 'control-label'
.controls
= f.text_field :number, class: 'text_field'
.control-group class=(@table.errors[:section_id].any? ? 'error' : nil)
= f.label :section_id, Supplier.model_name.human, class: 'control-label'
.controls
= f.collection_select :section_id, current_supplier.sections, :id, :title, include_blank: "[#{t('table.has_no_section')}]"
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), tables_path, class: 'btn'
@@ -0,0 +1,4 @@
- model_class = Table
.page-header
= title :edit, model_class
= render 'form'
@@ -0,0 +1,24 @@
- model_class = Table
div.page-header= title :index, model_class
- if @tables.any?
table.table.table-striped
thead
tr
th.link= model_class.human_attribute_name(:number)
th.link= Section.model_name.human
th.timestamp= model_class.human_attribute_name(:created_at)
th.actions=t 'helpers.actions'
tbody
- @tables.each do |table|
tr
td.link= link_to table.number, [:suppliers, table]
td.link= link_to_if table.section.present?, table.section.try(:title), [:suppliers, table.section]
td.timestamp=l table.created_at, format: :short
td.actions
= link_to t('helpers.links.edit'), [:edit, :suppliers, table], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), [:suppliers, table], 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_table_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Table
.page-header
= title :new, model_class
= render 'form'
+16
View File
@@ -0,0 +1,16 @@
- model_class = Table
.page-header= title :show, @table
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:number)
dd= @table.number
- if @table.section.present?
dt= Section.model_name.human
dd= link_to @table.section.title, [:suppliers, @table.section]
.form-actions
= link_to t("helpers.links.back"), suppliers_tables_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, :suppliers, @table], class: 'btn'
'
= link_to t("helpers.links.destroy"), [:suppliers, @table], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
+1 -1
View File
@@ -1,5 +1,5 @@
- model_class = User
div.page-header= title :index, model_class
.page-header= title :index, model_class
- if @users.any?
table.table.table-striped
thead