Qwaiter supplier on Ember 1.0
This commit is contained in:
@@ -17,6 +17,7 @@ Qsupplier.App.IndexController = Ember.ObjectController.extend
|
||||
list = Qsupplier.App.List.find(id)
|
||||
list.set('needs_help', false)
|
||||
$.post '/supplier/mark_list_as_helped', {list_id: id}
|
||||
|
||||
closeList: (id)->
|
||||
list = Qsupplier.App.List.find(id)
|
||||
list.set('state', 'closed')
|
||||
|
||||
@@ -11,3 +11,8 @@ Qsupplier.App.List = DS.Model.extend
|
||||
orders: DS.hasMany('Qsupplier.App.Order')
|
||||
section: DS.belongsTo('Qsupplier.App.Section')
|
||||
section_id: attr('string')
|
||||
close: ->
|
||||
@get('orders').forEach (order)->
|
||||
order.close()
|
||||
@set('table', null)
|
||||
@list.set('state', 'closed')
|
||||
|
||||
@@ -2,7 +2,7 @@ attr = DS.attr
|
||||
Qsupplier.App.Order = DS.Model.extend
|
||||
state: attr('string')
|
||||
list: DS.belongsTo('Qsupplier.App.List')
|
||||
total_amount: attr('number')
|
||||
price: attr('number')
|
||||
product_orders: attr('object')
|
||||
section: DS.belongsTo('Qsupplier.App.Section')
|
||||
section_id: attr('string')
|
||||
@@ -13,5 +13,9 @@ Qsupplier.App.Order = DS.Model.extend
|
||||
needs_supplier_attention: (-> @get('state') == 'placed' || @get('state') == 'active').property('state')
|
||||
|
||||
display: (->
|
||||
return '' unless @get('product_orders')
|
||||
@get('product_orders').map((po)-> "#{po.product_name} (#{po.quantity})").join(',')
|
||||
).property('product_orders')
|
||||
|
||||
close: ->
|
||||
@set('state', 'closed')
|
||||
|
||||
@@ -3,9 +3,25 @@ DS.Model.reopen
|
||||
updated_at: DS.attr('string')
|
||||
DS.Model.reopenClass
|
||||
findCached: (id)->
|
||||
return null unless id
|
||||
@all().findProperty('id', id)
|
||||
updateOrCreate: (attributes)->
|
||||
updateOrAdd: (attributes)->
|
||||
if cached = @findCached(attributes.id)
|
||||
cached.setProperties attributes
|
||||
else
|
||||
@createRecord(attributes)
|
||||
@find(attributes.id)
|
||||
pushByAttriburtes: (attributes)->
|
||||
#store = @all().get('store')
|
||||
|
||||
#Ugly hack at the cost of an extra request since I do not yet know the proper
|
||||
#code for adding a record by its attributes and having its associations set
|
||||
#@find(attributes.id)
|
||||
|
||||
Ember.get(@, 'relationships').forEach (model, relation)->
|
||||
relation = relation[0]
|
||||
if relation.kind == 'belongsTo' and attributes["#{relation.name}_id"]
|
||||
attributes[relation.name] = model.find(attributes["#{relation.name}_id"])
|
||||
delete attributes["#{relation.name}_id"]
|
||||
|
||||
#store.push @, attributes
|
||||
@createRecord attributes
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# For more information see: http://emberjs.com/guides/routing/
|
||||
# and for queryParams: https://github.com/alexspeller/website/blob/a96d9afe4506454b155cc64299e86e558ce3c9f1/source/guides/routing/query-params.md
|
||||
Qsupplier.App.Router.reopen
|
||||
location: 'history'
|
||||
rootURL: '/supplier'
|
||||
@@ -6,4 +7,4 @@ Qsupplier.App.Router.reopen
|
||||
Qsupplier.App.Router.map ->
|
||||
@resource 'sections', ->
|
||||
@resource 'section', path: ':section_id'
|
||||
|
||||
@resource 'lists', queryParams: ['state']
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
Qsupplier.App.IndexRoute = Ember.Route.extend
|
||||
model: ->
|
||||
model: (params, queryParams)->
|
||||
# Preload only active lists and orders
|
||||
@store.find 'list', state: 'active'
|
||||
@store.find 'order', state: 'active'
|
||||
Ember.Object.create
|
||||
lists: Qsupplier.App.List.find({state: 'active'})
|
||||
orders: Qsupplier.App.Order.find()
|
||||
# Find with condition does not work since the resulting array promise is not updated for newly created records
|
||||
#lists: Qsupplier.App.List.find({state: 'active'})
|
||||
#orders: Qsupplier.App.Order.find({state: 'active'})
|
||||
#lists: @store.filter 'list', (l)-> l.get('state') == 'active' # DOES NOT WORK!!!! (yet)
|
||||
# use filter to create a scope on all the records
|
||||
lists: Qsupplier.App.List.filter -> true
|
||||
orders: Qsupplier.App.Order.filter -> true
|
||||
setupController: (controller, model)->
|
||||
controller.set('model', model)
|
||||
$('#section_selector').on 'change', (-> controller.set('sectionId', $(this).val()))
|
||||
#controller.set 'lists', @store.all('list')
|
||||
#controller.set 'lists', Qsupplier.App.List.all() #.filterProperty('state', 'active')
|
||||
#controller.set 'orders', Qsupplier.App.Order.all()
|
||||
#controller.set 'lists', model.get('lists')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# http://emberjs.com/guides/models/defining-a-store/
|
||||
|
||||
Qsupplier.App.Store = DS.Store.extend
|
||||
revision: 11
|
||||
revision: 13
|
||||
adapter: DS.RESTAdapter.create
|
||||
namespace: 'supplier'
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ td.list-status
|
||||
if view.content.needs_payment
|
||||
span.list-needs-payment-indicator €
|
||||
td.numeric.table_number {{view.content.table_number}}
|
||||
td.section_title {{view.content.section_title}}
|
||||
td.currency.total_list_amount {{currency total_amount}}
|
||||
td.section_title {{view.content.section.title}}
|
||||
td.currency.total_list_amount {{currency view.content.price}}
|
||||
td.actions
|
||||
if view.content.needs_help
|
||||
button.btn.btn-info{ action markListAsHelped view.content.id} {{t 'list.is_helped_button'}}
|
||||
button.btn.btn-warning{ action closeList view.content.id} {{t 'list.close_list' }}
|
||||
button.btn.btn-info.mark_list_as_helped{ action markListAsHelped view.content.id} {{t 'list.is_helped_button'}}
|
||||
button.btn.btn-warning.close_list{ action closeList view.content.id} {{t 'list.close_list' }}
|
||||
a.btn href="/supplier/lists/{{unbound view.content.id}}"
|
||||
span.icon-list
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
td {{view.content.display}}
|
||||
td.numeric.table_number {{view.content.table_number}}
|
||||
td.section_title {{view.content.section_title}}
|
||||
td.currency {{currency view.content.total_amount}}
|
||||
td.numeric.table_number {{view.content.list.table.number}}
|
||||
td.section_title {{view.content.section.title}}
|
||||
td.currency {{currency view.content.price }}
|
||||
td.actions
|
||||
if view.content.placed
|
||||
button.btn.btn-success{ action markOrderActive view.content.id} {{t 'order.being_processed'}}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
view Ember.TextField valueBinding="width" classNames="dimension"
|
||||
span x
|
||||
view Ember.TextField valueBinding="height" classNames="dimension"
|
||||
a.btn.btn-mini{ action finishEditable}
|
||||
a.btn.btn-mini{ action finishEditable }
|
||||
span.icon-ok
|
||||
else
|
||||
a.btn.btn-mini{ action makeEditable }
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
Qsupplier.App.ActiveListView = Ember.View.extend
|
||||
tagName: 'tr'
|
||||
templateName: 'active_list'
|
||||
classNameBindings: ['classIdentifier']
|
||||
classIdentifier: (-> "list-row-#{@get('content.id')}").property()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Qsupplier.App.ActiveOrderView = Ember.View.extend
|
||||
tagName: 'tr'
|
||||
templateName: 'active_order'
|
||||
classNameBindings: ['content.active:active', 'content.delivered:delivered']
|
||||
classNameBindings: ['content.active:active', 'content.delivered:delivered', 'classIdentifier']
|
||||
classIdentifier: (-> "order-row-#{@get('content.id')}").property()
|
||||
|
||||
@@ -4,7 +4,7 @@ root.Qsupplier=
|
||||
faye = new Faye.Client(event_host)
|
||||
faye.subscribe "/supplier/"+supplier_id, (e)=>
|
||||
if(e.event == 'new_order')
|
||||
Qsupplier.App.Order.create(e.data.order)
|
||||
Qsupplier.App.Order.pushByAttriburtes(e.data.order) if Qsupplier.App
|
||||
# old stuff
|
||||
body = $('#active-orders-table tbody')
|
||||
order = new Order(e.data.order)
|
||||
@@ -12,14 +12,14 @@ root.Qsupplier=
|
||||
body.append @mustache('#active-order-template', order)
|
||||
$('.section-table-list-'+order.list_id()).addClass('active_order')
|
||||
else if(e.event == 'list_needs_help')
|
||||
if list = Qsupplier.App.List.findCached(e.data.id)
|
||||
if Qsupplier.App and list = Qsupplier.App.List.findCached(e.data.id)
|
||||
list.set('needs_help', true)
|
||||
# old stuff
|
||||
$('#list-needs-help-indicator-'+e.data.id).removeClass('hide')
|
||||
$('#list-is-helped-button-'+e.data.id).removeClass('hide')
|
||||
$('.section-table-list-'+e.data.id).addClass('needs_help')
|
||||
else if(e.event == 'list_needs_payment')
|
||||
if list = Qsupplier.App.List.findCached(e.data.id)
|
||||
if Qsupplier.App and list = Qsupplier.App.List.findCached(e.data.id)
|
||||
list.set('needs_payment', true)
|
||||
# old stuff
|
||||
$('#list-needs-payment-indicator-'+e.data.id).removeClass('hide')
|
||||
@@ -28,10 +28,10 @@ root.Qsupplier=
|
||||
if list = Qsupplier.App.List.findCached(e.data.id)
|
||||
list.set('needs_payment', false)
|
||||
else if e.event == 'list_update'
|
||||
Qsupplier.App.List.updateOrCreate(e.data.list)
|
||||
Qsupplier.App.List.updateOrAdd(e.data.list) if Qsupplier.App
|
||||
# old stuff
|
||||
list = new List(e.data.list)
|
||||
row = $('#list-row-'+list.id())
|
||||
row = $('#active-lists-table .list-row-'+list.id())
|
||||
content = @mustache('#active-list-template', list)
|
||||
if row.length then row.replaceWith(content) else $('#active-lists-table tbody').append(content)
|
||||
table = $('#section-table-'+list.table_id())
|
||||
@@ -42,15 +42,14 @@ root.Qsupplier=
|
||||
table.addClass('needs_payment') if list.needs_payment()
|
||||
table.addClass('active_order') if list.has_active_orders()
|
||||
else if e.event == 'list_closed'
|
||||
if list = Qsupplier.App.List.findCached(e.data.id)
|
||||
list.set('table', null)
|
||||
list.set('state', 'closed')
|
||||
$('#list-row-'+e.data.id).remove()
|
||||
if Qsupplier.App and list = Qsupplier.App.List.findCached(e.data.id)
|
||||
list.close()
|
||||
$('.list-row-'+e.data.id).remove()
|
||||
$('.of-list-'+e.data.id).remove()
|
||||
table_list_class = 'section-table-list-'+e.data.id
|
||||
$('.'+table_list_class).removeClass('occupied needs_help needs_payment active_order').removeClass(table_list_class)
|
||||
else if e.event == 'list_helped'
|
||||
if list = Qsupplier.App.List.findCached(e.data.id)
|
||||
if Qsupplier.App and list = Qsupplier.App.List.findCached(e.data.id)
|
||||
list.set('needs_help', false)
|
||||
list_id = e.data.id
|
||||
$('#list-needs-help-indicator-'+list_id).addClass('hide')
|
||||
@@ -58,13 +57,13 @@ root.Qsupplier=
|
||||
$('.section-table-list-'+list_id).removeClass('needs_help')
|
||||
else if e.event == 'order_being_processed'
|
||||
$('#order-in-process-button-'+e.data.id).hide()
|
||||
$('#order-row-'+e.data.id).removeClass('placed').addClass('active')
|
||||
$('.order-row-'+e.data.id).removeClass('placed').addClass('active')
|
||||
else if e.event == 'order_being_delivered'
|
||||
$('#order-row-'+e.data.id).remove()
|
||||
$('.order-row-'+e.data.id).remove()
|
||||
$('.section-table-list-'+e.data.list_id).removeClass('active_order')
|
||||
else if e.event == 'list_changed_table'
|
||||
list = new List(e.data.list)
|
||||
list_row = $('#list-row-'+list.id())
|
||||
list_row = $('.list-row-'+list.id())
|
||||
list_row.find('.table_number').text(list.table_number()).addClass('changed')
|
||||
list_row.find('.section_title').text(e.data.section_title)
|
||||
order_rows = $('.of-list-'+list.id())
|
||||
|
||||
@@ -23,9 +23,9 @@ class Quser
|
||||
window.active_list.needs_help = false
|
||||
@list_needs_help_default_action()
|
||||
else if(e.event == 'order_being_processed')
|
||||
$('#order-row-'+e.data.id).addClass('active')
|
||||
$('.order-row-'+e.data.id).addClass('active')
|
||||
else if(e.event == 'order_being_delivered')
|
||||
$('#order-row-'+e.data.id).addClass('delivered')
|
||||
$('.order-row-'+e.data.id).addClass('delivered')
|
||||
else if(e.event == 'list_changed_table')
|
||||
list = new List(e.data.list)
|
||||
$('.table-number').text(list.table_number())
|
||||
|
||||
@@ -24,7 +24,7 @@ private
|
||||
end
|
||||
|
||||
def set_locale
|
||||
I18n.locale = (params[:locale].presence || :nl).to_sym
|
||||
I18n.locale = (params[:locale].presence || Rails.configuration.i18n.default_locale).to_sym
|
||||
end
|
||||
|
||||
def layout_by_resource
|
||||
|
||||
@@ -43,8 +43,8 @@ class SupplierController < ApplicationController
|
||||
ho = {products: []}
|
||||
order_total = 0.0
|
||||
for product_order in order.product_orders
|
||||
order_total += (product_order.amount * product_order.price).round(2)
|
||||
ho[:products] << {name: product_order.product.name, id: product_order.product_id, number: product_order.amount, price: product_order.price}
|
||||
order_total += (product_order.quantity * product_order.price).round(2)
|
||||
ho[:products] << {name: product_order.product.name, id: product_order.product_id, number: product_order.quantity, price: product_order.price}
|
||||
end
|
||||
ho[:total_amount] = order_total.round(2)
|
||||
ho[:state] = order.state
|
||||
|
||||
@@ -33,7 +33,7 @@ module Suppliers
|
||||
respond_to do |format|
|
||||
format.html {}
|
||||
format.json do
|
||||
render json: {list: @list.with_orders_as_json}
|
||||
render json: @list
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,12 +6,19 @@ module Suppliers
|
||||
if params[:state] == 'active'
|
||||
@orders = Order.active_for_supplier(current_supplier.id)
|
||||
else
|
||||
@orders = Order.for_supplier(current_supplier, page: params[:page], per_page: params['per_page'] || 10)
|
||||
@orders = Order.for_supplier(current_supplier, page: params[:page], per_page: params['per_page'] || 25)
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: {orders: @orders.map(&:with_products_as_json)} }
|
||||
format.json { render json: @orders }
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@order = current_supplier.find_order(params[:id])
|
||||
respond_to do |format|
|
||||
format.json { render json: @order }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+10
-9
@@ -243,12 +243,13 @@ class List
|
||||
end
|
||||
end
|
||||
|
||||
# Store the final list price in a property
|
||||
def set_price
|
||||
list_total = 0.0
|
||||
for order in orders
|
||||
order_total = 0.0
|
||||
for product_order in order.product_orders
|
||||
order_total += (product_order.amount * product_order.price).round(2)
|
||||
order_total += (product_order.quantity * product_order.price).round(2)
|
||||
end
|
||||
list_total += order_total.round(2)
|
||||
end
|
||||
@@ -269,23 +270,23 @@ class List
|
||||
order = Order.create list: self, supplier: supplier, user: user, section_id: section_id
|
||||
return unless order.id
|
||||
loaded_products = self.class.database.load_document products.keys
|
||||
products.each do |product_id, number|
|
||||
number = number.to_i
|
||||
products.each do |product_id, quantity|
|
||||
quantity = quantity.to_i
|
||||
product = loaded_products.find{|p| p.id == product_id} # to get the price
|
||||
ProductOrder.create order: order, product_id: product_id, amount: number, price: product.price if number > 0
|
||||
ProductOrder.create order: order, product_id: product_id, quantity: quantity, price: product.price if quantity > 0
|
||||
end
|
||||
set_price
|
||||
save
|
||||
for user_id in user_ids
|
||||
broadcast_user user_id, 'new_order', order: order.with_products_as_json, total_amount: price
|
||||
end
|
||||
broadcast_supplier supplier.id, 'list_update', list: with_info_as_json
|
||||
broadcast_supplier supplier.id, 'list_update', active_model_serializer.new(self).as_json
|
||||
broadcast_supplier supplier.id, 'new_order', order: order.with_products_as_json
|
||||
order
|
||||
end
|
||||
|
||||
def as_json(*args)
|
||||
super.merge(table_number: table_number, has_active_orders: has_active_orders? )
|
||||
super.merge(id: id, table_number: table_number, has_active_orders: has_active_orders? )
|
||||
end
|
||||
|
||||
def with_orders_as_json
|
||||
@@ -301,8 +302,8 @@ class List
|
||||
ho[:state] = order.state
|
||||
order_total = 0.0
|
||||
for product_order in order.product_orders
|
||||
order_total += (product_order.amount * product_order.price).round(2)
|
||||
ho[:products] << {name: product_order.product_name, id: product_order.product_id, number: product_order.amount, price: product_order.price}
|
||||
order_total += (product_order.quantity * product_order.price).round(2)
|
||||
ho[:products] << {name: product_order.product_name, id: product_order.product_id, number: product_order.quantity, price: product_order.price}
|
||||
end
|
||||
ho[:total_amount] = order_total.round(2)
|
||||
ho[:state] = order.state
|
||||
@@ -343,7 +344,7 @@ class List
|
||||
def with_info_as_json
|
||||
return @with_info_as_json if @with_info_as_json.present?
|
||||
hl = as_json
|
||||
hl[:total_amount] = orders.inject(0.0){|sum, o| sum + o.product_orders.inject(0.0){|s, po| s + (po.amount * po.price).round(2)}}.round(2)
|
||||
hl[:total_amount] = orders.inject(0.0){|sum, o| sum + o.product_orders.inject(0.0){|s, po| s + (po.quantity * po.price).round(2)}}.round(2)
|
||||
hl[:section_title] = table.section.try(:title)
|
||||
@with_info_as_json = hl
|
||||
end
|
||||
|
||||
+4
-3
@@ -1,5 +1,6 @@
|
||||
class Order
|
||||
include SimplyStored::Couch
|
||||
include ActiveModel::SerializerSupport
|
||||
|
||||
property :state, default: 'placed' # placed, active, delivered, cancelled, closed
|
||||
|
||||
@@ -115,9 +116,9 @@ class Order
|
||||
ho[:product_orders] = []
|
||||
order_total = 0.0
|
||||
for product_order in product_orders
|
||||
order_total += (product_order.amount * product_order.price).round(2)
|
||||
ho[:products] << {name: product_order.product.name, id: product_order.product_id, number: product_order.amount, price: product_order.price}
|
||||
ho[:product_orders] << {product_name: product_order.product.name, id: product_order.id, quantity: product_order.amount, price: product_order.price}
|
||||
order_total += (product_order.quantity * product_order.price).round(2)
|
||||
ho[:products] << {name: product_order.product.name, id: product_order.product_id, number: product_order.quantity, price: product_order.price}
|
||||
ho[:product_orders] << {product_name: product_order.product.name, id: product_order.id, quantity: product_order.quantity, price: product_order.price}
|
||||
end
|
||||
ho[:total_amount] = order_total.round(2)
|
||||
@with_products_as_json = ho
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class ProductOrder
|
||||
include SimplyStored::Couch
|
||||
|
||||
property :amount, type: Fixnum
|
||||
property :quantity, type: Fixnum
|
||||
property :price, type: Float
|
||||
|
||||
belongs_to :product
|
||||
|
||||
@@ -11,7 +11,7 @@ class Supplier
|
||||
#LOCATION
|
||||
property :lat, type: Float, default: 52.08062426379751
|
||||
property :lng, type: Float, default: 4.312562942504883
|
||||
|
||||
|
||||
#WIFI
|
||||
property :offer_wifi
|
||||
property :wifi_ssid
|
||||
@@ -112,6 +112,12 @@ class Supplier
|
||||
self.devise_mailer.confirmation_instructions(self).deliver
|
||||
end
|
||||
|
||||
def find_order(id)
|
||||
order = Order.find(id)
|
||||
raise SimplyStored::RecordNotFound unless order.supplier_id == self.id
|
||||
order
|
||||
end
|
||||
|
||||
def send_creation_notifications
|
||||
SupplierMailer.creation(self).deliver
|
||||
end
|
||||
|
||||
@@ -7,6 +7,8 @@ class User
|
||||
|
||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :token_authenticatable # , :registerable
|
||||
|
||||
property :authentication_token
|
||||
|
||||
has_and_belongs_to_many :lists, storing_keys: false
|
||||
has_many :orders
|
||||
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
class OrderSerializer < Qwaiter::Serializer
|
||||
embed :ids
|
||||
attributes :state, :list_id, :section_id
|
||||
attributes :state, :list_id, :section_id, :product_orders, :price
|
||||
|
||||
def product_orders
|
||||
@product_orders ||= object.product_orders.include_relation(:product) .map do |product_order|
|
||||
{product_name: product_order.product.name, id: product_order.id, quantity: product_order.quantity, price: product_order.price}
|
||||
end
|
||||
end
|
||||
|
||||
def price
|
||||
product_orders.inject(0){|sum, po| sum + po[:quantity] * po[:price]}.round(2)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<tr id="list-row-{{id}}">
|
||||
<tr class="list-row-{{id}}">
|
||||
<td class="list-status">
|
||||
<span id="list-needs-help-indicator-{{id}}" class="list-needs-help-indicator {{^needs_help}}hide{{/needs_help}}">?</span>
|
||||
<span id="list-needs-payment-indicator-{{id}}" class="list-needs-payment-indicator {{^needs_payment}}hide{{/needs_payment}}">€</span>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<tr id="order-row-{{id}}" class="of-list-{{list_id}} {{state}}">
|
||||
<tr class="order-row-{{id}} of-list-{{list_id}} {{state}}">
|
||||
<td>{{display}}</td>
|
||||
<td class="numeric table_number">{{table_number}}</td>
|
||||
<td class="section_title">{{section_title}}</td>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<tr id="order-row-{{id}}" class="{{state}}">
|
||||
<tr class="order-row-{{id}} {{state}}">
|
||||
<td>{{display}}</td>
|
||||
<td class="currency">{{#currency}}{{total_amount}}{{/currency}}</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<tr id="order-row-{{id}}" class="{{state}}">
|
||||
<tr class="order-row-{{id}} {{state}}">
|
||||
<td>{{display}}</td>
|
||||
<td class="currency">{{#currency}}{{total_amount}}{{/currency}}</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.pull-right
|
||||
= select_tag('current_section_selector', options_for_select([[current_supplier.name, '']] + current_supplier.sections.map{|s| ["- #{s.title}", s.id]}, params[:section_id]), id: :section_selector)
|
||||
a.icon-arrow-right.go-to-tables-view.hide href=tables_view_suppliers_section_path('0000')
|
||||
= render template: 'supplier/active_lists'
|
||||
= render template: 'supplier/active_orders'
|
||||
/= render template: 'supplier/active_lists'
|
||||
/= render template: 'supplier/active_orders'
|
||||
- content_for :footer do
|
||||
javascript:
|
||||
$(function(){
|
||||
|
||||
Reference in New Issue
Block a user