small refactor for ember actions
This commit is contained in:
@@ -2,5 +2,13 @@ attr = DS.attr
|
||||
App.User = DS.Model.extend
|
||||
facebook_id: attr('string')
|
||||
email: attr('string')
|
||||
name: attr('string')
|
||||
list: DS.belongsTo('list') # in ember scope not many to many (yet)
|
||||
join_requests: DS.hasMany('join_request')
|
||||
facebook_image_tag: (->
|
||||
facebook_id = @get('facebook_id')
|
||||
return '' unless facebook_id
|
||||
url = "http://graph.facebook.com/#{facebook_id}/picture?type=square"
|
||||
name = @get('name')
|
||||
new Handlebars.SafeString "<img src=\"#{url}\" alt=\"#{name}\" title=\"#{name}\" class=\"user-facebook-image\">"
|
||||
).property('facebook_id', 'name')
|
||||
|
||||
@@ -59,7 +59,7 @@ aside.side-menu
|
||||
main.main-section
|
||||
.main-section-content
|
||||
if notice
|
||||
#notice.alert-box{action clearNotice} data-alert=true
|
||||
#notice.alert-box{action "clearNotice"} data-alert=true
|
||||
a.right href="#"
|
||||
span.fa.fa-times.fa-lg
|
||||
span= notice
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
h2= t 'join_request.existing_user.title'
|
||||
each join_request in join_requests
|
||||
.join-request-container
|
||||
img.facebook-image src="http://graph.facebook.com/#{unbound join_request.user.facebook_id}/picture?type=square"
|
||||
= join_request.user.facebook_image_tag
|
||||
span.user-email= join_request.user.email
|
||||
.right
|
||||
button.join-request-reject{action rejectRequest join_request}=t 'join_request.existing_user.reject_request'
|
||||
button.join-request-approve{action approveRequest join_request}=t 'join_request.existing_user.approve_request'
|
||||
button.join-request-reject{action "rejectRequest" join_request}=t 'join_request.existing_user.reject_request'
|
||||
button.join-request-approve{action "approveRequest" join_request}=t 'join_request.existing_user.approve_request'
|
||||
else
|
||||
p=t 'join_request.existing_user.no_join_requests_message'
|
||||
|
||||
@@ -3,4 +3,4 @@ modal-dialog action="close"
|
||||
p=body
|
||||
hr
|
||||
button.confirm-cancel{action "close"}= t 'confirm.cancel'
|
||||
button.confirm-ok.right{action 'confirm'}= t 'confirm.confirm'
|
||||
button.confirm-ok.right{action "confirm"}= t 'confirm.confirm'
|
||||
|
||||
@@ -2,4 +2,4 @@ modal-dialog action="close"
|
||||
h3.flush--top= title
|
||||
p==body
|
||||
hr
|
||||
button{action 'close'}= t 'modal.info.close'
|
||||
button{action "close"}= t 'modal.info.close'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.row
|
||||
h2
|
||||
=t 'models.table'
|
||||
|
|
||||
|
|
||||
= number
|
||||
if showJoinButton
|
||||
if join_request_sent
|
||||
@@ -9,13 +9,13 @@
|
||||
span.fa.fa-spinner.fa-spin.fa-lg
|
||||
span=t 'join_request.requestor.waiting_for_approval'
|
||||
else
|
||||
button.join-table-button{action joinOccupiedTable}=t 'join_request.requestor.join_this_table'
|
||||
button.join-table-button{action "joinOccupiedTable"}=t 'join_request.requestor.join_this_table'
|
||||
if tableCanTakeOrders
|
||||
.large-6.columns
|
||||
each product_category in supplier.product_categories
|
||||
if product_category.products
|
||||
hr
|
||||
h4.product_category-title{action toggleProductCategory product_category}
|
||||
h4.product_category-title{action "toggleProductCategory" product_category}
|
||||
if product_category.collapsed
|
||||
span.icon.collapsed
|
||||
else
|
||||
@@ -27,12 +27,12 @@
|
||||
each product in product_category.products
|
||||
li class="order-product-#{unbound product.id}"
|
||||
if product.description
|
||||
button.show-product-description{action showProductDescription product}
|
||||
button.show-product-description{action "showProductDescription" product}
|
||||
span
|
||||
else
|
||||
span.no-product-description
|
||||
a{action addProduct product}= product.name
|
||||
button.add-product-to-list{action addProduct product}
|
||||
a{action "addProduct" product}= product.name
|
||||
button.add-product-to-list{action "addProduct" product}
|
||||
span
|
||||
span.product-price.currency=currency product.price
|
||||
.large-6.columns= render 'product_orders'
|
||||
@@ -47,7 +47,7 @@
|
||||
each product in product_category.products
|
||||
li class="order-product-#{unbound product.id}"
|
||||
if product.description
|
||||
button.show-product-description{action showProductDescription product}
|
||||
button.show-product-description{action "showProductDescription" product}
|
||||
span
|
||||
span= product.name
|
||||
span.right.currency=currency product.price
|
||||
|
||||
Reference in New Issue
Block a user