From 013a41b9f6f837d91aabfba67c75cd770de9bec7 Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Sun, 30 Mar 2014 15:55:22 +0200 Subject: [PATCH] Save progress --- Gemfile | 2 +- Gemfile.lock | 1 + app/assets/images/icons/logo-text.png | Bin 8609 -> 8611 bytes .../supplier/app/models/order.js.coffee | 17 +- .../supplier/app/models/product.js.coffee | 5 +- .../app/models/product_category.js.coffee | 4 + .../app/models/product_order.js.coffee | 8 + .../app/routes/application_route.js.coffee | 3 + .../javascripts/supplier/app/store.js.coffee | 9 +- .../app/templates/active_order.emblem | 2 +- .../supplier/app/templates/table.emblem | 2 +- .../javascripts/translations.js.coffee.erb | 11 +- .../application_controller.js.coffee | 19 + .../product_orders_controller.js.coffee | 16 +- .../select_qrcode_controller.js.coffee | 10 +- .../controllers/table_controller.js.coffee | 28 + .../user/app/models/list.js.coffee | 4 + .../app/models/product_category.js.coffee | 1 + .../user/app/models/product_order.js.coffee | 1 + .../user/app/models/supplier.js.coffee | 20 + .../user/app/models/table.js.coffee | 7 + .../controller_modifications.js.coffee | 20 +- .../model_modifications.js.coffee | 6 + .../javascripts/user/app/router.js.coffee | 3 +- .../app/routes/active_list_route.js.coffee | 8 +- .../app/routes/application_route.js.coffee | 12 +- .../javascripts/user/app/store.js.coffee | 5 +- .../user/app/templates/list.emblem | 2 +- .../templates/list_products_for_table.emblem | 3 +- .../user/app/templates/table.emblem | 37 + .../javascripts/user/application.js.erb | 16 + .../base1-shared/section_tables.css.sass | 2 +- .../supplier/basic1/structure.css.sass | 1 + .../stylesheets/supplier/wood1/darkstrap.sass | 11 +- .../supplier/wood1/section_tables.css.sass | 2 +- .../supplier/wood1/structure.css.sass | 1 + .../bootstrap_and_overrides.css.sass | 2 +- .../user/foundation/application.css.sass | 2 +- .../foundation_and_overrides.css.sass | 1242 +++++++++++++++++ .../user/foundation/lists.css.sass | 2 +- .../user/wood1/_constants.css.sass | 9 +- .../stylesheets/user/wood1/application.css | 1 + .../stylesheets/user/wood1/darkstrap.sass | 16 +- .../user/wood1/list_products.css.sass | 6 + .../stylesheets/user/wood1/side_menu.css.sass | 23 + .../stylesheets/user/wood1/structure.css.sass | 22 +- app/controllers/user_controller.rb | 2 +- app/controllers/users/lists_controller.rb | 1 + app/controllers/users/orders_controller.rb | 12 +- app/controllers/users/tables_controller.rb | 8 + app/models/list.rb | 38 +- app/models/order.rb | 1 + app/models/product_order.rb | 1 + app/models/supplier.rb | 1 + app/models/table.rb | 3 + app/serializers/join_request_serializer.rb | 3 + app/serializers/list_serializer.rb | 2 +- app/serializers/order_serializer.rb | 2 +- app/serializers/product_order_serializer.rb | 2 +- app/serializers/table_serializer.rb | 4 - .../user_extended_list_serializer.rb | 4 +- .../user_extended_supplier_serializer.rb | 10 + .../user_extended_table_serializer.rb | 6 + app/serializers/user_supplier_serializer.rb | 8 + app/serializers/user_table_serializer.rb | 4 + app/services/join_request.rb | 19 + app/templates/user/_active_order.mustache | 17 +- .../_products_category_for_order.mustache | 12 +- app/views/layouts/phone.html.slim | 9 +- app/views/user/list_products.html.slim | 12 +- config/routes.rb | 1 + 71 files changed, 1699 insertions(+), 107 deletions(-) create mode 100644 app/assets/javascripts/supplier/app/models/product_category.js.coffee create mode 100644 app/assets/javascripts/supplier/app/models/product_order.js.coffee create mode 100644 app/assets/javascripts/supplier/app/routes/application_route.js.coffee create mode 100644 app/assets/javascripts/user/app/controllers/table_controller.js.coffee create mode 100644 app/assets/javascripts/user/app/models/supplier.js.coffee create mode 100644 app/assets/javascripts/user/app/models/table.js.coffee create mode 100644 app/assets/javascripts/user/app/modifications/model_modifications.js.coffee create mode 100644 app/assets/javascripts/user/app/templates/table.emblem create mode 100644 app/assets/stylesheets/user/foundation/foundation_and_overrides.css.sass create mode 100644 app/assets/stylesheets/user/wood1/side_menu.css.sass create mode 100644 app/controllers/users/tables_controller.rb create mode 100644 app/serializers/join_request_serializer.rb create mode 100644 app/serializers/user_extended_supplier_serializer.rb create mode 100644 app/serializers/user_extended_table_serializer.rb create mode 100644 app/serializers/user_supplier_serializer.rb create mode 100644 app/serializers/user_table_serializer.rb create mode 100644 app/services/join_request.rb diff --git a/Gemfile b/Gemfile index 02ce8386..0f98dc19 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ group :assets do gem 'coffee-rails' #, '~> 3.2.1' #gem 'twitter-bootstrap-rails' gem 'bootstrap-sass', '~>2.3' - #gem 'bourbon' + gem 'bourbon' gem 'compass-rails' gem 'js-routes' gem "font-awesome-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 7115eadd..37a4047d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -392,6 +392,7 @@ PLATFORMS DEPENDENCIES active_decorator bootstrap-sass (~> 2.3) + bourbon capybara capybara-webkit cmtool! diff --git a/app/assets/images/icons/logo-text.png b/app/assets/images/icons/logo-text.png index d5964e953880c57b72c79eecbb4292684f39a626..9816e7657087b0fd1ca2e4414b469708fc9bf823 100644 GIT binary patch delta 8556 zcmW++by!qi6Q)yQX_2M7q>-+rq+#ilP;#lIBz8e!kp=-px=XsG1tbOOPAQk}koxxb z&7b!^cb;?JduHZ+XHK3{fl?wI_Qo^~8!O3h3oMVV2hh`%mXCAVq)c(#1W+a*Y(?mE ziVb6d)qSk~N&dO)<76y&&OF0qUIB1U&RhhY7k`}>-hsp#gD7TO{mPV~u#8mw`0@EK z%q7biL*c2ZuJW}qWoE#ifOT}fcbAor2k-JmYZXK$zL{!njdpLO7Uc;{rUoO94ZI!u zKBV6`Mp&jS5oM9_Mg}#G8O4?|rFS#5(rV#kN;TKGOJK~A>1{HHH&gE0C>vqlwh$a;&xSm8|Qp^(f#Lw(3)vnKtubp2Ye zjIU#J@x<}>GL5dmt#(C}(K4H{lD+wxOHXy83a1~q*z5=B=#RH^_8L^c-gZjF*Rni; zSoMicPV+F+v!G88e-i%N8>s|sYWtJfn^dC*f<)_OSRN1TX2g+z;94#ZW4tU-r|GFB zB6WlcovzN!XFp=s((`;$^EVGGD{C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0c@7 zFC^QkAbZWQcYiw(_Kf<^Hy#=MwO?x52xj=>uIaN8a@c^+{j0GPBb7E=R zzJD|4Uwz9S*Wx%wop3rWS_yB*z9$Vr&#zgML(gx*5d&l@)@GiHigG@D`_;ss%U+zm zINhK#t?;ZwjnYw%kVbgdrrNI{H|pr zLJ-I@7XOIk`w8aqoeodouikkFSmttkE`RjzY~NDK&K=t+ENV%!7A?`V`eB24=ReP4z3^86V(_~crhhK| zM_rBWSVjSGJ|e;4X^6^)fi8)NXnz@aRX1(Nv5fu*!}7t3*ZQ4q+OnTT9`FXK)8x+w zPDTi#uxWu1E~#pzj7O9dRy9hW3;Y-N+V!6!jO5vH7afGyDdoGITaKuQQ{vIL7ectW zm0T!C*x&ve!W`W=6ESbM?9XI^qtMLd@R7G_x!$QPT zxv>x!pqqBa7Q^wHPLuF1oHr4;NQ=c{TzOiLE47$VN%T0PAH)9m6iu4e_r$H?GxOc? zy!`mx#9}efSl_6iu==J}N&TM?i4>Q`Uw<=!595*l z$=5DGWI(NAsKxpqVhYwG1n8ZJ`y&;_z>^4JzaJvK z&O+e#z$Y1+Z-O3(T~}Yk{eQg`n1jdyk#4}QD$NkTul=aofW=D0_p}-byH7mX8IJ8n|~YeIx9`%uPVd? zP=mdHUkVx;TV-Ws8n4cpDv4-IHV{rf!YC5~n2fUcW%M(n_nb7%!@OBQHaEGF)q zVJG)2baKiq&~^ua6@RsCMREJiv~JsuqL$g-DTYgBMFpESe9xEjXW{Iuu_@Uc%ZdHw zg~`igDibz%9Ls2mNMv~nsf%H)(M`L3-OMT?BBCL)Td)9JbM(=9mCd)`huG4$$l9#3 zLpku@yxfXEjCyZ*eGZ_?2##g6L!{Wh7 @get('state') == 'active').property('state') delivered: (-> @get('state') == 'delivered').property('state') placed: (-> @get('state') == 'placed').property('state') 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') + #display: (-> + #return '' unless @get('product_orders') + #@get('product_orders').map((po)-> "#{po.product_name} (#{po.quantity})").join(',') + #).property('product_orders') markClosed: -> @set 'state', 'closed' + total: (-> + @get('product_orders').getEach('total').reduce(((sum, total) -> sum + total), 0) + ).property('product_orders.@each.quantity', 'product_orders.@each.product.@each.price') + + display: (-> + @get('product_orders').map((po) -> "#{po.get('quantity')} x #{po.get('product.name')}").join(', ') + ).property('product_orders.@each.quantity', 'product_orders.@each.product.@each.name') diff --git a/app/assets/javascripts/supplier/app/models/product.js.coffee b/app/assets/javascripts/supplier/app/models/product.js.coffee index 1454659e..4cdac7c6 100644 --- a/app/assets/javascripts/supplier/app/models/product.js.coffee +++ b/app/assets/javascripts/supplier/app/models/product.js.coffee @@ -1,3 +1,6 @@ attr = DS.attr Qsupplier.App.Product = DS.Model.extend - order: DS.belongsTo('order') + name: attr 'string' + price: attr 'number' + product_category: DS.belongsTo('product_category') + product_orders: DS.hasMany('product_order') diff --git a/app/assets/javascripts/supplier/app/models/product_category.js.coffee b/app/assets/javascripts/supplier/app/models/product_category.js.coffee new file mode 100644 index 00000000..b0e081c0 --- /dev/null +++ b/app/assets/javascripts/supplier/app/models/product_category.js.coffee @@ -0,0 +1,4 @@ +attr = DS.attr +Qsupplier.App.ProductCategory = DS.Model.extend + name: attr('string') + products: DS.hasMany('product') diff --git a/app/assets/javascripts/supplier/app/models/product_order.js.coffee b/app/assets/javascripts/supplier/app/models/product_order.js.coffee new file mode 100644 index 00000000..ace25d8e --- /dev/null +++ b/app/assets/javascripts/supplier/app/models/product_order.js.coffee @@ -0,0 +1,8 @@ +attr = DS.attr +Qsupplier.App.ProductOrder = DS.Model.extend + quantity: attr 'number', defaultValue: 1 + product: DS.belongsTo('product') + order: DS.belongsTo('order') + increment: -> + @set('quantity', @get('quantity') + 1) + total: (-> @get('quantity') * @get('product.price')).property('quantity', 'product.price') diff --git a/app/assets/javascripts/supplier/app/routes/application_route.js.coffee b/app/assets/javascripts/supplier/app/routes/application_route.js.coffee new file mode 100644 index 00000000..672c25b5 --- /dev/null +++ b/app/assets/javascripts/supplier/app/routes/application_route.js.coffee @@ -0,0 +1,3 @@ +Qsupplier.App.ApplicationRoute = Ember.Route.extend + setupController: (controller)-> + controller.set 'product_categories', @store.find('product_category') diff --git a/app/assets/javascripts/supplier/app/store.js.coffee b/app/assets/javascripts/supplier/app/store.js.coffee index 4eb9f8da..cd7200a5 100644 --- a/app/assets/javascripts/supplier/app/store.js.coffee +++ b/app/assets/javascripts/supplier/app/store.js.coffee @@ -3,6 +3,13 @@ DS.RESTAdapter.reopen namespace: 'supplier' Qsupplier.App.ApplicationSerializer = DS.ActiveModelSerializer + +Qsupplier.App.CustomAdapter = DS.RESTAdapter.extend + + # user underscored paths + pathForType: (type)-> + decamelized = Ember.String.decamelize(type) + Ember.String.pluralize(decamelized) Qsupplier.App.Store = DS.Store.extend revision: 13 - adapter: DS.RESTAdapter + adapter: Qsupplier.App.CustomAdapter diff --git a/app/assets/javascripts/supplier/app/templates/active_order.emblem b/app/assets/javascripts/supplier/app/templates/active_order.emblem index b0baa38b..8152eed0 100644 --- a/app/assets/javascripts/supplier/app/templates/active_order.emblem +++ b/app/assets/javascripts/supplier/app/templates/active_order.emblem @@ -2,7 +2,7 @@ td {{view.content.display}} td.numeric.table_number view Qsupplier.App.ActiveOrderTableNumberView contextBinding=view.content td.section_title {{view.content.section.title}} -td.currency {{currency view.content.price }} +td.currency {{currency view.content.total }} td.actions if view.content.placed button.btn.btn-success{ action markOrderActive view.content.id} {{t 'order.being_processed'}} diff --git a/app/assets/javascripts/supplier/app/templates/table.emblem b/app/assets/javascripts/supplier/app/templates/table.emblem index 8481143b..c07689cf 100644 --- a/app/assets/javascripts/supplier/app/templates/table.emblem +++ b/app/assets/javascripts/supplier/app/templates/table.emblem @@ -15,7 +15,7 @@ div class="table-actions table-actions-#{unbound table.id}" a href="suppliers_table_path(@table)" {{t 'section.tables_view.table_actions.got_to_table'}} each user in table.active_list.users img src="http://graph.facebook.com/#{user.uid}/picture?type=square" -if editmode_beta +if editmode .table-settings select option Round diff --git a/app/assets/javascripts/translations.js.coffee.erb b/app/assets/javascripts/translations.js.coffee.erb index 81e35bff..73017a5f 100644 --- a/app/assets/javascripts/translations.js.coffee.erb +++ b/app/assets/javascripts/translations.js.coffee.erb @@ -55,15 +55,16 @@ setTranslations() @setTranslations = (selector) -> - list = $("#top-navigation-list") - list.find(".locale").show() - list.find(".locale-" + $locale).hide() + #list = $("#top-navigation-list") + selector = $( selector || document) + selector.find(".locale-select").show() + selector.find(".locale-select-" + $locale).hide() moment.lang $locale if selector - $(selector).find("[data-t]").each -> + selector.find("[data-t]").each -> $(this).html t($(this).data("t"), $(this).data("tAttributes")) - $(selector).find("*[data-time]").each -> + selector.find("*[data-time]").each -> $(this).text moment($(this).data("time")).format($(this).data("timeFormat") or "dd D MMM HH:MM") else diff --git a/app/assets/javascripts/user/app/controllers/application_controller.js.coffee b/app/assets/javascripts/user/app/controllers/application_controller.js.coffee index 3c855deb..2596b0bc 100644 --- a/app/assets/javascripts/user/app/controllers/application_controller.js.coffee +++ b/app/assets/javascripts/user/app/controllers/application_controller.js.coffee @@ -17,7 +17,26 @@ App.ApplicationController = Ember.Controller.extend list_needs_help: -> @set 'list.needs_help', true # incoming from other users list_is_paid: -> @set 'list.needs_payment', false list_needs_payment: -> @set 'list.needs_payment', true # incoming from other users + list_closed: -> @set 'list', null + join_request_approved: (data)-> + @setCurrentList -> @transitionToRoute('active_list') #getProducts: (options = {})-> #@store.find('product_category', options).then (product_categories)=> #@controllerFor('list_products').set 'model', product_categories + setCurrentList: (callback)-> + success = (list)=> + #@store.find('list', 'current').deleteRecord() # gets not replaced, buty stays as dummy + + # A list record with id current and with the content of the returned list is created + # at the moment remove the dummy list, this should be resolved by Ember eventually + if error_list = @store.all('list').findBy('id', 'current') + error_list.eraseRecord() + @set 'list', list + @controllerFor('active_list').set('model', list) + callback.call(@) if callback + error = (jqXHR)=> + # if jqXHR.status == 404 officially, now assume close list on error + #@redirect_to 'index', message: 'the_list_has_been_closed' + @set 'list', null + @store.find('list', 'current').then(success, error) diff --git a/app/assets/javascripts/user/app/controllers/product_orders_controller.js.coffee b/app/assets/javascripts/user/app/controllers/product_orders_controller.js.coffee index 7d4d9a26..9b362a7b 100644 --- a/app/assets/javascripts/user/app/controllers/product_orders_controller.js.coffee +++ b/app/assets/javascripts/user/app/controllers/product_orders_controller.js.coffee @@ -5,16 +5,18 @@ App.ProductOrdersController = Ember.ArrayController.extend ).property('model.@each.quantity') actions: clearProductOrders: -> - @store.all('product_order').toArray().invoke 'unloadRecord' + #TODO: make clearing of unpersisted product orders + @store.all('product_order').toArray().invoke 'eraseRecord' orderProducts: -> order = @store.createRecord('order', list: @get('controllers.application.list')) new_product_orders = @store.all('product_order').filterProperty('order', null) order.get('product_orders').pushObjects(new_product_orders) - order.save().then -> - # The new versions will be returned in the json response - #new_product_orders.invoke 'rollback' - #new_product_orders.invoke 'transitionTo', 'loaded.saved' - new_product_orders.invoke 'deleteRecord' + order.save().then (response)=> + debugger + new_product_orders.invoke 'eraseRecord' + .error (a,b,c)=> + d=a + debugger @transitionToRoute 'active_list' #orders = @store.all('product_order').toArray() @@ -31,4 +33,4 @@ App.ProductOrdersController = Ember.ArrayController.extend #orders.invoke 'unloadRecord' removeProductOrder: (product_order)-> - product_order.unloadRecord() + product_order.eraseRecord() diff --git a/app/assets/javascripts/user/app/controllers/select_qrcode_controller.js.coffee b/app/assets/javascripts/user/app/controllers/select_qrcode_controller.js.coffee index 88f17eec..25386566 100644 --- a/app/assets/javascripts/user/app/controllers/select_qrcode_controller.js.coffee +++ b/app/assets/javascripts/user/app/controllers/select_qrcode_controller.js.coffee @@ -7,10 +7,10 @@ App.SelectQrcodeController = Ember.Controller.extend if res.current_table_id if res.other_supplier @redirect_to 'user_root', message: 'table_is_from_other_supplier' - else if res.current_table_id == table.table_id + else if res.current_table_id == table._id #nothing has changed, show product list @redirect_to 'list_products' - else if res.current_table_id != table.table_id + else if res.current_table_id != table._id if res.occupied @redirect_to 'user_root', message: 'table_is_occupied' else if res.reserved @@ -35,9 +35,9 @@ App.SelectQrcodeController = Ember.Controller.extend @redirect_to 'list_products' else if res.occupied - @redirect_to 'join_occupied_table', {table_id: table.table_id} + @redirect_to 'join_occupied_table', {table_id: table._id} else if res.supplier_closed @redirect_to 'user_root', {message: 'supplier_is_closed'} else - #$.post(data_host + '/user/create_list.json', {table_id: table.table_id}, (res)-> Quser.handle_response(res)) - @redirect_to 'list_products_for_table', {table_id: table.table_id} + #$.post(data_host + '/user/create_list.json', {table_id: table._id}, (res)-> Quser.handle_response(res)) + @redirect_to 'table', table._id, a: 3 diff --git a/app/assets/javascripts/user/app/controllers/table_controller.js.coffee b/app/assets/javascripts/user/app/controllers/table_controller.js.coffee new file mode 100644 index 00000000..9c166bf6 --- /dev/null +++ b/app/assets/javascripts/user/app/controllers/table_controller.js.coffee @@ -0,0 +1,28 @@ +App.TableController = Ember.ObjectController.extend + join_request_sent: false + tableCanTakeOrders: (-> + return false unless @get('supplier.can_take_orders') + list = @get('controllers.application.list') + if list + return false unless list.get('supplier.id') == @get('supplier.id') + return false unless list.get('table.id') == @get('model.id') + true + else + # no list and open supplier + if @get('model.occupied') then false else true + ).property('controllers.application.list.id', 'supplier.can_take_orders', 'model.occupied', 'model.id', 'controllers.application.list.table.id') + showJoinButton: (-> + return false unless @get('supplier.can_take_orders') + return false if @get('controllers.application.list') # if you already have an active list, do not join another + if @get('model.occupied') then true else false + ).property('controllers.application.list.id', 'supplier.can_take_orders', 'model.occupied', 'model.id', 'controllers.application.list.table.id') + actions: + addProduct: (product)-> + if existing = @store.all('product_order').find((po)-> po.get('product') == product and not po.get('order')) + existing.increment() + else + @store.createRecord 'product_order', product: product + joinOccupiedTable: -> + #@secured => + $.post('/user/join_occupied_table.json', table_id: @get('model.id')) + @set 'join_request_sent', true diff --git a/app/assets/javascripts/user/app/models/list.js.coffee b/app/assets/javascripts/user/app/models/list.js.coffee index ba54d706..9e19c9cd 100644 --- a/app/assets/javascripts/user/app/models/list.js.coffee +++ b/app/assets/javascripts/user/app/models/list.js.coffee @@ -8,6 +8,10 @@ App.List = DS.Model.extend extended_version: attr('boolean') supplier_orders_in_process_count: attr('number') supplier_orders_placed_count: attr('number') + + supplier: DS.belongsTo('supplier') + table: DS.belongsTo('table') + total: (-> @get('orders').getEach('total').reduce(((sum, total) -> sum + total), 0) ).property('orders.@each.total') diff --git a/app/assets/javascripts/user/app/models/product_category.js.coffee b/app/assets/javascripts/user/app/models/product_category.js.coffee index 096bf301..a288dd22 100644 --- a/app/assets/javascripts/user/app/models/product_category.js.coffee +++ b/app/assets/javascripts/user/app/models/product_category.js.coffee @@ -2,3 +2,4 @@ attr = DS.attr App.ProductCategory = DS.Model.extend name: attr('string') products: DS.hasMany('product') + supplier: DS.belongsTo('supplier') diff --git a/app/assets/javascripts/user/app/models/product_order.js.coffee b/app/assets/javascripts/user/app/models/product_order.js.coffee index e4c0a49d..ee680168 100644 --- a/app/assets/javascripts/user/app/models/product_order.js.coffee +++ b/app/assets/javascripts/user/app/models/product_order.js.coffee @@ -2,6 +2,7 @@ attr = DS.attr App.ProductOrder = DS.Model.extend quantity: attr 'number', defaultValue: 1 product: DS.belongsTo('product') + product_name: attr('string') order: DS.belongsTo('order') placed: attr('boolean', defaultValue: false) increment: -> diff --git a/app/assets/javascripts/user/app/models/supplier.js.coffee b/app/assets/javascripts/user/app/models/supplier.js.coffee new file mode 100644 index 00000000..1f2585a3 --- /dev/null +++ b/app/assets/javascripts/user/app/models/supplier.js.coffee @@ -0,0 +1,20 @@ +attr = DS.attr +App.Supplier= DS.Model.extend + name: attr('string') + extended_version: attr('boolean') + open: attr('boolean') + orders_in_process_count: attr('number') + orders_placed_count: attr('number') + + orders: DS.hasMany('order') + product_categories: DS.hasMany('product_category') + + is_extended_version: -> + @get('extended_version') + + can_take_orders: (-> + return false unless @get('open') + true + ).property('open') + + diff --git a/app/assets/javascripts/user/app/models/table.js.coffee b/app/assets/javascripts/user/app/models/table.js.coffee new file mode 100644 index 00000000..4c476505 --- /dev/null +++ b/app/assets/javascripts/user/app/models/table.js.coffee @@ -0,0 +1,7 @@ +attr = DS.attr +App.Table= DS.Model.extend + number: attr('number') + needs_help: attr('boolean') + occupied: attr('boolean') + + supplier: DS.belongsTo('supplier') diff --git a/app/assets/javascripts/user/app/modifications/controller_modifications.js.coffee b/app/assets/javascripts/user/app/modifications/controller_modifications.js.coffee index 34d485e5..aed8e960 100644 --- a/app/assets/javascripts/user/app/modifications/controller_modifications.js.coffee +++ b/app/assets/javascripts/user/app/modifications/controller_modifications.js.coffee @@ -6,9 +6,20 @@ Ember.Controller.reopen @authentication_string = 'auth_token='+Qstorage.getItem('auth_token') @authentication_object = {auth_token: Qstorage.getItem('auth_token')} callback.call(@) if callback - redirect_to: (route, options={})-> + redirect_to: (route, args...)-> route = 'index' if route == 'user_root' - @transitionToRoute(route).then => + route_segments = App.Router.router.recognizer.names[route].segments + dynamic_segments = route_segments.reduce (sum, segment) -> + if segment.name then sum + 1 else sum + , 0 + route_args = [route] + for isegment in [1..dynamic_segments] + route_args.push args.shift() + + options = args.pop() || {} + + #route_args.push args if a + @transitionToRoute.apply(@,route_args).then => if options.message tkey = if options.message.indexOf('.') > -1 then options.message else "messages.#{options.message}" @set 'controllers.application.notice', t(tkey) @@ -26,7 +37,7 @@ Ember.Controller.reopen ##$('#confirm-modal').css('visibility', 'visible').show() showModal: (options={})-> #this.container.lookup('view:modal', {title:'Test title'}) - debugger + #debugger $(document).foundation('reflow') # needed (stupid!!!) @confirm_cancel = options.cancel @set 'controllers.application.modal.title', options.title if options.title @@ -48,3 +59,6 @@ Ember.ArrayController.reopen if options.message tkey = if options.message.indexOf('.') > -1 then options.message else "messages.#{options.message}" @set 'controllers.application.notice', t(tkey) + +Ember.ObjectController.reopen + needs: ['application'] diff --git a/app/assets/javascripts/user/app/modifications/model_modifications.js.coffee b/app/assets/javascripts/user/app/modifications/model_modifications.js.coffee new file mode 100644 index 00000000..bfd0bb96 --- /dev/null +++ b/app/assets/javascripts/user/app/modifications/model_modifications.js.coffee @@ -0,0 +1,6 @@ +DS.Model.reopen + created_at: DS.attr('date') + updated_at: DS.attr('date') + eraseRecord: -> + @clearRelationships(); + @transitionTo('deleted.saved'); diff --git a/app/assets/javascripts/user/app/router.js.coffee b/app/assets/javascripts/user/app/router.js.coffee index 86d51f32..6aac987f 100644 --- a/app/assets/javascripts/user/app/router.js.coffee +++ b/app/assets/javascripts/user/app/router.js.coffee @@ -9,6 +9,7 @@ App.Router.map -> @route 'obtain_token' @route 'active_list' @route 'list_products' - @route 'list_products_for_table' + @route 'list_products_for_table', path: '/list_products/:table_id' + @route 'table', path: '/tables/:table_id' @resource 'lists', -> @resource 'list', path: ':list_id' diff --git a/app/assets/javascripts/user/app/routes/active_list_route.js.coffee b/app/assets/javascripts/user/app/routes/active_list_route.js.coffee index 66972bda..d35c515e 100644 --- a/app/assets/javascripts/user/app/routes/active_list_route.js.coffee +++ b/app/assets/javascripts/user/app/routes/active_list_route.js.coffee @@ -1 +1,7 @@ -App.ActiveListRoute = Ember.Route.extend {} +App.ActiveListRoute = Ember.Route.extend + afterModel: (a,b,c)-> + controller = @controllerFor('application') + if table_id = controller.get('list.table.id') + transitionTo 'table', table_id + else + controller.redirect_to 'index', message: 'the_list_has_been_closed' diff --git a/app/assets/javascripts/user/app/routes/application_route.js.coffee b/app/assets/javascripts/user/app/routes/application_route.js.coffee index 7ef8b684..5bbd17d2 100644 --- a/app/assets/javascripts/user/app/routes/application_route.js.coffee +++ b/app/assets/javascripts/user/app/routes/application_route.js.coffee @@ -8,17 +8,7 @@ App.ApplicationRoute = Ember.Route.extend faye.subscribe "/user/"+user_id, (e)=> console.log e @events[e.event].call(@) if @events[e.event] - @store.find('list', 'current').then (list)=> - #@store.find('list', 'current').deleteRecord() # gets not replaced, buty stays as dummy - - # A list record with id current and with the content of the returned list is created - # at the moment remove the dummy list, this should be resolved by Ember eventually - if error_list = @store.all('list').findBy('id', 'current') - error_list.rollback() - error_list.transitionTo 'loaded.saved' - error_list.unloadRecord() - @set 'list', list - @controllerFor('active_list').set('model', list) + @setCurrentList() unauthorized: -> Qstorage.setItem('auth_token', '') diff --git a/app/assets/javascripts/user/app/store.js.coffee b/app/assets/javascripts/user/app/store.js.coffee index 0be80275..1e835d0e 100644 --- a/app/assets/javascripts/user/app/store.js.coffee +++ b/app/assets/javascripts/user/app/store.js.coffee @@ -25,10 +25,9 @@ DS.ActiveModelSerializer.reopen json[key].push item.serialize() else @_super record, json, relationship -DS.Model.reopen - created_at: DS.attr('date') - updated_at: DS.attr('date') + App.ApplicationSerializer = DS.ActiveModelSerializer + App.CustomAdapter = DS.RESTAdapter.extend # user underscored paths diff --git a/app/assets/javascripts/user/app/templates/list.emblem b/app/assets/javascripts/user/app/templates/list.emblem index 322db191..c8eb9ec1 100644 --- a/app/assets/javascripts/user/app/templates/list.emblem +++ b/app/assets/javascripts/user/app/templates/list.emblem @@ -2,7 +2,7 @@ h2=t 'models.list' p Hoi = controller - if model.extended_version + if model.is_extended_version h3 Extended else h3 Not extended diff --git a/app/assets/javascripts/user/app/templates/list_products_for_table.emblem b/app/assets/javascripts/user/app/templates/list_products_for_table.emblem index e15ea428..6083ae05 100644 --- a/app/assets/javascripts/user/app/templates/list_products_for_table.emblem +++ b/app/assets/javascripts/user/app/templates/list_products_for_table.emblem @@ -1,4 +1,5 @@ -.row +h2= List products for table +/.row .large-6.columns each product_category in controller hr diff --git a/app/assets/javascripts/user/app/templates/table.emblem b/app/assets/javascripts/user/app/templates/table.emblem new file mode 100644 index 00000000..7312e961 --- /dev/null +++ b/app/assets/javascripts/user/app/templates/table.emblem @@ -0,0 +1,37 @@ +.row + h2 + =t 'models.table' + | + = number + if showJoinButton + if join_request_sent + button.disabled + span.fa.fa-spinner.fa-spin.fa-lg + span Waiting for approval + else + button{action joinOccupiedTable} Join occupied table + if tableCanTakeOrders + .large-6.columns + each product_category in supplier.product_categories + if product_category.products + hr + h4= product_category.name + hr + ul.product_category-products + each product in product_category.products + li + a{action addProduct product}= product.name + span.right.currency=currency product.price + .large-6.columns= render 'product_orders' + else + .large12 + each product_category in supplier.product_categories + if product_category.products + hr + h4= product_category.name + hr + ul.product_category-products + each product in product_category.products + li + span= product.name + span.right.currency=currency product.price diff --git a/app/assets/javascripts/user/application.js.erb b/app/assets/javascripts/user/application.js.erb index 68b34f00..1118b1e3 100644 --- a/app/assets/javascripts/user/application.js.erb +++ b/app/assets/javascripts/user/application.js.erb @@ -196,6 +196,22 @@ $(function(){ Qstorage.removeItem('list_closed'); } setTranslations(); + $('#toggle-side-menu').click(function(){ + var body = $('body'); + var menu = $('#side-menu-container'); + if(menu.is(':visible')){ + body.animate({paddingLeft: 0}); + menu.animate({width: 0}, function(){$(this).hide()}); + + }else{ + body.animate({paddingLeft: '222px'}); + menu.show().animate({width: '222px'}); + } + //if(body.css('margin-left') && body.css('margin-left') != '0px'){ + // body.animate('margin-left', '0') + //}else{ + //} + }); }); function setLocale(locale){ Qstorage.setItem('locale', locale); diff --git a/app/assets/stylesheets/supplier/base1-shared/section_tables.css.sass b/app/assets/stylesheets/supplier/base1-shared/section_tables.css.sass index 6c28e265..40561bac 100644 --- a/app/assets/stylesheets/supplier/base1-shared/section_tables.css.sass +++ b/app/assets/stylesheets/supplier/base1-shared/section_tables.css.sass @@ -58,7 +58,7 @@ padding: 0 height: 400px //background-image: image-url('textures/wood4.jpg') - background-color: rgba(0,0,0,0.4) + //background-color: rgba(0,0,0,0.4) .section-table position: absolute cursor: pointer diff --git a/app/assets/stylesheets/supplier/basic1/structure.css.sass b/app/assets/stylesheets/supplier/basic1/structure.css.sass index 67a5dc37..44150087 100644 --- a/app/assets/stylesheets/supplier/basic1/structure.css.sass +++ b/app/assets/stylesheets/supplier/basic1/structure.css.sass @@ -2,6 +2,7 @@ $side-spacing: 0px @import constants html body + padding-top: 42px padding-left: $side-spacing padding-right: $side-spacing background-color: transparent diff --git a/app/assets/stylesheets/supplier/wood1/darkstrap.sass b/app/assets/stylesheets/supplier/wood1/darkstrap.sass index 5be04f3f..63513bbf 100644 --- a/app/assets/stylesheets/supplier/wood1/darkstrap.sass +++ b/app/assets/stylesheets/supplier/wood1/darkstrap.sass @@ -35,7 +35,16 @@ $input-color: white //=General ======================================== // Everything with the inset panel just extends .well .well - +inset-panel-dark + //+inset-panel-dark + background-color: rgba(255,255,255,0.8) + h1,h2,h3,h4,h5,h6,a + color: #333 + .table + thead + color: #111 + td + border-top-color: #aaa + color: #111 body background: $bg diff --git a/app/assets/stylesheets/supplier/wood1/section_tables.css.sass b/app/assets/stylesheets/supplier/wood1/section_tables.css.sass index ca3cf4b8..0f1d9217 100644 --- a/app/assets/stylesheets/supplier/wood1/section_tables.css.sass +++ b/app/assets/stylesheets/supplier/wood1/section_tables.css.sass @@ -51,7 +51,7 @@ padding: 0 height: 400px //background-image: image-url('textures/wood4.jpg') - background-color: rgba(0,0,0,0.4) + //background-color: rgba(0,0,0,0.4) .section-table position: absolute cursor: pointer diff --git a/app/assets/stylesheets/supplier/wood1/structure.css.sass b/app/assets/stylesheets/supplier/wood1/structure.css.sass index ce71fe85..992ae604 100644 --- a/app/assets/stylesheets/supplier/wood1/structure.css.sass +++ b/app/assets/stylesheets/supplier/wood1/structure.css.sass @@ -4,6 +4,7 @@ html background-image: $wood background-color: $background-brown body + padding-top: 42px padding-left: $side-spacing padding-right: $side-spacing background-color: transparent diff --git a/app/assets/stylesheets/twitter-bootstrap/bootstrap_and_overrides.css.sass b/app/assets/stylesheets/twitter-bootstrap/bootstrap_and_overrides.css.sass index dddd219a..ac3c6b1c 100644 --- a/app/assets/stylesheets/twitter-bootstrap/bootstrap_and_overrides.css.sass +++ b/app/assets/stylesheets/twitter-bootstrap/bootstrap_and_overrides.css.sass @@ -1,6 +1,6 @@ @import "bootstrap" body - padding-top: 42px + //padding-top: 42px .table &.table-condensed margin-bottom: 5px diff --git a/app/assets/stylesheets/user/foundation/application.css.sass b/app/assets/stylesheets/user/foundation/application.css.sass index ed4e9646..0662c2b8 100644 --- a/app/assets/stylesheets/user/foundation/application.css.sass +++ b/app/assets/stylesheets/user/foundation/application.css.sass @@ -1,3 +1,3 @@ -//= require foundation +//= require ./foundation_and_overrides //= require font-awesome //= require_directory . diff --git a/app/assets/stylesheets/user/foundation/foundation_and_overrides.css.sass b/app/assets/stylesheets/user/foundation/foundation_and_overrides.css.sass new file mode 100644 index 00000000..a1a587d5 --- /dev/null +++ b/app/assets/stylesheets/user/foundation/foundation_and_overrides.css.sass @@ -0,0 +1,1242 @@ +// Foundation by ZURB +// foundation.zurb.com +// Licensed under MIT Open Source + +// +// FOUNDATION SETTINGS +// + +// This is the default html and body font-size for the base rem value. +// $rem-base: 16px; + +// Allows the use of rem-calc() or lower-bound() in your settings +@import "foundation/functions" + +// $experimental: true; + +// The default font-size is set to 100% of the browser style sheet (usually 16px) +// for compatibility with browser-based text zoom or user-set defaults. + +// Since the typical default browser font-size is 16px, that makes the calculation for grid size. +// If you want your base font-size to be different and not have it affect the grid breakpoints, +// set $rem-base to $base-font-size and make sure $base-font-size is a px value. +// $base-font-size: 100%; + +// The $base-line-height is 100% while $base-font-size is 150% +// $base-line-height: 150%; + +// We use this to control whether or not CSS classes come through in the gem files. +// $include-html-classes: true; +// $include-print-styles: true; +// $include-html-global-classes: $include-html-classes; + +// Grid + +// $include-html-grid-classes: $include-html-classes; +// $include-xl-html-grid-classes: false; + +// $row-width: rem-calc(1000); +// $column-gutter: rem-calc(30); +// $total-columns: 12; + +// We use these to control various global styles +// $body-bg: #fff; +// $body-font-color: #222; +// $body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; +// $body-font-weight: normal; +// $body-font-style: normal; + +// We use this to control font-smoothing +// $font-smoothing: antialiased; + +// We use these to control text direction settings +// $text-direction: ltr; +// $opposite-direction: right; +// $default-float: left; + +// We use these as default colors throughout +// $primary-color: #008CBA; +$primary-color: green +// $secondary-color: #e7e7e7; +// $alert-color: #f04124; +// $success-color: #43AC6A; +// $warning-color: #f08a24; +// $info-color: #a0d3e8; + +// We use these to make sure border radius matches unless we want it different. +// $global-radius: 3px; +// $global-rounded: 1000px; + +// We use these to control inset shadow shiny edges and depressions. +// $shiny-edge-size: 0 1px 0; +// $shiny-edge-color: rgba(#fff, .5); +// $shiny-edge-active-color: rgba(#000, .2); + +// Media Query Ranges +// $small-range: (0em, 40em); +// $medium-range: (40.063em, 64em); +// $large-range: (64.063em, 90em); +// $xlarge-range: (90.063em, 120em); +// $xxlarge-range: (120.063em); + +// $screen: "only screen"; + +// $landscape: "#{$screen} and (orientation: landscape)"; +// $portrait: "#{$screen} and (orientation: portrait)"; + +// $small-up: $screen; +// $small-only: "#{$screen} and (max-width: #{upper-bound($small-range)})"; + +// $medium-up: "#{$screen} and (min-width:#{lower-bound($medium-range)})"; +// $medium-only: "#{$screen} and (min-width:#{lower-bound($medium-range)}) and (max-width:#{upper-bound($medium-range)})"; + +// $large-up: "#{$screen} and (min-width:#{lower-bound($large-range)})"; +// $large-only: "#{$screen} and (min-width:#{lower-bound($large-range)}) and (max-width:#{upper-bound($large-range)})"; + +// $xlarge-up: "#{$screen} and (min-width:#{lower-bound($xlarge-range)})"; +// $xlarge-only: "#{$screen} and (min-width:#{lower-bound($xlarge-range)}) and (max-width:#{upper-bound($xlarge-range)})"; + +// $xxlarge-up: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)})"; +// $xxlarge-only: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)}) and (max-width:#{upper-bound($xxlarge-range)})"; + +// Legacy +// $small: $medium-up; +// $medium: $medium-up; +// $large: $large-up; + +//We use this as cursors values for enabling the option of having custom cursors in the whole site's stylesheet +// $cursor-crosshair-value: crosshair; +// $cursor-default-value: default; +// $cursor-pointer-value: pointer; +// $cursor-help-value: help; +// $cursor-text-value: text; + +// +// TYPOGRAPHY +// + +// $include-html-type-classes: $include-html-classes; + +// We use these to control header font styles +// $header-font-family: $body-font-family; +// $header-font-weight: normal; +// $header-font-style: normal; +// $header-font-color: #222; +// $header-line-height: 1.4; +// $header-top-margin: .2rem; +// $header-bottom-margin: .5rem; +// $header-text-rendering: optimizeLegibility; + +// We use these to control header font sizes +// $h1-font-size: rem-calc(44); +// $h2-font-size: rem-calc(37); +// $h3-font-size: rem-calc(27); +// $h4-font-size: rem-calc(23); +// $h5-font-size: rem-calc(18); +// $h6-font-size: 1rem; + +// These control how subheaders are styled. +// $subheader-line-height: 1.4; +// $subheader-font-color: scale-color($header-font-color, $lightness: 35%); +// $subheader-font-weight: 300; +// $subheader-top-margin: .2rem; +// $subheader-bottom-margin: .5rem; + +// A general styling +// $small-font-size: 60%; +// $small-font-color: scale-color($header-font-color, $lightness: 35%); + +// We use these to style paragraphs +// $paragraph-font-family: inherit; +// $paragraph-font-weight: normal; +// $paragraph-font-size: 1rem; +// $paragraph-line-height: 1.6; +// $paragraph-margin-bottom: rem-calc(20); +// $paragraph-aside-font-size: rem-calc(14); +// $paragraph-aside-line-height: 1.35; +// $paragraph-aside-font-style: italic; +// $paragraph-text-rendering: optimizeLegibility; + +// We use these to style tags +// $code-color: scale-color($alert-color, $lightness: -27%); +// $code-font-family: Consolas, 'Liberation Mono', Courier, monospace; +// $code-font-weight: bold; + +// We use these to style anchors +// $anchor-text-decoration: none; +// $anchor-font-color: $primary-color; +// $anchor-font-color-hover: scale-color($primary-color, $lightness: -14%); + +// We use these to style the
element +// $hr-border-width: 1px; +// $hr-border-style: solid; +// $hr-border-color: #ddd; +// $hr-margin: rem-calc(20); + +// We use these to style lists +// $list-style-position: outside; +// $list-side-margin: 1.1rem; +// $list-ordered-side-margin: 1.4rem; +// $list-side-margin-no-bullet: 0; +// $list-nested-margin: rem-calc(20); +// $definition-list-header-weight: bold; +// $definition-list-header-margin-bottom: .3rem; +// $definition-list-margin-bottom: rem-calc(12); + +// We use these to style blockquotes +// $blockquote-font-color: scale-color($header-font-color, $lightness: 35%); +// $blockquote-padding: rem-calc(9 20 0 19); +// $blockquote-border: 1px solid #ddd; +// $blockquote-cite-font-size: rem-calc(13); +// $blockquote-cite-font-color: scale-color($header-font-color, $lightness: 23%); +// $blockquote-cite-link-color: $blockquote-cite-font-color; + +// Acronym styles +// $acronym-underline: 1px dotted #ddd; + +// We use these to control padding and margin +// $microformat-padding: rem-calc(10 12); +// $microformat-margin: rem-calc(0 0 20 0); + +// We use these to control the border styles +// $microformat-border-width: 1px; +// $microformat-border-style: solid; +// $microformat-border-color: #ddd; + +// We use these to control full name font styles +// $microformat-fullname-font-weight: bold; +// $microformat-fullname-font-size: rem-calc(15); + +// We use this to control the summary font styles +// $microformat-summary-font-weight: bold; + +// We use this to control abbr padding +// $microformat-abbr-padding: rem-calc(0 1); + +// We use this to control abbr font styles +// $microformat-abbr-font-weight: bold; +// $microformat-abbr-font-decoration: none; + +// Accordion + +// $include-html-accordion-classes: $include-html-classes; + +// $accordion-navigation-padding: rem-calc(16); +// $accordion-navigation-bg-color: #efefef ; +// $accordion-navigation-hover-bg-color: scale-color($accordion-navigation-bg-color, $lightness: -5%); +// $accordion-navigation-active-bg-color: scale-color($accordion-navigation-bg-color, $lightness: -3%); +// $accordion-navigation-font-color: #222; +// $accordion-navigation-font-size: rem-calc(16); +// $accordion-navigation-font-family: $body-font-family; + +// $accordion-content-padding: $column-gutter/2; +// $accordion-content-active-bg-color: #fff; + +// Alert Boxes + +// $include-html-alert-classes: $include-html-classes; + +// We use this to control alert padding. +// $alert-padding-top: rem-calc(14); +// $alert-padding-default-float: $alert-padding-top; +// $alert-padding-opposite-direction: $alert-padding-top + rem-calc(10); +// $alert-padding-bottom: $alert-padding-top; + +// We use these to control text style. +// $alert-font-weight: normal; +// $alert-font-size: rem-calc(13); +// $alert-font-color: #fff; +// $alert-font-color-alt: scale-color($secondary-color, $lightness: -66%); + +// We use this for close hover effect. +// $alert-function-factor: -14%; + +// We use these to control border styles. +// $alert-border-style: solid; +// $alert-border-width: 1px; +// $alert-border-color: scale-color($primary-color, $lightness: $alert-function-factor); +// $alert-bottom-margin: rem-calc(20); + +// We use these to style the close buttons +// $alert-close-color: #333; +// $alert-close-top: 50%; +// $alert-close-position: rem-calc(5); +// $alert-close-font-size: rem-calc(22); +// $alert-close-opacity: 0.3; +// $alert-close-opacity-hover: 0.5; +// $alert-close-padding: 9px 6px 4px; + +// We use this to control border radius +// $alert-radius: $global-radius; + +// Block Grid + +// $include-html-grid-classes: $include-html-classes; + +// We use this to control the maximum number of block grid elements per row +// $block-grid-elements: 12; +// $block-grid-default-spacing: rem-calc(20); +// $align-block-grid-to-grid: true; + +// Enables media queries for block-grid classes. Set to false if writing semantic HTML. +// $block-grid-media-queries: true; + +// Breadcrumbs + +// $include-html-nav-classes: $include-html-classes; + +// We use this to set the background color for the breadcrumb container. +// $crumb-bg: scale-color($secondary-color, $lightness: 55%); + +// We use these to set the padding around the breadcrumbs. +// $crumb-padding: rem-calc(9 14 9); +// $crumb-side-padding: rem-calc(12); + +// We use these to control border styles. +// $crumb-function-factor: -10%; +// $crumb-border-size: 1px; +// $crumb-border-style: solid; +// $crumb-border-color: scale-color($crumb-bg, $lightness: $crumb-function-factor); +// $crumb-radius: $global-radius; + +// We use these to set various text styles for breadcrumbs. +// $crumb-font-size: rem-calc(11); +// $crumb-font-color: $primary-color; +// $crumb-font-color-current: #333; +// $crumb-font-color-unavailable: #999; +// $crumb-font-transform: uppercase; +// $crumb-link-decor: underline; + +// We use these to control the slash between breadcrumbs +// $crumb-slash-color: #aaa; +// $crumb-slash: "/"; + +// +// BUTTONS +// + +// $include-html-button-classes: $include-html-classes; + +// We use these to build padding for buttons. +// $button-tny: rem-calc(10); +// $button-sml: rem-calc(14); +// $button-med: rem-calc(16); +// $button-lrg: rem-calc(18); + +// We use this to control the display property. +// $button-display: inline-block; +// $button-margin-bottom: rem-calc(20); + +// We use these to control button text styles. +// $button-font-family: $body-font-family; +// $button-font-color: #fff; +// $button-font-color-alt: #333; +// $button-font-tny: rem-calc(11); +// $button-font-sml: rem-calc(13); +// $button-font-med: rem-calc(16); +// $button-font-lrg: rem-calc(20); +// $button-font-weight: normal; +// $button-font-align: center; + +// We use these to control various hover effects. +// $button-function-factor: 5%; + +// We use these to control button border styles. +// $button-border-width: 1px; +// $button-border-style: solid; + +// We use this to set the default radius used throughout the core. +// $button-radius: $global-radius; +// $button-round: $global-rounded; + +// We use this to set default opacity for disabled buttons. +// $button-disabled-opacity: 0.7; + +// Button Groups + +// $include-html-button-classes: $include-html-classes; + +// Sets the margin for the right side by default, and the left margin if right-to-left direction is used +// $button-bar-margin-opposite: rem-calc(10); +// $button-group-border-width: 1px; + +// Clearing + +// $include-html-clearing-classes: $include-html-classes; + +// We use these to set the background colors for parts of Clearing. +// $clearing-bg: #333; +// $clearing-caption-bg: $clearing-bg; +// $clearing-carousel-bg: rgba (51,51,51,0.8); +// $clearing-img-bg: $clearing-bg; + +// We use these to style the close button +// $clearing-close-color: #ccc; +// $clearing-close-size: 30px; + +// We use these to style the arrows +// $clearing-arrow-size: 12px; +// $clearing-arrow-color: $clearing-close-color; + +// We use these to style captions +// $clearing-caption-font-color: #ccc; +// $clearing-caption-font-size: 0.875em; +// $clearing-caption-padding: 10px 30px 20px; + +// We use these to make the image and carousel height and style +// $clearing-active-img-height: 85%; +// $clearing-carousel-height: 120px; +// $clearing-carousel-thumb-width: 120px; +// $clearing-carousel-thumb-active-border: 1px solid rgb(255,255,255); + +// Dropdown + +// $include-html-dropdown-classes: $include-html-classes; + +// We use these to controls height and width styles. +// $f-dropdown-max-width: 200px; +// $f-dropdown-height: auto; +// $f-dropdown-max-height: none; +// $f-dropdown-margin-top: 2px; + +// We use this to control the background color +// $f-dropdown-bg: #fff; + +// We use this to set the border styles for dropdowns. +// $f-dropdown-border-style: solid; +// $f-dropdown-border-width: 1px; +// $f-dropdown-border-color: scale-color(#fff, $lightness: -20%); + +// We use these to style the triangle pip. +// $f-dropdown-triangle-size: 6px; +// $f-dropdown-triangle-color: #fff; +// $f-dropdown-triangle-side-offset: 10px; + +// We use these to control styles for the list elements. +// $f-dropdown-list-style: none; +// $f-dropdown-font-color: #555; +// $f-dropdown-font-size: rem-calc(14); +// $f-dropdown-list-padding: rem-calc(5, 10); +// $f-dropdown-line-height: rem-calc(18); +// $f-dropdown-list-hover-bg: #eeeeee ; +// $dropdown-mobile-default-float: 0; + +// We use this to control the styles for when the dropdown has custom content. +// $f-dropdown-content-padding: rem-calc(20); + +// Dropdown Buttons + +// $include-html-button-classes: $include-html-classes; + +// We use these to set the color of the pip in dropdown buttons +// $dropdown-button-pip-color: #fff; +// $dropdown-button-pip-color-alt: #333; + +// $button-pip-tny: rem-calc(6); +// $button-pip-sml: rem-calc(7); +// $button-pip-med: rem-calc(9); +// $button-pip-lrg: rem-calc(11); + +// We use these to style tiny dropdown buttons +// $dropdown-button-padding-tny: $button-pip-tny * 7; +// $dropdown-button-pip-size-tny: $button-pip-tny; +// $dropdown-button-pip-opposite-tny: $button-pip-tny * 3; +// $dropdown-button-pip-top-tny: -$button-pip-tny / 2 + rem-calc(1); + +// We use these to style small dropdown buttons +// $dropdown-button-padding-sml: $button-pip-sml * 7; +// $dropdown-button-pip-size-sml: $button-pip-sml; +// $dropdown-button-pip-opposite-sml: $button-pip-sml * 3; +// $dropdown-button-pip-top-sml: -$button-pip-sml / 2 + rem-calc(1); + +// We use these to style medium dropdown buttons +// $dropdown-button-padding-med: $button-pip-med * 6 + rem-calc(3); +// $dropdown-button-pip-size-med: $button-pip-med - rem-calc(3); +// $dropdown-button-pip-opposite-med: $button-pip-med * 2.5; +// $dropdown-button-pip-top-med: -$button-pip-med / 2 + rem-calc(2); + +// We use these to style large dropdown buttons +// $dropdown-button-padding-lrg: $button-pip-lrg * 5 + rem-calc(3); +// $dropdown-button-pip-size-lrg: $button-pip-lrg - rem-calc(6); +// $dropdown-button-pip-opposite-lrg: $button-pip-lrg * 2.5; +// $dropdown-button-pip-top-lrg: -$button-pip-lrg / 2 + rem-calc(3); + +// Flex Video + +// $include-html-media-classes: $include-html-classes; + +// We use these to control video container padding and margins +// $flex-video-padding-top: rem-calc(25); +// $flex-video-padding-bottom: 67.5%; +// $flex-video-margin-bottom: rem-calc(16); + +// We use this to control widescreen bottom padding +// $flex-video-widescreen-padding-bottom: 57.25%; + +// Forms + +// $include-html-form-classes: $include-html-classes; + +// We use this to set the base for lots of form spacing and positioning styles +// $form-spacing: rem-calc(16); + +// We use these to style the labels in different ways +// $form-label-pointer: pointer; +// $form-label-font-size: rem-calc(14); +// $form-label-font-weight: normal; +// $form-label-line-height: 1.5; +// $form-label-font-color: scale-color(#000, $lightness: 30%); +// $form-label-bottom-margin: 0; +// $input-font-family: inherit; +// $input-font-color: rgba(0,0,0,0.75); +// $input-font-size: rem-calc(14); +// $input-bg-color: #fff; +// $input-focus-bg-color: scale-color(#fff, $lightness: -2%); +// $input-border-color: scale-color(#fff, $lightness: -20%); +// $input-focus-border-color: scale-color(#fff, $lightness: -40%); +// $input-border-style: solid; +// $input-border-width: 1px; +// $input-border-radius: $global-radius; +// $input-disabled-bg: #ddd; +// $input-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); +// $input-include-glowing-effect: true; + +// We use these to style the fieldset border and spacing. +// $fieldset-border-style: solid; +// $fieldset-border-width: 1px; +// $fieldset-border-color: #ddd; +// $fieldset-padding: rem-calc(20); +// $fieldset-margin: rem-calc(18 0); + +// We use these to style the legends when you use them +// $legend-bg: #fff; +// $legend-font-weight: bold; +// $legend-padding: rem-calc(0 3); + +// We use these to style the prefix and postfix input elements +// $input-prefix-bg: scale-color(#fff, $lightness: -5%); +// $input-prefix-border-color: scale-color(#fff, $lightness: -20%); +// $input-prefix-border-size: 1px; +// $input-prefix-border-type: solid; +// $input-prefix-overflow: hidden; +// $input-prefix-font-color: #333; +// $input-prefix-font-color-alt: #fff; + +// We use these to style the error states for inputs and labels +// $input-error-message-padding: rem-calc(6 9 9); +// $input-error-message-top: -1px; +// $input-error-message-font-size: rem-calc(12); +// $input-error-message-font-weight: normal; +// $input-error-message-font-style: italic; +// $input-error-message-font-color: #fff; +// $input-error-message-font-color-alt: #333; + +// We use this to style the glowing effect of inputs when focused +// $glowing-effect-fade-time: 0.45s; +// $glowing-effect-color: $input-focus-border-color; + +// Select variables +// $select-bg-color: #fafafa; + +// Inline Lists + +// $include-html-inline-list-classes: $include-html-classes; + +// We use this to control the margins and padding of the inline list. +// $inline-list-top-margin: 0; +// $inline-list-opposite-margin: 0; +// $inline-list-bottom-margin: rem-calc(17); +// $inline-list-default-float-margin: rem-calc(-22); + +// $inline-list-padding: 0; + +// We use this to control the overflow of the inline list. +// $inline-list-overflow: hidden; + +// We use this to control the list items +// $inline-list-display: block; + +// We use this to control any elments within list items +// $inline-list-children-display: block; + +// Joyride + +// $include-html-joyride-classes: $include-html-classes; + +// Controlling default Joyride styles +// $joyride-tip-bg: #333; +// $joyride-tip-default-width: 300px; +// $joyride-tip-padding: rem-calc(18 20 24); +// $joyride-tip-border: solid 1px #555; +// $joyride-tip-radius: 4px; +// $joyride-tip-position-offset: 22px; + +// Here, we're setting the tip dont styles +// $joyride-tip-font-color: #fff; +// $joyride-tip-font-size: rem-calc(14); +// $joyride-tip-header-weight: bold; + +// This changes the nub size +// $joyride-tip-nub-size: 10px; + +// This adjusts the styles for the timer when its enabled +// $joyride-tip-timer-width: 50px; +// $joyride-tip-timer-height: 3px; +// $joyride-tip-timer-color: #666; + +// This changes up the styles for the close button +// $joyride-tip-close-color: #777; +// $joyride-tip-close-size: 24px; +// $joyride-tip-close-weight: normal; + +// When Joyride is filling the screen, we use this style for the bg +// $joyride-screenfill: rgba(0,0,0,0.5); + +// Keystrokes + +// $include-html-keystroke-classes: $include-html-classes; + +// We use these to control text styles. +// $keystroke-font: "Consolas", "Menlo", "Courier", monospace; +// $keystroke-font-size: rem-calc(14); +// $keystroke-font-color: #222; +// $keystroke-font-color-alt: #fff; +// $keystroke-function-factor: -7%; + +// We use this to control keystroke padding. +// $keystroke-padding: rem-calc(2 4 0); + +// We use these to control background and border styles. +// $keystroke-bg: scale-color(#fff, $lightness: $keystroke-function-factor); +// $keystroke-border-style: solid; +// $keystroke-border-width: 1px; +// $keystroke-border-color: scale-color($keystroke-bg, $lightness: $keystroke-function-factor); +// $keystroke-radius: $global-radius; + +// Labels + +// $include-html-label-classes: $include-html-classes; + +// We use these to style the labels +// $label-padding: rem-calc(4 8 6); +// $label-radius: $global-radius; + +// We use these to style the label text +// $label-font-sizing: rem-calc(11); +// $label-font-weight: normal; +// $label-font-color: #333; +// $label-font-color-alt: #fff; +// $label-font-family: $body-font-family; + +// Magellan + +// $include-html-magellan-classes: $include-html-classes; + +// $magellan-bg: #fff; +// $magellan-padding: 10px; + +// Off-canvas + +// $tabbar-bg: #333; +// $tabbar-height: rem-calc(45); +// $tabbar-line-height: $tabbar-height; +// $tabbar-color: #FFF; +// $tabbar-middle-padding: 0 rem-calc(10); + +// Off Canvas Divider Styles +// $tabbar-right-section-border: solid 1px scale-color($tabbar-bg, $lightness: 13%); +// $tabbar-left-section-border: solid 1px scale-color($tabbar-bg, $lightness: -50%); + +// Off Canvas Tab Bar Headers +// $tabbar-header-color: #FFF; +// $tabbar-header-weight: bold; +// $tabbar-header-line-height: $tabbar-height; +// $tabbar-header-margin: 0; + +// Off Canvas Menu Variables +// $off-canvas-width: 250px; +// $off-canvas-bg: #333; + +// Off Canvas Menu List Variables +// $off-canvas-label-padding: 0.3rem rem-calc(15); +// $off-canvas-label-color: #999; +// $off-canvas-label-text-transform: uppercase; +// $off-canvas-label-font-weight: bold; +// $off-canvas-label-bg: #444; +// $off-canvas-label-border-top: 1px solid scale-color(#444, $lightness: 14%); +// $off-canvas-label-border-bottom: none; +// $off-canvas-label-margin:0; +// $off-canvas-link-padding: rem-calc(10, 15); +// $off-canvas-link-color: rgba(#FFF, 0.7); +// $off-canvas-link-border-bottom: 1px solid scale-color($off-canvas-bg, $lightness: -25%); + +// Off Canvas Menu Icon Variables +// $tabbar-menu-icon-color: #FFF; +// $tabbar-menu-icon-hover: scale-color($tabbar-menu-icon-color, $lightness: -30%); + +// $tabbar-menu-icon-text-indent: rem-calc(35); +// $tabbar-menu-icon-width: $tabbar-height; +// $tabbar-menu-icon-height: $tabbar-height; +// $tabbar-menu-icon-line-height: rem-calc(33); +// $tabbar-menu-icon-padding: 0; + +// $tabbar-hamburger-icon-width: rem-calc(16); +// $tabbar-hamburger-icon-left: false; +// $tabbar-hamburger-icon-top: false; +// $tapbar-hamburger-icon-thickness: 1px; +// $tapbar-hamburger-icon-gap: 6px; + +// Off Canvas Back-Link Overlay +// $off-canvas-overlay-transition: background 300ms ease; +// $off-canvas-overlay-cursor: pointer; +// $off-canvas-overlay-box-shadow: -4px 0 4px rgba(#000, 0.5), 4px 0 4px rgba(#000, 0.5); +// $off-canvas-overlay-background: rgba(#FFF, 0.2); +// $off-canvas-overlay-background-hover: rgba(#FFF, 0.05); + +// Transition Variables +// $menu-slide: "transform 500ms ease"; + +// Orbit + +// $include-html-orbit-classes: $include-html-classes; + +// We use these to control the caption styles +// $orbit-container-bg: none; +// $orbit-caption-bg: rgba(51,51,51, 0.8); +// $orbit-caption-font-color: #fff; +// $orbit-caption-font-size: rem-calc(14); +// $orbit-caption-position: "bottom"; // Supported values: "bottom", "under" +// $orbit-caption-padding: rem-calc(10 14); +// $orbit-caption-height: auto; + +// We use these to control the left/right nav styles +// $orbit-nav-bg: none; +// $orbit-nav-bg-hover: rgba(0,0,0,0.3); +// $orbit-nav-arrow-color: #fff; +// $orbit-nav-arrow-color-hover: #fff; + +// We use these to control the timer styles +// $orbit-timer-bg: rgba(255,255,255,0.3); +// $orbit-timer-show-progress-bar: true; + +// We use these to control the bullet nav styles +// $orbit-bullet-nav-color: #ccc; +// $orbit-bullet-nav-color-active: #999; +// $orbit-bullet-radius: rem-calc(9); + +// We use these to controls the style of slide numbers +// $orbit-slide-number-bg: rgba(0,0,0,0); +// $orbit-slide-number-font-color: #fff; +// $orbit-slide-number-padding: rem-calc(5); + +// Graceful Loading Wrapper and preloader +// $wrapper-class: "slideshow-wrapper"; +// $preloader-class: "preloader"; + +// Pagination + +// $include-html-nav-classes: $include-html-classes; + +// We use these to control the pagination container +// $pagination-height: rem-calc(24); +// $pagination-margin: rem-calc(-5); + +// We use these to set the list-item properties +// $pagination-li-float: $default-float; +// $pagination-li-height: rem-calc(24); +// $pagination-li-font-color: #222; +// $pagination-li-font-size: rem-calc(14); +// $pagination-li-margin: rem-calc(5); + +// We use these for the pagination anchor links +// $pagination-link-pad: rem-calc(1 10 1); +// $pagination-link-font-color: #999; +// $pagination-link-active-bg: scale-color(#fff, $lightness: -10%); + +// We use these for disabled anchor links +// $pagination-link-unavailable-cursor: default; +// $pagination-link-unavailable-font-color: #999; +// $pagination-link-unavailable-bg-active: transparent; + +// We use these for currently selected anchor links +// $pagination-link-current-background: $primary-color; +// $pagination-link-current-font-color: #fff; +// $pagination-link-current-font-weight: bold; +// $pagination-link-current-cursor: default; +// $pagination-link-current-active-bg: $primary-color; + +// Panels + +// $include-html-panel-classes: $include-html-classes; + +// We use these to control the background and border styles +// $panel-bg: scale-color(#fff, $lightness: -5%); +// $panel-border-style: solid; +// $panel-border-size: 1px; + +// We use this % to control how much we darken things on hover +// $panel-function-factor: -11%; +// $panel-border-color: scale-color($panel-bg, $lightness: $panel-function-factor); + +// We use these to set default inner padding and bottom margin +// $panel-margin-bottom: rem-calc(20); +// $panel-padding: rem-calc(20); + +// We use these to set default font colors +// $panel-font-color: #333; +// $panel-font-color-alt: #fff; + +// $panel-header-adjust: true; +// $callout-panel-link-color: $primary-color; + +// Pricing Tables + +// $include-html-pricing-classes: $include-html-classes; + +// We use this to control the border color +// $price-table-border: solid 1px #ddd; + +// We use this to control the bottom margin of the pricing table +// $price-table-margin-bottom: rem-calc(20); + +// We use these to control the title styles +// $price-title-bg: #333; +// $price-title-padding: rem-calc(15 20); +// $price-title-align: center; +// $price-title-color: #eee; +// $price-title-weight: normal; +// $price-title-size: rem-calc(16); +// $price-title-font-family: $body-font-family; + +// We use these to control the price styles +// $price-money-bg: #f6f6f6 ; +// $price-money-padding: rem-calc(15 20); +// $price-money-align: center; +// $price-money-color: #333; +// $price-money-weight: normal; +// $price-money-size: rem-calc(32); +// $price-money-font-family: $body-font-family; + + +// We use these to control the description styles +// $price-bg: #fff; +// $price-desc-color: #777; +// $price-desc-padding: rem-calc(15); +// $price-desc-align: center; +// $price-desc-font-size: rem-calc(12); +// $price-desc-weight: normal; +// $price-desc-line-height: 1.4; +// $price-desc-bottom-border: dotted 1px #ddd; + +// We use these to control the list item styles +// $price-item-color: #333; +// $price-item-padding: rem-calc(15); +// $price-item-align: center; +// $price-item-font-size: rem-calc(14); +// $price-item-weight: normal; +// $price-item-bottom-border: dotted 1px #ddd; + +// We use these to control the CTA area styles +// $price-cta-bg: #fff; +// $price-cta-align: center; +// $price-cta-padding: rem-calc(20 20 0); + +// Progress Meters + +// $include-html-media-classes: $include-html-classes; + +// We use this to se the prog bar height +// $progress-bar-height: rem-calc(25); +// $progress-bar-color: #f6f6f6 ; + +// We use these to control the border styles +// $progress-bar-border-color: scale-color(#fff, $lightness: -20%); +// $progress-bar-border-size: 1px; +// $progress-bar-border-style: solid; +// $progress-bar-border-radius: $global-radius; + +// We use these to control the margin & padding +// $progress-bar-pad: rem-calc(2); +// $progress-bar-margin-bottom: rem-calc(10); + +// We use these to set the meter colors +// $progress-meter-color: $primary-color; +// $progress-meter-secondary-color: $secondary-color; +// $progress-meter-success-color: $success-color; +// $progress-meter-alert-color: $alert-color; + +// Reveal + +// $include-html-reveal-classes: $include-html-classes; + +// We use these to control the style of the reveal overlay. +// $reveal-overlay-bg: rgba(#000, .45); +// $reveal-overlay-bg-old: #000; + +// We use these to control the style of the modal itself. +// $reveal-modal-bg: #fff; +// $reveal-position-top: 50px; +// $reveal-default-width: 80%; +// $reveal-modal-padding: rem-calc(20); +// $reveal-box-shadow: 0 0 10px rgba(#000,.4); + +// We use these to style the reveal close button +// $reveal-close-font-size: rem-calc(22); +// $reveal-close-top: rem-calc(8); +// $reveal-close-side: rem-calc(11); +// $reveal-close-color: #aaa; +// $reveal-close-weight: bold; + +// We use these to control the modal border +// $reveal-border-style: solid; +// $reveal-border-width: 1px; +// $reveal-border-color: #666; + +// $reveal-modal-class: "reveal-modal"; +// $close-reveal-modal-class: "close-reveal-modal"; + +// Side Nav + +// $include-html-nav-classes: $include-html-classes; + +// We use this to control padding. +// $side-nav-padding: rem-calc(14 0); + +// We use these to control list styles. +// $side-nav-list-type: none; +// $side-nav-list-position: inside; +// $side-nav-list-margin: rem-calc(0 0 7 0); + +// We use these to control link styles. +// $side-nav-link-color: $primary-color; +// $side-nav-link-color-active: scale-color($side-nav-link-color, $lightness: 30%); +// $side-nav-link-color-hover: scale-color($side-nav-link-color, $lightness: 30%); +// $side-nav-font-size: rem-calc(14); +// $side-nav-font-weight: normal; +// $side-nav-font-family: $body-font-family; +// $side-nav-active-font-family: $side-nav-font-family; + + + +// We use these to control border styles +// $side-nav-divider-size: 1px; +// $side-nav-divider-style: solid; +// $side-nav-divider-color: scale-color(#fff, $lightness: -10%); + +// Split Buttons + +// $include-html-button-classes: $include-html-classes; + +// We use these to control different shared styles for Split Buttons +// $split-button-function-factor: 10%; +// $split-button-pip-color: #fff; +// $split-button-pip-color-alt: #333; +// $split-button-active-bg-tint: rgba(0,0,0,0.1); + +// We use these to control tiny split buttons +// $split-button-padding-tny: $button-pip-tny * 10; +// $split-button-span-width-tny: $button-pip-tny * 6; +// $split-button-pip-size-tny: $button-pip-tny; +// $split-button-pip-top-tny: $button-pip-tny * 2; +// $split-button-pip-default-float-tny: rem-calc(-6); + +// We use these to control small split buttons +// $split-button-padding-sml: $button-pip-sml * 10; +// $split-button-span-width-sml: $button-pip-sml * 6; +// $split-button-pip-size-sml: $button-pip-sml; +// $split-button-pip-top-sml: $button-pip-sml * 1.5; +// $split-button-pip-default-float-sml: rem-calc(-6); + +// We use these to control medium split buttons +// $split-button-padding-med: $button-pip-med * 9; +// $split-button-span-width-med: $button-pip-med * 5.5; +// $split-button-pip-size-med: $button-pip-med - rem-calc(3); +// $split-button-pip-top-med: $button-pip-med * 1.5; +// $split-button-pip-default-float-med: rem-calc(-6); + +// We use these to control large split buttons +// $split-button-padding-lrg: $button-pip-lrg * 8; +// $split-button-span-width-lrg: $button-pip-lrg * 5; +// $split-button-pip-size-lrg: $button-pip-lrg - rem-calc(6); +// $split-button-pip-top-lrg: $button-pip-lrg + rem-calc(5); +// $split-button-pip-default-float-lrg: rem-calc(-6); + +// Sub Nav + +// $include-html-nav-classes: $include-html-classes; + +// We use these to control margin and padding +// $sub-nav-list-margin: rem-calc(-4 0 18); +// $sub-nav-list-padding-top: rem-calc(4); + +// We use this to control the definition +// $sub-nav-font-family: $body-font-family; +// $sub-nav-font-size: rem-calc(14); +// $sub-nav-font-color: #999; +// $sub-nav-font-weight: normal; +// $sub-nav-text-decoration: none; +// $sub-nav-border-radius: 3px; +// $sub-nav-font-color-hover: scale-color($sub-nav-font-color, $lightness: -25%); + + +// We use these to control the active item styles + +// $sub-nav-active-font-weight: normal; +// $sub-nav-active-bg: $primary-color; +// $sub-nav-active-bg-hover: scale-color($sub-nav-active-bg, $lightness: -14%); +// $sub-nav-active-color: #fff; +// $sub-nav-active-padding: rem-calc(3 16); +// $sub-nav-active-cursor: default; + +// $sub-nav-item-divider: ""; +// $sub-nav-item-divider-margin: rem-calc(12); + +// +// SWITCH +// + +// $include-html-form-classes: $include-html-classes; + +// Controlling border styles and background colors for the switch container +// $switch-border-color: scale-color(#fff, $lightness: -20%); +// $switch-border-style: solid; +// $switch-border-width: 1px; +// $switch-bg: #fff; + +// We use these to control the switch heights for our default classes +// $switch-height-tny: 22px; +// $switch-height-sml: 28px; +// $switch-height-med: 36px; +// $switch-height-lrg: 44px; +// $switch-bottom-margin: rem-calc(20); + +// We use these to control default font sizes for our classes. +// $switch-font-size-tny: 11px; +// $switch-font-size-sml: 12px; +// $switch-font-size-med: 14px; +// $switch-font-size-lrg: 17px; +// $switch-label-side-padding: 6px; + +// We use these to style the switch-paddle +// $switch-paddle-bg: #fff; +// $switch-paddle-fade-to-color: scale-color($switch-paddle-bg, $lightness: -10%); +// $switch-paddle-border-color: scale-color($switch-paddle-bg, $lightness: -35%); +// $switch-paddle-border-width: 1px; +// $switch-paddle-border-style: solid; +// $switch-paddle-transition-speed: .1s; +// $switch-paddle-transition-ease: ease-out; +// $switch-positive-color: scale-color($success-color, $lightness: 94%); +// $switch-negative-color: #f5f5f5; + +// Outline Style for tabbing through switches +// $switch-label-outline: 1px dotted #888; + +// Tables + +// $include-html-table-classes: $include-html-classes; + +// These control the background color for the table and even rows +// $table-bg: #fff; +// $table-even-row-bg: #f9f9f9 ; + +// These control the table cell border style +// $table-border-style: solid; +// $table-border-size: 1px; +// $table-border-color: #ddd; + +// These control the table head styles +// $table-head-bg: #f5f5f5 ; +// $table-head-font-size: rem-calc(14); +// $table-head-font-color: #222; +// $table-head-font-weight: bold; +// $table-head-padding: rem-calc(8 10 10); + +// These control the row padding and font styles +// $table-row-padding: rem-calc(9 10); +// $table-row-font-size: rem-calc(14); +// $table-row-font-color: #222; +// $table-line-height: rem-calc(18); + +// These are for controlling the display and margin of tables +// $table-display: table-cell; +// $table-margin-bottom: rem-calc(20); + +// +// TABS +// + +// $include-html-tabs-classes: $include-html-classes; + +// $tabs-navigation-padding: rem-calc(16); +// $tabs-navigation-bg-color: #efefef ; +// $tabs-navigation-active-bg-color: #fff; +// $tabs-navigation-hover-bg-color: scale-color($tabs-navigation-bg-color, $lightness: -6%); +// $tabs-navigation-font-color: #222; +// $tabs-navigation-font-size: rem-calc(16); +// $tabs-navigation-font-family: $body-font-family; + +// $tabs-content-margin-bottom: rem-calc(24); +// $tabs-content-padding: $column-gutter/2; + +// $tabs-vertical-navigation-margin-bottom: 1.25rem; + +// +// THUMBNAILS +// + +// $include-html-media-classes: $include-html-classes; + +// We use these to control border styles +// $thumb-border-style: solid; +// $thumb-border-width: 4px; +// $thumb-border-color: #fff; +// $thumb-box-shadow: 0 0 0 1px rgba(#000,.2); +// $thumb-box-shadow-hover: 0 0 6px 1px rgba($primary-color,0.5); + +// Radius and transition speed for thumbs +// $thumb-radius: $global-radius; +// $thumb-transition-speed: 200ms; + +// +// TOOLTIPS +// + +// $include-html-tooltip-classes: $include-html-classes; + +// $has-tip-border-bottom: dotted 1px #ccc; +// $has-tip-font-weight: bold; +// $has-tip-font-color: #333; +// $has-tip-border-bottom-hover: dotted 1px scale-color($primary-color, $lightness: -55%); +// $has-tip-font-color-hover: $primary-color; +// $has-tip-cursor-type: help; + +// $tooltip-padding: rem-calc(12); +// $tooltip-bg: #333; +// $tooltip-font-size: rem-calc(14); +// $tooltip-font-weight: normal; +// $tooltip-font-color: #fff; +// $tooltip-line-height: 1.3; +// $tooltip-close-font-size: rem-calc(10); +// $tooltip-close-font-weight: normal; +// $tooltip-close-font-color: #777; +// $tooltip-font-size-sml: rem-calc(14); +// $tooltip-radius: $global-radius; +// $tooltip-rounded: $global-rounded; +// $tooltip-pip-size: 5px; + +// +// TOP BAR +// + +// $include-html-top-bar-classes: $include-html-classes; + +// Background color for the top bar +// $topbar-bg-color: #333; +// $topbar-bg: $topbar-bg-color; + +// Height and margin +// $topbar-height: 45px; +// $topbar-margin-bottom: 0; + +// Controlling the styles for the title in the top bar +// $topbar-title-weight: normal; +// $topbar-title-font-size: rem-calc(17); + +// Style the top bar dropdown elements +// $topbar-dropdown-bg: #333; +// $topbar-dropdown-link-color: #fff; +// $topbar-dropdown-link-bg: #333; +// $topbar-dropdown-link-weight: normal; +// $topbar-dropdown-toggle-size: 5px; +// $topbar-dropdown-toggle-color: #fff; +// $topbar-dropdown-toggle-alpha: 0.4; + +// Set the link colors and styles for top-level nav +// $topbar-link-color: #fff; +// $topbar-link-color-hover: #fff; +// $topbar-link-color-active: #fff; +// $topbar-link-color-active-hover: #fff; +// $topbar-link-weight: normal; +// $topbar-link-font-size: rem-calc(13); +// $topbar-link-hover-lightness: -10%; // Darken by 10% +// $topbar-link-bg-hover: #272727; +// $topbar-link-bg-active: $primary-color; +// $topbar-link-bg-active-hover: scale-color($primary-color, $lightness: -14%); +// $topbar-link-font-family: $body-font-family; +// $topbar-link-text-transform: none; +// $topbar-link-padding: $topbar-height / 3; + +// $topbar-button-font-size: 0.75rem; +// $topbar-button-top: 7px; + +// $topbar-dropdown-label-color: #777; +// $topbar-dropdown-label-text-transform: uppercase; +// $topbar-dropdown-label-font-weight: bold; +// $topbar-dropdown-label-font-size: rem-calc(10); +// $topbar-dropdown-label-bg: #333; + +// Top menu icon styles +// $topbar-menu-link-transform: uppercase; +// $topbar-menu-link-font-size: rem-calc(13); +// $topbar-menu-link-weight: bold; +// $topbar-menu-link-color: #fff; +// $topbar-menu-icon-color: #fff; +// $topbar-menu-link-color-toggled: #888; +// $topbar-menu-icon-color-toggled: #888; + +// Transitions and breakpoint styles +// $topbar-transition-speed: 300ms; +// Using rem-calc for the below breakpoint causes issues with top bar +// $topbar-breakpoint: #{upper-bound($medium-range)}; // Change to 9999px for always mobile layout +// $topbar-media-query: "only screen and (min-width: #{upper-bound($medium-range)})"; + +// Divider Styles +// $topbar-divider-border-bottom: solid 1px scale-color($topbar-bg-color, $lightness: 13%); +// $topbar-divider-border-top: solid 1px scale-color($topbar-bg-color, $lightness: -50%); + +// Sticky Class +// $topbar-sticky-class: ".sticky"; +// $topbar-arrows: true; //Set false to remove the triangle icon from the menu item + +// +// VISIBILITY CLASSES +// + +// $include-html-visibility-classes: $include-html-classes; +// $include-table-visibility-classes: true; +// $include-legacy-visibility-classes: true; + +// +// RANGE SLIDER +// + +// $include-html-range-slider-classes: $include-html-classes; + +// These variabels define the slider bar styles +// $range-slider-bar-width: 100%; +// $range-slider-bar-height: rem-calc(16); + +// $range-slider-bar-border-width: 1px; +// $range-slider-bar-border-style: solid; +// $range-slider-bar-border-color: #ddd; +// $range-slider-radius: $global-radius; +// $range-slider-round: $global-rounded; +// $range-slider-bar-bg-color: #fafafa; + +// Vertical bar styles +// $range-slider-vertical-bar-width: rem-calc(16); +// $range-slider-vertical-bar-height: rem-calc(200); + +// These variabels define the slider handle styles +// $range-slider-handle-width: rem-calc(32); +// $range-slider-handle-height: rem-calc(22); +// $range-slider-handle-position-top: rem-calc(-5); +// $range-slider-handle-bg-color: $primary-color; +// $range-slider-handle-border-width: 1px; +// $range-slider-handle-border-style: solid; +// $range-slider-handle-border-color: none; +// $range-slider-handle-radius: $global-radius; +// $range-slider-handle-round: $global-rounded; +// $range-slider-handle-bg-hover-color: scale-color($primary-color, $lightness: -12%); +// $range-slider-handle-cursor: pointer; +@import 'foundation' diff --git a/app/assets/stylesheets/user/foundation/lists.css.sass b/app/assets/stylesheets/user/foundation/lists.css.sass index 54595b54..2a72d0ef 100644 --- a/app/assets/stylesheets/user/foundation/lists.css.sass +++ b/app/assets/stylesheets/user/foundation/lists.css.sass @@ -1,4 +1,4 @@ -@import foundation +@import "foundation_and_overrides" .lists-overview-entry +grid-column(12) @media #{$medium-only} diff --git a/app/assets/stylesheets/user/wood1/_constants.css.sass b/app/assets/stylesheets/user/wood1/_constants.css.sass index 81bfc4a9..5c8759cb 100644 --- a/app/assets/stylesheets/user/wood1/_constants.css.sass +++ b/app/assets/stylesheets/user/wood1/_constants.css.sass @@ -1,6 +1,7 @@ $qbrown: #853d15 $qbrown-active: lighten($qbrown, 20%) $green: #7BB459 //Heineken +//$green: //Heineken //$wood: image-url('textures/wood001-vertical.jpg') $wood: image-url('textures/theme1.jpg') $background-brown: #57351f @@ -10,7 +11,7 @@ $side-spacing: 5px background-repeat: no-repeat, no-repeat, repeat-x background-position: left center, right center, center center background-image: image-url('theme1/button-wood-left.png'), image-url('theme1/button-wood-right.png'), image-url('theme1/button-wood-middle.png') - color: $green + color: white border-width: 0 border-radius: 0 height: 31px @@ -21,7 +22,7 @@ $side-spacing: 5px background-repeat: no-repeat, no-repeat, repeat-x background-position: left center, right center, center center background-image: image-url('theme1/button-wood-left.png'), image-url('theme1/button-wood-right.png'), image-url('theme1/button-wood-middle.png') - color: blue + color: black =button-bar background-color: transparent background-repeat: no-repeat, no-repeat @@ -53,6 +54,9 @@ $side-spacing: 5px line-height: 1.1em color: black float: left + .main-buttons + float: left + margin-right: 12px .action-buttons float: left width: 150px @@ -72,7 +76,6 @@ $side-spacing: 5px background-color: $qbrown text-align: center line-height: 34px - text-indent: -5000px &.active background-color: $qbrown-active &.hide diff --git a/app/assets/stylesheets/user/wood1/application.css b/app/assets/stylesheets/user/wood1/application.css index f6daff02..8a494984 100644 --- a/app/assets/stylesheets/user/wood1/application.css +++ b/app/assets/stylesheets/user/wood1/application.css @@ -11,6 +11,7 @@ *= require 'twitter-bootstrap/bootstrap_and_overrides' *= require 'twitter-bootstrap/bootstrap_overrides' *= require 'general' + *= require font-awesome *= require_directory . *= require_self */ diff --git a/app/assets/stylesheets/user/wood1/darkstrap.sass b/app/assets/stylesheets/user/wood1/darkstrap.sass index 2a33185a..7955f355 100644 --- a/app/assets/stylesheets/user/wood1/darkstrap.sass +++ b/app/assets/stylesheets/user/wood1/darkstrap.sass @@ -34,7 +34,21 @@ $input-color: white //=General ======================================== // Everything with the inset panel just extends .well .well - +inset-panel-dark + //+inset-panel-dark + background-color: rgba(255,255,255,0.8) + h1,h2,h3,h4,h5,h6,a + color: #333 + .table + thead + color: #111 + td + border-top-color: #aaa + color: #111 + +.table-striped + tbody tr:nth-child(2n+1) + td, th + background-color: #444 body background: $bg diff --git a/app/assets/stylesheets/user/wood1/list_products.css.sass b/app/assets/stylesheets/user/wood1/list_products.css.sass index f59500c9..6f49286f 100644 --- a/app/assets/stylesheets/user/wood1/list_products.css.sass +++ b/app/assets/stylesheets/user/wood1/list_products.css.sass @@ -4,3 +4,9 @@ .order-product-button +wood-button color: white +button.order-selected-products + color: white + background-color: $green +.product_order-remove-button + padding: 2px 5px + background-color: #bbb diff --git a/app/assets/stylesheets/user/wood1/side_menu.css.sass b/app/assets/stylesheets/user/wood1/side_menu.css.sass new file mode 100644 index 00000000..2f0def38 --- /dev/null +++ b/app/assets/stylesheets/user/wood1/side_menu.css.sass @@ -0,0 +1,23 @@ +@import ./constants +@import font-awesome +#toggle-side-menu + position: absolute + width: 28px + height: 28px + color: white + span + @extend .fa + @extend .fa-bars + @extend .fa-lg +#side-menu-container + background-color: #444 + position: fixed + display: none + left: 0 + top: 0 + width: 0 + height: 100% + > ul + list-style: none + a + color: white diff --git a/app/assets/stylesheets/user/wood1/structure.css.sass b/app/assets/stylesheets/user/wood1/structure.css.sass index ccc4a8b9..28c989ae 100644 --- a/app/assets/stylesheets/user/wood1/structure.css.sass +++ b/app/assets/stylesheets/user/wood1/structure.css.sass @@ -1,5 +1,9 @@ @import compass @import ./constants +@import font-awesome + +.fa-menu + @extend .fa-cutlery html background-image: $wood background-color: $background-brown @@ -102,6 +106,7 @@ body height: 28px background-position: center center background-repeat: no-repeat + line-height: 28px .top-button-bar +button-bar height: 90px @@ -112,21 +117,20 @@ body margin-right: 8px .table-number float: right - #show-active-list + //#show-active-list span background-image: image-url('icons/list.png') #place-order-on-list span background-image: image-url('icons/menu.png') #list-needs-payment-button - span - background-image: image-url('icons/needs-payment.png') + //span + //background-image: image-url('icons/needs-payment.png') &.active - span - background-image: image-url('icons/needs-payment-active.png') + span.fa + @extend .fa-spin + //background-image: image-url('icons/needs-payment-active.png') #list-needs-help-button - span - background-image: image-url('icons/needs-help.png') &.active - span - background-image: image-url('icons/needs-help-active.png') + span.fa + @extend .fa-spin diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index a16e13ea..6bd9d9f0 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -134,7 +134,7 @@ class UserController < Users::ApplicationController if @list = @table.active_list if @list.user_ids.include?(current_user.id) render json: {approved: true} - elsif @list.join_requests.include?(current_user.id) + elsif @list.join_request_user_ids.include?(current_user.id) render json: {waiting: true} else render json: {rejected: true} diff --git a/app/controllers/users/lists_controller.rb b/app/controllers/users/lists_controller.rb index 9da2752d..51113c7a 100644 --- a/app/controllers/users/lists_controller.rb +++ b/app/controllers/users/lists_controller.rb @@ -11,6 +11,7 @@ module Users #EMBER def current list = current_user.active_list + render json: {}, status: :not_found and return unless list.present? [list].include_relation(supplier: {product_categories: :products}, orders: :product_orders) # table also when it is a real array :) render json: json_response(not_present: true) and return unless list.present? render json: list, serializer: UserExtendedListSerializer diff --git a/app/controllers/users/orders_controller.rb b/app/controllers/users/orders_controller.rb index 3510e43a..d80d3eb3 100644 --- a/app/controllers/users/orders_controller.rb +++ b/app/controllers/users/orders_controller.rb @@ -2,8 +2,18 @@ module Users class OrdersController < Users::ApplicationController respond_to :json def create + converted_order = params[:order][:product_orders].each_with_object({}){|po, o| o[po[:product_id]] = po[:quantity] } - list = current_user.active_list + unless list = current_user.active_list + table = Table.find(params[:order][:table_id]) + + if table.occupied? + #render json: json_alert('messages.table_is_occupied', location: :join_occupied_table, location_params: {table_id: @table.id}) + render status: :not_acceptable and return + end + + list = List.from_table( table, current_user ) + end order = list.place_order converted_order render json: order, serializer: OrderSerializer end diff --git a/app/controllers/users/tables_controller.rb b/app/controllers/users/tables_controller.rb new file mode 100644 index 00000000..b582e2f8 --- /dev/null +++ b/app/controllers/users/tables_controller.rb @@ -0,0 +1,8 @@ +module Users + class TablesController < Users::ApplicationController + def show + @table = Table.find(params[:id]) + render json: @table, serializer: UserExtendedTableSerializer + end + end +end diff --git a/app/models/list.rb b/app/models/list.rb index 33a298a3..b90b2aa5 100644 --- a/app/models/list.rb +++ b/app/models/list.rb @@ -7,7 +7,7 @@ class List property :needs_help, type: :boolean, default: false property :needs_payment, type: :boolean, default: false property :closed_at, type: Time - property :join_requests, type: Array, default: [] + property :join_request_user_ids, type: Array, default: [] property :price, type: Float property :is_paid, type: :boolean, default: false property :paid_at, type: Time @@ -177,6 +177,7 @@ class List def is_paid! self.is_paid = true + self.needs_payment = false self.paid_at ||= Time.now if save broadcast_users 'list_is_paid', id: id @@ -192,18 +193,18 @@ class List self.section_id = to_table.section_id if save # Update the section of an order - orders.each do |order| - order.section_id = self.section_id - order.save - end + #orders.each do |order| + #order.section_id = self.section_id + #order.save + #end broadcast_users 'list_changed_table', list: as_json, section_title: to_table.section.try(:title), from_table_id: from_table broadcast_supplier supplier_id, 'list_changed_table', list: as_json, section_title: to_table.section.try(:title), from_table_id: from_table end end def approve_join_request_for_user!(user) - if join_requests.include?(user.id) - join_requests.delete(user.id) + if join_request_user_ids.include?(user.id) + join_request_user_ids.delete(user.id) user.active_list_id = self.id add_user(user) user.save @@ -215,7 +216,7 @@ class List end def unlink_user(user) - changed = join_requests.delete(user.id) + changed = join_request_user_ids.delete(user.id) changed ||= Array.wrap(user_ids).delete(user.id) if user.active_list_id == id user.active_list_id = nil @@ -225,8 +226,8 @@ class List end def send_table_join_request_for_user!(requester) - unless join_requests.include?(requester.id) - self.join_requests << requester.id + unless join_request_user_ids.include?(requester.id) + self.join_request_user_ids << requester.id self.is_dirty if save for user in users @@ -237,8 +238,8 @@ class List end def reject_join_request_for_user!(user_id) - if join_requests.include?(user_id) - join_requests.delete(user_id) + if join_request_user_ids.include?(user_id) + join_request_user_ids.delete(user_id) self.is_dirty if save broadcast_user user_id, 'join_request_rejected' @@ -269,14 +270,14 @@ class List def place_order(products, user: nil, employee: nil) return false unless products.any? - order = Order.create list: self, supplier: supplier, user: user, employee: employee, section_id: section_id + order = Order.create list: self, supplier: supplier, user: user, employee: employee, section_id: section_id, table_id: table_id return unless order.id orders_placed_count = supplier.increment_orders_placed_count! loaded_products = self.class.database.load_document products.keys 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, quantity: quantity, price: product.price if quantity > 0 + ProductOrder.create order: order, product_id: product_id, quantity: quantity, price: product.price, product_name: product.name if quantity > 0 end set_price save @@ -366,18 +367,23 @@ class List # Return a join requests object in the form of: # {join_request: [{user_id: '1saf3...', user_email: 'info@qwaiter.com'}, [....]]} + # DEPRICATED IN EMBER def join_requests_as_json return @join_requests_as_json if @join_requests_as_json.present? h = {join_requests: []} # Handle join requests - if join_requests.any? - for user in self.class.database.load_document(join_requests) + if join_request_user_ids.any? + for user in self.class.database.load_document(join_request_user_ids) h[:join_requests] << {user_id: user.id, user_email: user.email} end end @join_requests_as_json = h end + def join_requests + @join_requests ||= join_request_user_ids.any? ? self.class.database.load_document(join_request_user_ids).map{|user| JoinRequest.new(user: user, list: self) } : [] + end + def product_categories supplier.product_categories end diff --git a/app/models/order.rb b/app/models/order.rb index 4b05a296..4cb97f95 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -8,6 +8,7 @@ class Order belongs_to :user belongs_to :supplier belongs_to :section + belongs_to :table belongs_to :employee has_many :product_orders, dependent: :destroy diff --git a/app/models/product_order.rb b/app/models/product_order.rb index 47fdb732..af8d4f9e 100644 --- a/app/models/product_order.rb +++ b/app/models/product_order.rb @@ -4,6 +4,7 @@ class ProductOrder property :quantity, type: Fixnum property :price, type: Float + property :product_name belongs_to :product belongs_to :order diff --git a/app/models/supplier.rb b/app/models/supplier.rb index 16159e95..02af8584 100644 --- a/app/models/supplier.rb +++ b/app/models/supplier.rb @@ -1,5 +1,6 @@ class Supplier include SimplyStored::Couch + include ActiveModel::SerializerSupport devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :confirmable property :unconfirmed_email diff --git a/app/models/table.rb b/app/models/table.rb index cc3848ee..a0bc5a28 100644 --- a/app/models/table.rb +++ b/app/models/table.rb @@ -6,6 +6,7 @@ class Table property :number, type: Fixnum, default: 1 property :position_x, type: Float property :position_y, type: Float + property :needs_help, type: :boolean belongs_to :supplier belongs_to :section @@ -47,9 +48,11 @@ class Table end def occupied? + return true #testing... return @is_occupied if instance_variable_defined?(:'@is_occupied') @is_occupied = !self.class.database.view(List.active_by_table_id_view(key: id, reduce: true)).zero? end + alias occupied occupied? def occupied=(val) end def self.enrich_active_list_id(tables) diff --git a/app/serializers/join_request_serializer.rb b/app/serializers/join_request_serializer.rb new file mode 100644 index 00000000..06d38aab --- /dev/null +++ b/app/serializers/join_request_serializer.rb @@ -0,0 +1,3 @@ +class JoinRequestSerializer < Qwaiter::Serializer + attributes :user_id, :user_facebook_id, :list_id +end diff --git a/app/serializers/list_serializer.rb b/app/serializers/list_serializer.rb index 72783b97..164e469c 100644 --- a/app/serializers/list_serializer.rb +++ b/app/serializers/list_serializer.rb @@ -1,7 +1,7 @@ class ListSerializer < Qwaiter::Serializer # user ids for facebook pictures #embed :ids - attributes :state, :needs_help, :needs_payment, :is_paid, :price, :table_id, :table_number, :section_id, :has_active_orders, :user_ids + attributes :state, :needs_help, :needs_payment, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_id #, :has_active_orders #def has_active_orders #object.has_active_orders? diff --git a/app/serializers/order_serializer.rb b/app/serializers/order_serializer.rb index 0a46f5be..6251afad 100644 --- a/app/serializers/order_serializer.rb +++ b/app/serializers/order_serializer.rb @@ -1,6 +1,6 @@ class OrderSerializer < Qwaiter::Serializer embed :ids, include: true - attributes :state, :list_id, :section_id #, :price + attributes :state, :list_id, :section_id, :table_id #, :price # todo, put this logic in Ember #def product_orders diff --git a/app/serializers/product_order_serializer.rb b/app/serializers/product_order_serializer.rb index 750d86b2..7dff2f4e 100644 --- a/app/serializers/product_order_serializer.rb +++ b/app/serializers/product_order_serializer.rb @@ -1,5 +1,5 @@ # Used for user ember1 class ProductOrderSerializer < Qwaiter::Serializer embed :ids - attributes :order_id, :product_id, :quantity, :price + attributes :order_id, :product_id, :quantity, :price, :product_name end diff --git a/app/serializers/table_serializer.rb b/app/serializers/table_serializer.rb index ff5c2643..5b537277 100644 --- a/app/serializers/table_serializer.rb +++ b/app/serializers/table_serializer.rb @@ -10,10 +10,6 @@ class TableSerializer < Qwaiter::Serializer #object.active_list #end - def occupied - object.active_list_id.present? - end - def list object.active_list end diff --git a/app/serializers/user_extended_list_serializer.rb b/app/serializers/user_extended_list_serializer.rb index 2dd53479..2380ed87 100644 --- a/app/serializers/user_extended_list_serializer.rb +++ b/app/serializers/user_extended_list_serializer.rb @@ -17,7 +17,9 @@ class UserExtendedListSerializer < Qwaiter::Serializer object.has_active_orders? end has_many :orders - has_many :product_categories + #has_many :product_categories + has_one :table, serializer: UserExtendedTableSerializer + has_many :join_requests def extended_version true diff --git a/app/serializers/user_extended_supplier_serializer.rb b/app/serializers/user_extended_supplier_serializer.rb new file mode 100644 index 00000000..fffdce1c --- /dev/null +++ b/app/serializers/user_extended_supplier_serializer.rb @@ -0,0 +1,10 @@ +class UserExtendedSupplierSerializer < Qwaiter::Serializer + self.root = :supplier + embed :ids, include: true + attributes :extended_version, :open, :name + has_many :product_categories + + def extended_version + true + end +end diff --git a/app/serializers/user_extended_table_serializer.rb b/app/serializers/user_extended_table_serializer.rb new file mode 100644 index 00000000..5d96e3c2 --- /dev/null +++ b/app/serializers/user_extended_table_serializer.rb @@ -0,0 +1,6 @@ +class UserExtendedTableSerializer < Qwaiter::Serializer + self.root = :table + embed :ids, include: true + attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied, :needs_help + has_one :supplier, serializer: UserExtendedSupplierSerializer +end diff --git a/app/serializers/user_supplier_serializer.rb b/app/serializers/user_supplier_serializer.rb new file mode 100644 index 00000000..5c4029d5 --- /dev/null +++ b/app/serializers/user_supplier_serializer.rb @@ -0,0 +1,8 @@ +class UserExtendedSupplierSerializer < Qwaiter::Serializer + self.root = :supplier + attributes :extended_version, :open, :name + + def extended_version + false + end +end diff --git a/app/serializers/user_table_serializer.rb b/app/serializers/user_table_serializer.rb new file mode 100644 index 00000000..dfef5799 --- /dev/null +++ b/app/serializers/user_table_serializer.rb @@ -0,0 +1,4 @@ +class UserTableSerializer < Qwaiter::Serializer + self.root = :table + attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied, :needs_help +end diff --git a/app/services/join_request.rb b/app/services/join_request.rb new file mode 100644 index 00000000..619d5240 --- /dev/null +++ b/app/services/join_request.rb @@ -0,0 +1,19 @@ +class JoinRequest + attr_reader :user, :list + + def initialize(user: nil, list: nil) + @user, @list = user, list + end + + def user_id + user.id + end + + def user_facebook_id + user.uid + end + + def list_id + list.id + end +end diff --git a/app/templates/user/_active_order.mustache b/app/templates/user/_active_order.mustache index 0ff92c03..2168eac5 100644 --- a/app/templates/user/_active_order.mustache +++ b/app/templates/user/_active_order.mustache @@ -4,7 +4,6 @@ # - @@ -12,18 +11,28 @@ {{name}} {{number}} - {{#currency}}{{product_total}}{{/currency}} + + {{#currency}}{{product_total}}{{/currency}} + + {{/products}} - - + Totaal {{#currency}}{{total}}{{/currency}} + + + + + + + + diff --git a/app/templates/user/_products_category_for_order.mustache b/app/templates/user/_products_category_for_order.mustache index 8ab6425f..4729c5e2 100644 --- a/app/templates/user/_products_category_for_order.mustache +++ b/app/templates/user/_products_category_for_order.mustache @@ -1,13 +1,15 @@ -

