Add user product info

This commit is contained in:
2014-04-22 18:42:02 +02:00
parent 821f59b761
commit ea498cb9c5
26 changed files with 1474 additions and 105 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'rails', '4.0.4' gem 'rails', '4.1.0'
gem 'rack-cors', :require => 'rack/cors' gem 'rack-cors', :require => 'rack/cors'
# Bundle edge Rails instead: # Bundle edge Rails instead:
@@ -18,7 +18,7 @@ gem 'slim-rails'
# Gems used only for assets and not required # Gems used only for assets and not required
# in production environments by default. # in production environments by default.
group :assets do group :assets do
gem 'sass-rails', '~> 4.0.2' gem 'sass-rails' #, '~> 4.0.2'
gem 'coffee-rails' #, '~> 3.2.1' gem 'coffee-rails' #, '~> 3.2.1'
#gem 'twitter-bootstrap-rails' #gem 'twitter-bootstrap-rails'
gem 'bootstrap-sass', '~>2.3' gem 'bootstrap-sass', '~>2.3'
+67 -70
View File
@@ -34,15 +34,9 @@ PATH
specs: specs:
cmtool (0.5.0) cmtool (0.5.0)
bourbon bourbon
coffee-script
devise
devise_simply_stored
email_validator email_validator
haml-rails haml-rails
jquery-rails jquery-rails
paperclip
rails (>= 3.2.2)
sass-rails
slim-rails slim-rails
tinymce-rails tinymce-rails
@@ -57,36 +51,37 @@ PATH
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionmailer (4.0.4) actionmailer (4.1.0)
actionpack (= 4.0.4) actionpack (= 4.1.0)
actionview (= 4.1.0)
mail (~> 2.5.4) mail (~> 2.5.4)
actionpack (4.0.4) actionpack (4.1.0)
activesupport (= 4.0.4) actionview (= 4.1.0)
builder (~> 3.1.0) activesupport (= 4.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2) rack (~> 1.5.2)
rack-test (~> 0.6.2) rack-test (~> 0.6.2)
actionview (4.1.0)
activesupport (= 4.1.0)
builder (~> 3.1)
erubis (~> 2.7.0)
active_decorator (0.3.4) active_decorator (0.3.4)
active_model_serializers (0.8.1) active_model_serializers (0.8.1)
activemodel (>= 3.0) activemodel (>= 3.0)
activemodel (4.0.4) activemodel (4.1.0)
activesupport (= 4.0.4) activesupport (= 4.1.0)
builder (~> 3.1.0) builder (~> 3.1)
activerecord (4.0.4) activerecord (4.1.0)
activemodel (= 4.0.4) activemodel (= 4.1.0)
activerecord-deprecated_finders (~> 1.0.2) activesupport (= 4.1.0)
activesupport (= 4.0.4) arel (~> 5.0.0)
arel (~> 4.0.0) activesupport (4.1.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.4)
i18n (~> 0.6, >= 0.6.9) i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2) json (~> 1.7, >= 1.7.7)
multi_json (~> 1.3) minitest (~> 5.1)
thread_safe (~> 0.1) thread_safe (~> 0.1)
tzinfo (~> 0.3.37) tzinfo (~> 1.1)
addressable (2.3.5) addressable (2.3.6)
arel (4.0.2) arel (5.0.1.20140414130214)
atomic (1.1.16)
barber (0.4.2) barber (0.4.2)
ember-source ember-source
execjs execjs
@@ -97,10 +92,10 @@ GEM
bcrypt (3.1.7) bcrypt (3.1.7)
bootstrap-sass (2.3.2.2) bootstrap-sass (2.3.2.2)
sass (~> 3.2) sass (~> 3.2)
bourbon (3.1.8) bourbon (3.2.0)
sass (>= 3.2.0) sass (~> 3.2)
thor thor
builder (3.1.4) builder (3.2.2)
capybara (2.2.1) capybara (2.2.1)
mime-types (>= 1.16) mime-types (>= 1.16)
nokogiri (>= 1.3.3) nokogiri (>= 1.3.3)
@@ -113,7 +108,7 @@ GEM
chunky_png (1.3.0) chunky_png (1.3.0)
climate_control (0.0.3) climate_control (0.0.3)
activesupport (>= 3.0) activesupport (>= 3.0)
cocaine (0.5.3) cocaine (0.5.4)
climate_control (>= 0.0.3, < 1.0) climate_control (>= 0.0.3, < 1.0)
coderay (1.1.0) coderay (1.1.0)
coffee-rails (4.0.1) coffee-rails (4.0.1)
@@ -123,15 +118,15 @@ GEM
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.7.0) coffee-script-source (1.7.0)
compass (0.12.4) compass (0.12.6)
chunky_png (~> 1.2) chunky_png (~> 1.2)
fssm (>= 0.2.7) fssm (>= 0.2.7)
sass (~> 3.2.17) sass (~> 3.2.19)
compass-rails (1.1.6) compass-rails (1.1.6)
compass (>= 0.12.2) compass (>= 0.12.2)
connection_pool (1.2.0) connection_pool (1.2.0)
cookiejar (0.3.2) cookiejar (0.3.2)
couchbase (1.3.6) couchbase (1.3.7)
connection_pool (~> 1.0, >= 1.0.0) connection_pool (~> 1.0, >= 1.0.0)
multi_json (~> 1.0) multi_json (~> 1.0)
yaji (~> 0.3, >= 0.3.2) yaji (~> 0.3, >= 0.3.2)
@@ -174,12 +169,12 @@ GEM
handlebars-source handlebars-source
jquery-rails (>= 1.0.17) jquery-rails (>= 1.0.17)
railties (>= 3.1) railties (>= 3.1)
ember-source (1.4.0) ember-source (1.5.0)
handlebars-source (~> 1.0) handlebars-source (~> 1.0)
emblem-rails (0.2.1) emblem-rails (0.2.1)
barber-emblem (~> 0.1.1) barber-emblem (~> 0.1.1)
ember-rails (>= 0.14.0) ember-rails (>= 0.14.0)
emblem-source (0.3.12) emblem-source (0.3.15)
erubis (2.7.0) erubis (2.7.0)
eventmachine (1.0.3) eventmachine (1.0.3)
execjs (2.0.2) execjs (2.0.2)
@@ -203,7 +198,7 @@ GEM
websocket-driver (>= 0.3.1) websocket-driver (>= 0.3.1)
font-awesome-rails (4.0.3.1) font-awesome-rails (4.0.3.1)
railties (>= 3.2, < 5.0) railties (>= 3.2, < 5.0)
foundation-rails (5.2.1.0) foundation-rails (5.2.2.0)
railties (>= 3.1.0) railties (>= 3.1.0)
sass (>= 3.2.0) sass (>= 3.2.0)
fssm (0.2.10) fssm (0.2.10)
@@ -220,14 +215,14 @@ GEM
haml (>= 3.1, < 5.0) haml (>= 3.1, < 5.0)
railties (>= 4.0.1) railties (>= 4.0.1)
handlebars-source (1.3.0) handlebars-source (1.3.0)
hashie (2.0.5) hashie (2.1.1)
hike (1.2.3) hike (1.2.3)
http_parser.rb (0.6.0) http_parser.rb (0.6.0)
i18n (0.6.9) i18n (0.6.9)
jquery-rails (3.1.0) jquery-rails (3.1.0)
railties (>= 3.0, < 5.0) railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
jquery-ui-rails (4.2.0) jquery-ui-rails (4.2.1)
railties (>= 3.2.16) railties (>= 3.2.16)
js-routes (0.9.7) js-routes (0.9.7)
railties (>= 3.2) railties (>= 3.2)
@@ -250,8 +245,8 @@ GEM
mime-types (1.25.1) mime-types (1.25.1)
mini_magick (3.7.0) mini_magick (3.7.0)
subexec (~> 0.2.1) subexec (~> 0.2.1)
mini_portile (0.5.2) mini_portile (0.5.3)
minitest (4.7.5) minitest (5.3.3)
multi_json (1.9.2) multi_json (1.9.2)
multi_xml (0.5.5) multi_xml (0.5.5)
multipart-post (2.0.0) multipart-post (2.0.0)
@@ -291,20 +286,22 @@ GEM
rack-cors (0.2.9) rack-cors (0.2.9)
rack-test (0.6.2) rack-test (0.6.2)
rack (>= 1.0) rack (>= 1.0)
rails (4.0.4) rails (4.1.0)
actionmailer (= 4.0.4) actionmailer (= 4.1.0)
actionpack (= 4.0.4) actionpack (= 4.1.0)
activerecord (= 4.0.4) actionview (= 4.1.0)
activesupport (= 4.0.4) activemodel (= 4.1.0)
activerecord (= 4.1.0)
activesupport (= 4.1.0)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0, < 2.0)
railties (= 4.0.4) railties (= 4.1.0)
sprockets-rails (~> 2.0.0) sprockets-rails (~> 2.0)
railties (4.0.4) railties (4.1.0)
actionpack (= 4.0.4) actionpack (= 4.1.0)
activesupport (= 4.0.4) activesupport (= 4.1.0)
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rake (10.2.2) rake (10.3.1)
rest-client (1.6.7) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
rqrcode (0.4.2) rqrcode (0.4.2)
@@ -325,15 +322,15 @@ GEM
rspec-expectations (~> 2.14.0) rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0) rspec-mocks (~> 2.14.0)
ruby-progressbar (1.4.2) ruby-progressbar (1.4.2)
sass (3.2.18) sass (3.2.19)
sass-rails (4.0.2) sass-rails (4.0.3)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 5.0)
sass (~> 3.2.0) sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0) sprockets (~> 2.8, <= 2.11.0)
sprockets-rails (~> 2.0.0) sprockets-rails (~> 2.0)
simple_form (3.0.1) simple_form (3.0.2)
actionpack (>= 4.0.0, < 4.1) actionpack (~> 4.0)
activemodel (>= 4.0.0, < 4.1) activemodel (~> 4.0)
simplecov (0.8.2) simplecov (0.8.2)
docile (~> 1.1.0) docile (~> 1.1.0)
multi_json multi_json
@@ -342,10 +339,10 @@ GEM
slim (2.0.2) slim (2.0.2)
temple (~> 0.6.6) temple (~> 0.6.6)
tilt (>= 1.3.3, < 2.1) tilt (>= 1.3.3, < 2.1)
slim-rails (2.1.2) slim-rails (2.1.4)
actionpack (>= 3.0, < 4.1) actionpack (>= 3.0, < 4.2)
activesupport (>= 3.0, < 4.1) activesupport (>= 3.0, < 4.2)
railties (>= 3.0, < 4.1) railties (>= 3.0, < 4.2)
slim (~> 2.0) slim (~> 2.0)
slop (3.5.0) slop (3.5.0)
sprockets (2.11.0) sprockets (2.11.0)
@@ -353,7 +350,7 @@ GEM
multi_json (~> 1.0) multi_json (~> 1.0)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1) sprockets-rails (2.1.3)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (~> 2.8) sprockets (~> 2.8)
@@ -363,9 +360,8 @@ GEM
daemons (>= 1.0.9) daemons (>= 1.0.9)
eventmachine (>= 1.0.0) eventmachine (>= 1.0.0)
rack (>= 1.0.0) rack (>= 1.0.0)
thor (0.19.0) thor (0.19.1)
thread_safe (0.3.1) thread_safe (0.3.3)
atomic (>= 1.1.7, < 2)
tilt (1.4.1) tilt (1.4.1)
tinymce-rails (4.0.19) tinymce-rails (4.0.19)
railties (>= 3.1.1) railties (>= 3.1.1)
@@ -375,7 +371,8 @@ GEM
turnip (1.2.1) turnip (1.2.1)
gherkin (>= 2.5) gherkin (>= 2.5)
rspec (>= 2.0, < 4.0) rspec (>= 2.0, < 4.0)
tzinfo (0.3.39) tzinfo (1.1.0)
thread_safe (~> 0.1)
uglifier (2.5.0) uglifier (2.5.0)
execjs (>= 0.3.0) execjs (>= 0.3.0)
json (>= 1.8.0) json (>= 1.8.0)
@@ -427,10 +424,10 @@ DEPENDENCIES
pry-rails pry-rails
quiet_assets quiet_assets
rack-cors rack-cors
rails (= 4.0.4) rails (= 4.1.0)
rqrcode rqrcode
rspec-rails rspec-rails
sass-rails (~> 4.0.2) sass-rails
simple_form simple_form
simplecov simplecov
simply_stored! simply_stored!
@@ -0,0 +1,5 @@
App.ModalInfoController = Ember.ObjectController.extend
actions:
close: ->
@get('model.cancel').call(@) if @get('model.cancel')
@send 'closeModal'
@@ -28,3 +28,7 @@ App.TableController = Ember.ObjectController.extend
@set 'join_request_sent', true # keeps the button deactivated @set 'join_request_sent', true # keeps the button deactivated
toggleProductCategory: (product_category)-> toggleProductCategory: (product_category)->
product_category.set 'collapsed', not product_category.get('collapsed') product_category.set 'collapsed', not product_category.get('collapsed')
showProductDescription: (product)->
@send 'openModal', 'modal_info', Ember.Object.create
title: product.get('name')
body: textile(product.get('description'))
@@ -2,5 +2,6 @@ attr = DS.attr
App.Product = DS.Model.extend App.Product = DS.Model.extend
name: attr 'string' name: attr 'string'
price: attr 'number' price: attr 'number'
description: attr 'string'
product_category: DS.belongsTo('product_category') product_category: DS.belongsTo('product_category')
product_orders: DS.hasMany('product_order') product_orders: DS.hasMany('product_order')
@@ -6,6 +6,11 @@ ControllerExtensions = Ember.Mixin.create
if jqXHR.status == 401 if jqXHR.status == 401
App.__container__.lookup('route:application').unauthorized() App.__container__.lookup('route:application').unauthorized()
handler handler
showModal: (options={})->
$(document).foundation('reflow') # needed (stupid!!!)
@confirm_cancel = options.cancel
@set 'controllers.application.modal.title', options.title if options.title
@set 'controllers.application.modal.content', options.content if options.content
Ember.ArrayController.reopen ControllerExtensions Ember.ArrayController.reopen ControllerExtensions
Ember.Controller.reopen Ember.Controller.reopen
needs: ['application'] needs: ['application']
@@ -47,13 +52,6 @@ Ember.Controller.reopen
##@set 'controllers.application.confirm.content', options.content if options.content ##@set 'controllers.application.confirm.content', options.content if options.content
##$('#confirm-modal').foundation('reveal', 'open') # this kills the ember actions ##$('#confirm-modal').foundation('reveal', 'open') # this kills the ember actions
##$('#confirm-modal').css('visibility', 'visible').show() ##$('#confirm-modal').css('visibility', 'visible').show()
showModal: (options={})->
#this.container.lookup('view:modal', {title:'Test title'})
#debugger
$(document).foundation('reflow') # needed (stupid!!!)
@confirm_cancel = options.cancel
@set 'controllers.application.modal.title', options.title if options.title
@set 'controllers.application.modal.content', options.content if options.content
#$('#confirm-modal').foundation('reveal', 'open') #this kills the ember actions #$('#confirm-modal').foundation('reveal', 'open') #this kills the ember actions
#$('#confirm-modal').css('visibility', 'visible').show() #$('#confirm-modal').css('visibility', 'visible').show()
@@ -0,0 +1,5 @@
modal-dialog action="close"
h3.flush--top= title
p==body
hr
button{action 'close'}= t 'modal.info.close'
@@ -25,9 +25,16 @@
unless product_category.collapsed unless product_category.collapsed
ul.product_category-products ul.product_category-products
each product in product_category.products each product in product_category.products
li li class="order-product-#{unbound product.id}"
if product.description
button.show-product-description{action showProductDescription product}
span
else
span.no-product-description
a{action addProduct product}= product.name a{action addProduct product}= product.name
span.right.currency=currency product.price button.add-product-to-list{action addProduct product}
span
span.product-price.currency=currency product.price
.large-6.columns= render 'product_orders' .large-6.columns= render 'product_orders'
else else
.large12 .large12
@@ -39,5 +46,8 @@
ul.product_category-products ul.product_category-products
each product in product_category.products each product in product_category.products
li li
if product.description
button.show-product-description{action showProductDescription product}
span
span= product.name span= product.name
span.right.currency=currency product.price span.right.currency=currency product.price
@@ -9,6 +9,7 @@
#= require translations #= require translations
#= require js-routes #= require js-routes
#= require_directory . #= require_directory .
#= require textile-js
#= require_self #= require_self
# #
# (($) -> # (($) ->
@@ -1,4 +1,4 @@
@import foundation_and_overrides @import ./foundation_and_overrides
.form-row .form-row
@extend .row @extend .row
@@ -13,6 +13,8 @@
// $rem-base: 16px; // $rem-base: 16px;
// Allows the use of rem-calc() or lower-bound() in your settings // Allows the use of rem-calc() or lower-bound() in your settings
a.unused-class
display: inline-block
@import "foundation/functions" @import "foundation/functions"
// $experimental: true; // $experimental: true;
@@ -8,8 +8,8 @@ header.top-menu
background-position: left bottom, right bottom background-position: left bottom, right bottom
background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png') background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png')
color: $green color: $green
padding-left: 49px padding-left: 48px
padding-right: 52px padding-right: 52px
.menu-content .menu-content
background-color: white background-color: white
background-repeat: repeat-x background-repeat: repeat-x
@@ -1,12 +1,37 @@
@import font-awesome //@import ./foundation_and_overrides
ul.product_category-products //@import font-awesome
list-style: none //ul.product_category-products
.product_category-title //list-style: none
cursor: pointer //.product_category-title
.icon //cursor: pointer
@extend .fa //.icon
@extend .fa-arrow-down //@extend .fa
color: #ccc //@extend .fa-arrow-down
padding-right: 10px //color: #ccc
&.collapsed //padding-right: 10px
@extend .fa-arrow-right //&.collapsed
//@extend .fa-arrow-right
//.product_category-products
//.product-price
//float: right
//.show-product-description
//+button($bg: $secondary-color)
//+button-icon-only
//margin-right: 7px
//span
//@extend .fa
//@extend .fa-info
//@extend .fa-lg
//.no-product-description
//// Empty space to match the product description for layout
//display: inline-block
//width: 1.65rem
//.add-product-to-list
//+button($bg: $secondary-color)
//+button-icon-only
//float: right
//margin-left: 5px
//span
//@extend .fa
//@extend .fa-plus
//@extend .fa-lg
@@ -95,7 +95,7 @@ module Suppliers
private private
def product_params def product_params
params.require(:product).permit(:name, :code, :price, product_category_ids: []) params.require(:product).permit(:name, :code, :price, :description, product_category_ids: [])
end end
end end
end end
@@ -1,6 +1,7 @@
module Users module Users
class ApplicationController < ::ApplicationController class ApplicationController < ::ApplicationController
before_action :user_authentication, :unless => ->(c){ %w(obtain_token).include?(c.action_name) || c.request.format.symbol == :html } # , except: [:obtain_token, :index] before_action :user_authentication, :unless => ->(c){ %w(obtain_token).include?(c.action_name) || c.request.format.symbol == :html } # , except: [:obtain_token, :index]
private private
def user_authentication def user_authentication
+1
View File
@@ -5,6 +5,7 @@ class Product
property :name property :name
property :code property :code
property :price, type: Float property :price, type: Float
property :description
#belongs_to :product_category #belongs_to :product_category
has_and_belongs_to_many :product_categories, storing_keys: false has_and_belongs_to_many :product_categories, storing_keys: false
+1 -1
View File
@@ -1,4 +1,4 @@
class ProductSerializer < Qwaiter::Serializer class ProductSerializer < Qwaiter::Serializer
embed :ids, include: true embed :ids, include: true
attributes :name, :price attributes :name, :price, :description
end end
+1 -1
View File
@@ -7,7 +7,7 @@ html lang="en"
title Qwaiter title Qwaiter
= stylesheet_link_tag "user/foundation/application" = stylesheet_link_tag "user/foundation/application"
= javascript_include_tag "vendor/modernizr" = javascript_include_tag "vendor/modernizr"
/= javascript_include_tag 'http://connect.facebook.net/en_US/all.js' = javascript_include_tag 'http://connect.facebook.net/en_US/all.js'
= javascript_include_tag "user/flat/application" = javascript_include_tag "user/flat/application"
- if ENV['QWAITER_MOBILE_EXPORT'] == 'yes' - if ENV['QWAITER_MOBILE_EXPORT'] == 'yes'
javascript: javascript:
+8 -3
View File
@@ -1,20 +1,25 @@
= form_for [:suppliers, @product] do |f| = form_for [:suppliers, @product] do |f|
= render 'error_messages', target: @product = render 'error_messages', target: @product
.form-row .form-row class=(f.object.errors[:name].any? ? 'error' : nil)
.form-label .form-label
= f.label :name, data: {t: 'attributes.product.name'} = f.label :name, data: {t: 'attributes.product.name'}
.form-field .form-field
= f.text_field :name = f.text_field :name
.form-row .form-row class=(f.object.errors[:code].any? ? 'error' : nil)
.form-label .form-label
= f.label :code, data: {t: 'attributes.product.code'} = f.label :code, data: {t: 'attributes.product.code'}
.form-field .form-field
= f.text_field :code = f.text_field :code
.form-row .form-row class=(f.object.errors[:price].any? ? 'error' : nil)
.form-label .form-label
= f.label :price, data: {t: 'attributes.product.price'} = f.label :price, data: {t: 'attributes.product.price'}
.form-field .form-field
= f.text_field :price = f.text_field :price
.form-row class=(f.object.errors[:description].any? ? 'error' : nil)
.form-label
= f.label :description, data: {t: 'attributes.product.description'}
.form-field
= f.text_area :description
/= f.input :name /= f.input :name
/= f.input :code /= f.input :code
/= f.input :price /= f.input :price
+3 -3
View File
@@ -1,17 +1,17 @@
-# DEPRICATED -# DEPRICATED
= form_for [:suppliers, @section], html: {class: 'form-horizontal' } do |f| = form_for [:suppliers, @section], html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @section = render 'error_messages', target: @section
.form-row class=(@section.errors[:title].any? ? 'error' : nil) .form-row class=(f.object.errors[:title].any? ? 'error' : nil)
.form-label .form-label
= f.label :title = f.label :title
.form-field .form-field
= f.text_field :title = f.text_field :title
.form-row class=(@section.errors[:width].any? ? 'error' : nil) .form-row class=(f.object.errors[:width].any? ? 'error' : nil)
.form-label .form-label
= f.label :width = f.label :width
.form-field .form-field
= f.number_field :width = f.number_field :width
.form-row class=(@section.errors[:height].any? ? 'error' : nil) .form-row class=(f.object.errors[:height].any? ? 'error' : nil)
.form-label .form-label
= f.label :height = f.label :height
.form-field .form-field
+3
View File
@@ -96,3 +96,6 @@ en:
closed: 'Closed' closed: 'Closed'
datepicker: datepicker:
no_date: 'Pick a date' no_date: 'Pick a date'
modal:
info:
close: OK
+3
View File
@@ -96,3 +96,6 @@ nl:
closed: 'Afgesloten' closed: 'Afgesloten'
datepicker: datepicker:
no_date: 'Selecteer een datum' no_date: 'Selecteer een datum'
modal:
info:
close: OK
@@ -0,0 +1,12 @@
Feature: Getting product information during an order
@javascript
Scenario: Happy flow
Given There is an open supplier with a menu
And the product 'Heineken beer' has description 'Brewed in Amsterdam'
And I am signed in as a user
#And I open the debugger
And I am on the user homepage
#When the user scans a table QR code
#And the user clicks on the more info button for the product with name 'Heineken beer'
#Then the page should have content 'Brewed in Amsterdam'
@@ -0,0 +1,6 @@
step "the product :product_name has description :product_description" do |product_name, product_description|
product = @product && @product.name == product_name ? @product : Product.find_by_name(product_name)
product.description = product_description
product.save or raise "Cannot save product: #{product.errors.full_messages.to_sentence}"
@product ||= product
end
@@ -27,3 +27,8 @@ step "there is a signed in user with an active order" do
step "I am signed in as a user" step "I am signed in as a user"
step "the user has an active order" step "the user has an active order"
end end
step "the user clicks on the more info button for the product with name :product_name" do |product_name|
product = @product && @product.name == product_name ? @product : Product.find_by_name(product_name)
find(".order-product-#{product.id} .show-product-description").click
end
File diff suppressed because it is too large Load Diff