User app refactor
This commit is contained in:
@@ -1,4 +1 @@
|
||||
App.ListsIndexController = Ember.ArrayController.extend App.PaginationModule,
|
||||
actions:
|
||||
showList: (list)->
|
||||
@transitionToRoute 'list', list
|
||||
App.ListsIndexController = Ember.ArrayController.extend App.PaginationModule
|
||||
|
||||
@@ -4,7 +4,6 @@ App.List = DS.Model.extend
|
||||
needs_help: attr('boolean')
|
||||
needs_payment: attr('boolean')
|
||||
user_requests_closing: attr('boolean')
|
||||
supplier_name: attr('string')
|
||||
state: attr('string')
|
||||
price: attr('number')
|
||||
closed_at: DS.attr('date')
|
||||
@@ -24,3 +23,4 @@ App.List = DS.Model.extend
|
||||
total: (->
|
||||
@get('relevant_orders').getEach('total').reduce(((sum, total) -> sum + total), 0)
|
||||
).property('relevant_orders.@each.total')
|
||||
active: (-> @get('state') is 'active' ).property('state')
|
||||
|
||||
@@ -8,6 +8,7 @@ App.Supplier= DS.Model.extend
|
||||
|
||||
orders: DS.hasMany('order')
|
||||
product_categories: DS.hasMany('product_category')
|
||||
lists: DS.hasMany('list')
|
||||
|
||||
is_extended_version: ->
|
||||
@get('extended_version')
|
||||
@@ -16,5 +17,3 @@ App.Supplier= DS.Model.extend
|
||||
return false unless @get('open')
|
||||
true
|
||||
).property('open')
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
.row
|
||||
h2=t 'models.plural.list'
|
||||
each list in controller
|
||||
.lists-overview-entry{action "showList" list}
|
||||
span.created_at=time list.created_at
|
||||
span.price.currency= currency list.price
|
||||
span.name= list.supplier_name
|
||||
hr
|
||||
each list in controller: App.ListIndexView contentBinding='list'
|
||||
.clearfix
|
||||
if hasMore
|
||||
button{action "showMore"}=t 'lists.show_more'
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
span.created_at=time list.created_at
|
||||
span.price.currency= currency list.price
|
||||
span.name= list.supplier.name
|
||||
@@ -0,0 +1,5 @@
|
||||
App.ListIndexView = Ember.View.extend
|
||||
templateName: 'lists/list_entry'
|
||||
classNames: ['lists-overview-entry']
|
||||
classNameBindings: ['content.active:active']
|
||||
click: -> @get('controller').transitionToRoute 'list', @get('content')
|
||||
@@ -6,7 +6,7 @@ header.top-menu
|
||||
background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png')
|
||||
color: $green
|
||||
padding-left: 48px
|
||||
padding-right: 52px
|
||||
padding-right: 52px
|
||||
.menu-content
|
||||
background-color: white
|
||||
background-repeat: repeat-x
|
||||
|
||||
@@ -6,3 +6,4 @@ $green: #7BB459 //Heineken
|
||||
$wood: image-url('theme1/wall-bg.jpg')
|
||||
$background-brown: #57351f
|
||||
$current-color: #ff0
|
||||
$active-color: #f70
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
.lists-overview-entry
|
||||
+grid-column(12)
|
||||
cursor: pointer
|
||||
border-bottom: 1px solid #ddd
|
||||
margin-bottom: 12px
|
||||
@media #{$medium-only}
|
||||
+grid-column(6)
|
||||
@media #{$large-up}
|
||||
@@ -11,6 +13,8 @@
|
||||
float: right
|
||||
clear: right
|
||||
+panel($padding: 4px)
|
||||
&.active
|
||||
border: 1px solid $active-color
|
||||
.list-orders-container
|
||||
$padding: 6px 0 6px 35px
|
||||
border-top: 2px solid #555
|
||||
|
||||
@@ -55,8 +55,8 @@ header.top-menu
|
||||
color: $current-color
|
||||
border-color: $current-color
|
||||
&.callout
|
||||
color: #f70
|
||||
border-color: #f70
|
||||
color: $active-color
|
||||
border-color: $active-color
|
||||
@media #{$medium-only}
|
||||
margin-left: 8px
|
||||
@media #{$small-only}
|
||||
|
||||
Reference in New Issue
Block a user