{{category}}

+

{{category}}

{{#products}} {{name}} - - + - 1 - + + + + + + {{#currency}}{{price}}{{/currency}} + - {{#currency}}{{price}}{{/currency}} - {{/products}} diff --git a/app/views/layouts/phone.html.slim b/app/views/layouts/phone.html.slim index 421a8ad4..10790e00 100644 --- a/app/views/layouts/phone.html.slim +++ b/app/views/layouts/phone.html.slim @@ -53,7 +53,7 @@ html lang="en" }); body class=action_name - .navbar.navbar-fixed-top + /.navbar.navbar-fixed-top .navbar-inner .container a.btn.btn-navbar data-target=".nav-collapse" data-toggle="collapse" @@ -66,6 +66,13 @@ html lang="en" li.locale.locale-en= link_to_function 'English', %|setLocale('en')| li.locale.locale-nl= link_to_function 'Nederlands', %|setLocale('nl')| li= link_to t('user.list_history.title'), user_list_history_path, data: {t: 'list_history.title'} + a#toggle-side-menu href="#" + span.fa.fa-bars.fa-lg + #side-menu-container + ul + li.locale-select.locale-select-en= link_to_function 'English', %|setLocale('en')| + li.locale-select.locale-select-nl= link_to_function 'Nederlands', %|setLocale('nl')| + li= link_to t('user.list_history.title'), user_list_history_path, data: {t: 'list_history.title'} .container .content .alert.alert-error.hide diff --git a/app/views/user/list_products.html.slim b/app/views/user/list_products.html.slim index 30d8627f..b816ec2e 100644 --- a/app/views/user/list_products.html.slim +++ b/app/views/user/list_products.html.slim @@ -1,4 +1,4 @@ -= top_bar title: 'show_products.title' do += top_bar title: '' || 'show_products.title' do .pull-right .supplier-info-row .table-number @@ -6,14 +6,18 @@ .supplier-info-row .counter.supplier-orders-placed-count .counter.supplier-orders-in-process-count + .main-buttons= link_to image_tag('icons/logo-small.png', alt: application_title), user_root_path, class: :brand .action-buttons = link_to user_active_list_path, class: ['user-top-button'], id: 'show-active-list' do - span= t('helpers.links.show_active_list', list: List.model_name.human) + /span=# t('helpers.links.show_active_list', list: List.model_name.human) + span.fa.fa-menu.fa-lg span#list-needs-payment-button.user-top-button - span - span#list-needs-help-button.user-top-button + span.fa.fa-money.fa-lg + /span#list-needs-help-button.user-top-button span span + span#list-needs-help-button.user-top-button.left + span.fa.fa-question.fa-lg .well diff --git a/config/routes.rb b/config/routes.rb index 98a92bc1..d62bce2e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -78,6 +78,7 @@ Qwaiter::Application.routes.draw do end resources :orders, only: [:create] + resources :tables, only: [:show] end