Add user product info
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
App.ModalInfoController = Ember.ObjectController.extend
|
||||
actions:
|
||||
close: ->
|
||||
@get('model.cancel').call(@) if @get('model.cancel')
|
||||
@send 'closeModal'
|
||||
@@ -28,3 +28,7 @@ App.TableController = Ember.ObjectController.extend
|
||||
@set 'join_request_sent', true # keeps the button deactivated
|
||||
toggleProductCategory: (product_category)->
|
||||
product_category.set 'collapsed', not product_category.get('collapsed')
|
||||
showProductDescription: (product)->
|
||||
@send 'openModal', 'modal_info', Ember.Object.create
|
||||
title: product.get('name')
|
||||
body: textile(product.get('description'))
|
||||
|
||||
@@ -2,5 +2,6 @@ attr = DS.attr
|
||||
App.Product = DS.Model.extend
|
||||
name: attr 'string'
|
||||
price: attr 'number'
|
||||
description: attr 'string'
|
||||
product_category: DS.belongsTo('product_category')
|
||||
product_orders: DS.hasMany('product_order')
|
||||
|
||||
@@ -6,6 +6,11 @@ ControllerExtensions = Ember.Mixin.create
|
||||
if jqXHR.status == 401
|
||||
App.__container__.lookup('route:application').unauthorized()
|
||||
handler
|
||||
showModal: (options={})->
|
||||
$(document).foundation('reflow') # needed (stupid!!!)
|
||||
@confirm_cancel = options.cancel
|
||||
@set 'controllers.application.modal.title', options.title if options.title
|
||||
@set 'controllers.application.modal.content', options.content if options.content
|
||||
Ember.ArrayController.reopen ControllerExtensions
|
||||
Ember.Controller.reopen
|
||||
needs: ['application']
|
||||
@@ -47,13 +52,6 @@ Ember.Controller.reopen
|
||||
##@set 'controllers.application.confirm.content', options.content if options.content
|
||||
##$('#confirm-modal').foundation('reveal', 'open') # this kills the ember actions
|
||||
##$('#confirm-modal').css('visibility', 'visible').show()
|
||||
showModal: (options={})->
|
||||
#this.container.lookup('view:modal', {title:'Test title'})
|
||||
#debugger
|
||||
$(document).foundation('reflow') # needed (stupid!!!)
|
||||
@confirm_cancel = options.cancel
|
||||
@set 'controllers.application.modal.title', options.title if options.title
|
||||
@set 'controllers.application.modal.content', options.content if options.content
|
||||
#$('#confirm-modal').foundation('reveal', 'open') #this kills the ember actions
|
||||
#$('#confirm-modal').css('visibility', 'visible').show()
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
modal-dialog action="close"
|
||||
h3.flush--top= title
|
||||
p==body
|
||||
hr
|
||||
button{action 'close'}= t 'modal.info.close'
|
||||
@@ -25,9 +25,16 @@
|
||||
unless product_category.collapsed
|
||||
ul.product_category-products
|
||||
each product in product_category.products
|
||||
li
|
||||
li class="order-product-#{unbound product.id}"
|
||||
if product.description
|
||||
button.show-product-description{action showProductDescription product}
|
||||
span
|
||||
else
|
||||
span.no-product-description
|
||||
a{action addProduct product}= product.name
|
||||
span.right.currency=currency product.price
|
||||
button.add-product-to-list{action addProduct product}
|
||||
span
|
||||
span.product-price.currency=currency product.price
|
||||
.large-6.columns= render 'product_orders'
|
||||
else
|
||||
.large12
|
||||
@@ -39,5 +46,8 @@
|
||||
ul.product_category-products
|
||||
each product in product_category.products
|
||||
li
|
||||
if product.description
|
||||
button.show-product-description{action showProductDescription product}
|
||||
span
|
||||
span= product.name
|
||||
span.right.currency=currency product.price
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#= require translations
|
||||
#= require js-routes
|
||||
#= require_directory .
|
||||
#= require textile-js
|
||||
#= require_self
|
||||
#
|
||||
# (($) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import foundation_and_overrides
|
||||
@import ./foundation_and_overrides
|
||||
|
||||
.form-row
|
||||
@extend .row
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
// $rem-base: 16px;
|
||||
|
||||
// Allows the use of rem-calc() or lower-bound() in your settings
|
||||
a.unused-class
|
||||
display: inline-block
|
||||
@import "foundation/functions"
|
||||
|
||||
// $experimental: true;
|
||||
|
||||
@@ -8,8 +8,8 @@ header.top-menu
|
||||
background-position: left bottom, right bottom
|
||||
background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png')
|
||||
color: $green
|
||||
padding-left: 49px
|
||||
padding-right: 52px
|
||||
padding-left: 48px
|
||||
padding-right: 52px
|
||||
.menu-content
|
||||
background-color: white
|
||||
background-repeat: repeat-x
|
||||
|
||||
@@ -1,12 +1,37 @@
|
||||
@import font-awesome
|
||||
ul.product_category-products
|
||||
list-style: none
|
||||
.product_category-title
|
||||
cursor: pointer
|
||||
.icon
|
||||
@extend .fa
|
||||
@extend .fa-arrow-down
|
||||
color: #ccc
|
||||
padding-right: 10px
|
||||
&.collapsed
|
||||
@extend .fa-arrow-right
|
||||
//@import ./foundation_and_overrides
|
||||
//@import font-awesome
|
||||
//ul.product_category-products
|
||||
//list-style: none
|
||||
//.product_category-title
|
||||
//cursor: pointer
|
||||
//.icon
|
||||
//@extend .fa
|
||||
//@extend .fa-arrow-down
|
||||
//color: #ccc
|
||||
//padding-right: 10px
|
||||
//&.collapsed
|
||||
//@extend .fa-arrow-right
|
||||
//.product_category-products
|
||||
//.product-price
|
||||
//float: right
|
||||
//.show-product-description
|
||||
//+button($bg: $secondary-color)
|
||||
//+button-icon-only
|
||||
//margin-right: 7px
|
||||
//span
|
||||
//@extend .fa
|
||||
//@extend .fa-info
|
||||
//@extend .fa-lg
|
||||
//.no-product-description
|
||||
//// Empty space to match the product description for layout
|
||||
//display: inline-block
|
||||
//width: 1.65rem
|
||||
//.add-product-to-list
|
||||
//+button($bg: $secondary-color)
|
||||
//+button-icon-only
|
||||
//float: right
|
||||
//margin-left: 5px
|
||||
//span
|
||||
//@extend .fa
|
||||
//@extend .fa-plus
|
||||
//@extend .fa-lg
|
||||
|
||||
Reference in New Issue
Block a user