layout changes and section handling
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
- model_class = Section
|
||||
.page-header= title t('section.manage_tables.title', section: Section.model_name.human.downcase, title: @section.title)
|
||||
- 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 :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
|
||||
- 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 :i, [:suppliers, table], class: 'btn btn-mini table-link'
|
||||
.table-number = 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), true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user