Better supplier section view
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
view Qsupplier.App.SectionTabHeaderView context=section
|
view Qsupplier.App.SectionTabHeaderView context=section
|
||||||
.section-manage-tables.pull-right
|
.section-manage-tables.pull-right
|
||||||
if editmode
|
if editmode
|
||||||
.btn-group
|
/.btn-group
|
||||||
/a.btn.dropdown-toggle data-toggle="dropdown" href="#section-background"
|
/a.btn.dropdown-toggle data-toggle="dropdown" href="#section-background"
|
||||||
span Background
|
span Background
|
||||||
span.caret
|
span.caret
|
||||||
@@ -12,11 +12,11 @@
|
|||||||
each texture in textures
|
each texture in textures
|
||||||
li
|
li
|
||||||
a{ action setTexture texture } {{texture}}
|
a{ action setTexture texture } {{texture}}
|
||||||
.btn-group
|
a.tiny.button.dropdown href="#" data-dropdown="section-action-list" Action
|
||||||
button.btn.dropdown-toggle data-toggle="dropdown"
|
/button.btn.dropdown-toggle data-toggle="dropdown"
|
||||||
span Action
|
span Action
|
||||||
span.caret
|
span.caret
|
||||||
ul#section-actions.dropdown-menu
|
ul#section-action-list.f-dropdown data-dropdown-content=true
|
||||||
li
|
li
|
||||||
a{action addTables} {{t 'section.add_tables.button_label'}}
|
a{action addTables} {{t 'section.add_tables.button_label'}}
|
||||||
li
|
li
|
||||||
@@ -32,5 +32,4 @@
|
|||||||
a.section-normal-mode-button{ action finishEditable }: span
|
a.section-normal-mode-button{ action finishEditable }: span
|
||||||
else
|
else
|
||||||
a.section-edit-mode-button{ action makeEditable }: span
|
a.section-edit-mode-button{ action makeEditable }: span
|
||||||
each table in tables
|
Qsupplier.App.SectionTablesView contentBinding="tables"
|
||||||
view 'Qsupplier.App.SectionTableView' contentBinding="table"
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
each table in tables
|
||||||
|
Qsupplier.App.SectionTableView contentBinding="table"
|
||||||
@@ -15,7 +15,7 @@ div class="table-actions table-actions-#{unbound table.id}"
|
|||||||
a href="suppliers_table_path(@table)" {{t 'section.tables_view.table_actions.got_to_table'}}
|
a href="suppliers_table_path(@table)" {{t 'section.tables_view.table_actions.got_to_table'}}
|
||||||
each user in table.active_list.users
|
each user in table.active_list.users
|
||||||
img src=user.facebook_image
|
img src=user.facebook_image
|
||||||
if editmode
|
if editmodedisabled
|
||||||
.table-settings
|
.table-settings
|
||||||
select
|
select
|
||||||
option Round
|
option Round
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ Qsupplier.App.SectionTableView = Ember.View.extend DragNDrop.Draggable,
|
|||||||
#@$('.table-actions .title').remove()
|
#@$('.table-actions .title').remove()
|
||||||
content.hide()
|
content.hide()
|
||||||
@$el.on 'click', =>
|
@$el.on 'click', =>
|
||||||
content.toggle()
|
content.toggle() if @$el.hasClass('occupied')
|
||||||
#@$el.qtip
|
#@$el.qtip
|
||||||
#content:
|
#content:
|
||||||
#text: content
|
#text: content
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,6 @@
|
|||||||
Qsupplier.App.SectionView = Ember.View.extend DragNDrop.Droppable,
|
Qsupplier.App.SectionTablesView = Ember.View.extend DragNDrop.Droppable,
|
||||||
classNames: ['well', 'section-tables-container', 'section-tables-active']
|
classNames: ['well', 'section-tables-container', 'section-tables-active']
|
||||||
|
templateName: 'section_tables'
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
@$el = $(@get('element'))
|
@$el = $(@get('element'))
|
||||||
height = @$el.width() * @get('controller.model.height') / @get('controller.model.width')
|
height = @$el.width() * @get('controller.model.height') / @get('controller.model.width')
|
||||||
@@ -12,6 +13,7 @@ Qsupplier.App.SectionView = Ember.View.extend DragNDrop.Droppable,
|
|||||||
height = @$el.width() * @get('controller.model.height') / @get('controller.model.width')
|
height = @$el.width() * @get('controller.model.height') / @get('controller.model.width')
|
||||||
@$el.css('height', height)
|
@$el.css('height', height)
|
||||||
).observes('controller.model.height', 'controller.model.width')
|
).observes('controller.model.height', 'controller.model.width')
|
||||||
|
tables: (->@get('content')).property('content')
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
# the first observable event is triggered without the container having its dimensions
|
# the first observable event is triggered without the container having its dimensions
|
||||||
@get('controller.model').notifyPropertyChange('width').notifyPropertyChange('height')
|
@get('controller.model').notifyPropertyChange('width').notifyPropertyChange('height')
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
//= require jquery
|
//= require jquery
|
||||||
//= require jquery_ujs
|
//= require jquery_ujs
|
||||||
//= require jquery.ui.sortable
|
//= require jquery.ui.sortable
|
||||||
|
//= require vendor/modernizr
|
||||||
|
//= require foundation
|
||||||
//= require js-routes
|
//= require js-routes
|
||||||
//= require translations
|
//= require translations
|
||||||
//= require qwaiter
|
//= require qwaiter
|
||||||
@@ -18,6 +20,8 @@ var Qstorage = localStorage;
|
|||||||
$.extend($translations.en, <%= I18n.t('supplier', locale: :en).to_json %>);
|
$.extend($translations.en, <%= I18n.t('supplier', locale: :en).to_json %>);
|
||||||
$.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>);
|
$.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>);
|
||||||
|
|
||||||
|
$(document).foundation();
|
||||||
|
|
||||||
String.prototype.capitalize = function() {
|
String.prototype.capitalize = function() {
|
||||||
return this.charAt(0).toUpperCase() + this.slice(1);
|
return this.charAt(0).toUpperCase() + this.slice(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,27 @@
|
|||||||
.section-title
|
.section-title
|
||||||
font-size: 24px
|
font-size: 24px
|
||||||
padding: 4px 0px
|
padding: 4px 0px
|
||||||
.section-tables-container
|
.section-manage-tables
|
||||||
.section-manage-tables
|
|
||||||
margin: -32px 6px 4px 6px
|
margin: -32px 6px 4px 6px
|
||||||
|
min-width: 470px
|
||||||
|
text-align: right
|
||||||
|
.section-edit-title-field
|
||||||
|
display: inline-block
|
||||||
|
width: 120px
|
||||||
|
.section-edit-width-field
|
||||||
|
display: inline-block
|
||||||
|
width: 40px
|
||||||
|
.section-edit-height-field
|
||||||
|
display: inline-block
|
||||||
|
width: 40px
|
||||||
|
#section-action-list
|
||||||
|
text-align: left
|
||||||
|
.section-tables-container
|
||||||
|
$section-border: 1px solid black
|
||||||
|
border-left: $section-border
|
||||||
|
border-right: $section-border
|
||||||
|
border-bottom: $section-border
|
||||||
|
border: $section-border
|
||||||
.section-table
|
.section-table
|
||||||
background-color: #ccc
|
background-color: #ccc
|
||||||
//TODO remove width and height for ember control
|
//TODO remove width and height for ember control
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
.dashboard-section-selection
|
.dashboard-section-selection
|
||||||
float: right
|
float: right
|
||||||
white-space: nowrap
|
min-width: 124px
|
||||||
|
select
|
||||||
|
width: calc(100% - 30px)
|
||||||
.active-lists-table
|
.active-lists-table
|
||||||
width: 100%
|
width: 100%
|
||||||
.mark_list_as_helped
|
.mark_list_as_helped
|
||||||
|
|||||||
@@ -9,8 +9,10 @@
|
|||||||
font-weight: bold
|
font-weight: bold
|
||||||
background-color: rgba(200,200,200,0.4)
|
background-color: rgba(200,200,200,0.4)
|
||||||
color: #333
|
color: #333
|
||||||
|
margin-bottom: 2px
|
||||||
&.active
|
&.active
|
||||||
border-bottom-width: 0
|
border-bottom-width: 0
|
||||||
|
margin-top: 2px
|
||||||
&.table-hover, &.table-dragging
|
&.table-hover, &.table-dragging
|
||||||
background-size: 100px
|
background-size: 100px
|
||||||
background-position: center center
|
background-position: center center
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ General:
|
|||||||
- search for class btn and replace with font awesome correct styling if
|
- search for class btn and replace with font awesome correct styling if
|
||||||
needed
|
needed
|
||||||
Bugs:
|
Bugs:
|
||||||
- New order in supplier main board has no price yet
|
- Dragging supplier table from one section to the other fails
|
||||||
|
|
||||||
Post release
|
Post release
|
||||||
------------
|
------------
|
||||||
|
|||||||
Reference in New Issue
Block a user