forked from saberma/shopqi
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,8 @@ App = | |
Customer: | ||
Index: | ||
Filter: {} | ||
Show: {} | ||
Show: | ||
Order: {} | ||
CustomerGroup: | ||
Index: {} | ||
Product: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/coffeescripts/views/customers/show/orders/index.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
App.Views.Customer.Show.Order.Index = Backbone.View.extend | ||
el: '#show-customer-screen' | ||
|
||
initialize: -> | ||
self = this | ||
@collection = new App.Collections.Orders @model.get('orders') | ||
this.render() | ||
|
||
render: -> | ||
self = this | ||
template = Handlebars.compile $('#customer-facts-item').html() | ||
$('#customer-facts').html template @model.attributes | ||
@collection.each (model) -> new App.Views.Customer.Show.Order.Show model: model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
App.Views.Customer.Index.Filter.Show = Backbone.View.extend | ||
className: 'filter-tag' | ||
|
||
events: | ||
"click .close-filter-tag": 'destroy' # 删除主过滤器 | ||
|
||
initialize: -> | ||
self = this | ||
_.bindAll this, 'render' | ||
this.render() | ||
|
||
# 删除过滤器 | ||
destroy: -> | ||
@model.collection.remove @model | ||
this.remove() | ||
false | ||
|
||
render: -> | ||
template = Handlebars.compile $('#customer-search_filters-item').html() | ||
$(@el).html template @model.attributes | ||
$('#customer-search_filters').append @el |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters