Big upgrade and supplier style upgrades

This commit is contained in:
2015-02-13 15:58:11 +01:00
parent de3f2f7cae
commit 78f1056dc7
19 changed files with 238 additions and 242 deletions
+4 -5
View File
@@ -1,6 +1,6 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'rails', '4.2.0.rc2' gem 'rails', '4.2.0'
gem 'rack-cors', :require => 'rack/cors' gem 'rack-cors', :require => 'rack/cors'
# Bundle edge Rails instead: # Bundle edge Rails instead:
@@ -20,12 +20,12 @@ group :assets do
gem 'ember-source', '1.8.1'#, github: 'emberjs/ember.js', require: 'ember/source' gem 'ember-source', '1.8.1'#, github: 'emberjs/ember.js', require: 'ember/source'
gem 'ember-rails' gem 'ember-rails'
gem 'ember_script-rails', github: 'ghempton/ember-script-rails' gem 'ember_script-rails', github: 'ghempton/ember-script-rails'
gem 'sass-rails', '5.0.0.beta1' gem 'sass-rails', '~> 5.0.0'
gem 'coffee-rails' #, '~> 3.2.1' gem 'coffee-rails' #, '~> 3.2.1'
#gem 'twitter-bootstrap-rails' #gem 'twitter-bootstrap-rails'
# Only for mobile assets precompile, not used in this project # Only for mobile assets precompile, not used in this project
gem 'bootstrap-sass', '~>2.3' #gem 'bootstrap-sass', '~>2.3'
gem 'bourbon', '4.0.2' gem 'bourbon' #, '4.0.2'
#gem 'compass-rails' #gem 'compass-rails'
gem 'js-routes' gem 'js-routes'
gem "font-awesome-rails" gem "font-awesome-rails"
@@ -96,7 +96,6 @@ group :development do
gem 'spring' gem 'spring'
gem 'spring-commands-rspec' gem 'spring-commands-rspec'
gem 'web-console', '~> 2.0.0' gem 'web-console', '~> 2.0.0'
end end
group :test do group :test do
+108 -110
View File
@@ -1,6 +1,6 @@
GIT GIT
remote: git://github.com/bterkuile/cmtool.git remote: git://github.com/bterkuile/cmtool.git
revision: 323e68bcad3b21cd580d3aff5771d99a805fc985 revision: e2f8459960eb4eff12365c6ebd60278d79eaab8f
specs: specs:
cmtool (1.0.0) cmtool (1.0.0)
bourbon bourbon
@@ -28,7 +28,7 @@ GIT
GIT GIT
remote: git://github.com/bterkuile/simply_stored.git remote: git://github.com/bterkuile/simply_stored.git
revision: 8f00644f7a8e82dba057c01f86dbb8bc3154d5d8 revision: 652caf8c2cfe4f828477f8b76d0cd201851cd53d
specs: specs:
simply_stored (1.0.0) simply_stored (1.0.0)
activesupport activesupport
@@ -59,60 +59,58 @@ GIT
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionmailer (4.2.0.rc2) actionmailer (4.2.0)
actionpack (= 4.2.0.rc2) actionpack (= 4.2.0)
actionview (= 4.2.0.rc2) actionview (= 4.2.0)
activejob (= 4.2.0.rc2) activejob (= 4.2.0)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.0.rc2) actionpack (4.2.0)
actionview (= 4.2.0.rc2) actionview (= 4.2.0)
activesupport (= 4.2.0.rc2) activesupport (= 4.2.0)
rack (~> 1.6.0.beta2) rack (~> 1.6.0)
rack-test (~> 0.6.2) rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1) rails-html-sanitizer (~> 1.0, >= 1.0.1)
actionview (4.2.0.rc2) actionview (4.2.0)
activesupport (= 4.2.0.rc2) activesupport (= 4.2.0)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1) rails-html-sanitizer (~> 1.0, >= 1.0.1)
active_decorator (0.3.4) active_decorator (0.4.0)
active_model_serializers (0.9.0) active_model_serializers (0.9.0)
activemodel (>= 3.2) activemodel (>= 3.2)
activejob (4.2.0.rc2) activejob (4.2.0)
activesupport (= 4.2.0.rc2) activesupport (= 4.2.0)
globalid (>= 0.3.0) globalid (>= 0.3.0)
activemodel (4.2.0.rc2) activemodel (4.2.0)
activesupport (= 4.2.0.rc2) activesupport (= 4.2.0)
builder (~> 3.1) builder (~> 3.1)
activerecord (4.2.0.rc2) activerecord (4.2.0)
activemodel (= 4.2.0.rc2) activemodel (= 4.2.0)
activesupport (= 4.2.0.rc2) activesupport (= 4.2.0)
arel (~> 6.0) arel (~> 6.0)
activesupport (4.2.0.rc2) activesupport (4.2.0)
i18n (>= 0.7.0.beta1, < 0.8) i18n (~> 0.7)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.1) thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.3.6) addressable (2.3.7)
arel (6.0.0) arel (6.0.0)
barber (0.5.0) barber (0.6.0)
ember-source ember-source
execjs execjs
handlebars-source (>= 1.0.0.rc.4) handlebars-source (>= 1.0.0.rc.4)
barber-emblem (0.1.1) barber-emblem (0.1.2)
barber (>= 0.4.1) barber (>= 0.4.1)
emblem-source emblem-source
bcrypt (3.1.9) bcrypt (3.1.10)
binding_of_caller (0.7.2) binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
bootstrap-sass (2.3.2.2) bourbon (4.2.0)
sass (~> 3.2) sass (~> 3.4)
bourbon (4.0.2)
sass (~> 3.3)
thor thor
builder (3.2.2) builder (3.2.2)
capistrano (3.3.5) capistrano (3.3.5)
@@ -120,7 +118,7 @@ GEM
i18n i18n
rake (>= 10.0.0) rake (>= 10.0.0)
sshkit (~> 1.3) sshkit (~> 1.3)
capistrano-bundler (1.1.3) capistrano-bundler (1.1.4)
capistrano (~> 3.1) capistrano (~> 3.1)
sshkit (~> 1.2) sshkit (~> 1.2)
capistrano-local-precompile (0.0.2) capistrano-local-precompile (0.0.2)
@@ -138,7 +136,7 @@ GEM
rack (>= 1.0.0) rack (>= 1.0.0)
rack-test (>= 0.5.4) rack-test (>= 0.5.4)
xpath (~> 2.0) xpath (~> 2.0)
capybara-screenshot (1.0.3) capybara-screenshot (1.0.5)
capybara (>= 1.0, < 3) capybara (>= 1.0, < 3)
colored colored
launchy launchy
@@ -155,7 +153,7 @@ GEM
coffee-script (2.3.0) coffee-script (2.3.0)
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.8.0) coffee-script-source (1.9.0)
colored (1.2) colored (1.2)
colorize (0.7.5) colorize (0.7.5)
cookiejar (0.3.2) cookiejar (0.3.2)
@@ -178,15 +176,15 @@ GEM
eventmachine (>= 1.0.0.beta.4) eventmachine (>= 1.0.0.beta.4)
email_validator (1.5.0) email_validator (1.5.0)
activemodel activemodel
ember-data-source (1.0.0.beta.12) ember-data-source (1.0.0.beta.14.1)
ember-source ember-source (~> 1.8)
ember-rails (0.15.1) ember-rails (0.16.3)
active_model_serializers active_model_serializers
barber (>= 0.4.1) barber (>= 0.6.0)
ember-data-source (>= 1.0.0.beta.5) ember-data-source (>= 1.0.0.beta.5)
ember-source (>= 1.1.0) ember-source (>= 1.1.0)
execjs (>= 1.2) execjs (>= 1.2)
handlebars-source (> 1.0.0) handlebars-source (> 1.0.0, < 3)
jquery-rails (>= 1.0.17) jquery-rails (>= 1.0.17)
railties (>= 3.1) railties (>= 3.1)
ember-source (1.8.1) ember-source (1.8.1)
@@ -196,62 +194,62 @@ GEM
execjs execjs
tilt tilt
ember_script-source (0.0.14) ember_script-source (0.0.14)
emblem-rails (0.2.1) emblem-rails (0.2.2)
barber-emblem (~> 0.1.1) barber-emblem (~> 0.1.1)
ember-rails (>= 0.14.0) ember-rails (>= 0.14.0)
emblem-source (0.3.17) emblem-source (0.3.18)
erubis (2.7.0) erubis (2.7.0)
eventmachine (1.0.4) eventmachine (1.0.7)
execjs (2.2.2) execjs (2.3.0)
factory_girl (4.5.0) factory_girl (4.5.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.5.0) factory_girl_rails (4.5.0)
factory_girl (~> 4.5.0) factory_girl (~> 4.5.0)
railties (>= 3.0.0) railties (>= 3.0.0)
faraday (0.9.0) faraday (0.9.1)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
faye (1.0.3) faye (1.1.0)
cookiejar (>= 0.3.0) cookiejar (>= 0.3.0)
em-http-request (>= 0.3.0) em-http-request (>= 0.3.0)
eventmachine (>= 0.12.0) eventmachine (>= 0.12.0)
faye-websocket (>= 0.7.0) faye-websocket (>= 0.9.1)
multi_json (>= 1.0.0) multi_json (>= 1.0.0)
rack (>= 1.0.0) rack (>= 1.0.0)
websocket-driver (>= 0.3.0) websocket-driver (>= 0.5.1)
faye-websocket (0.9.2) faye-websocket (0.9.2)
eventmachine (>= 0.12.0) eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1) websocket-driver (>= 0.5.1)
ffi (1.9.6) ffi (1.9.6)
font-awesome-rails (4.2.0.0) font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0) railties (>= 3.2, < 5.0)
foundation-rails (5.5.0.0) foundation-rails (5.5.1.0)
railties (>= 3.1.0) railties (>= 3.1.0)
sass (>= 3.2.0, < 3.4) sass (>= 3.3.0, < 3.5)
fuubar (2.0.0) fuubar (2.0.0)
rspec (~> 3.0) rspec (~> 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
gherkin (2.12.2) gherkin (2.12.2)
multi_json (~> 1.3) multi_json (~> 1.3)
globalid (0.3.0) globalid (0.3.3)
activesupport (>= 4.1.0) activesupport (>= 4.1.0)
handlebars-source (1.3.0) handlebars-source (1.3.0)
hashie (3.3.2) hashie (3.4.0)
hike (1.2.3) hike (1.2.3)
http_parser.rb (0.6.0) http_parser.rb (0.6.0)
i18n (0.7.0) i18n (0.7.0)
iso_country_codes (0.6.1) iso_country_codes (0.6.1)
jquery-rails (4.0.1) jquery-rails (4.0.3)
rails-dom-testing (~> 1.0) rails-dom-testing (~> 1.0)
railties (>= 4.2.0.beta) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.3) jquery-ui-rails (5.0.3)
railties (>= 3.2.16) railties (>= 3.2.16)
js-routes (0.9.9) js-routes (1.0.0)
railties (>= 3.2) railties (>= 3.2)
sprockets-rails sprockets-rails
json (1.8.2) json (1.8.2)
jwt (1.2.0) jwt (1.2.1)
kaminari (0.16.1) kaminari (0.16.3)
actionpack (>= 3.0.0) actionpack (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
launchy (2.4.3) launchy (2.4.3)
@@ -264,7 +262,7 @@ GEM
mime-types (>= 1.16, < 3) mime-types (>= 1.16, < 3)
method_source (0.8.2) method_source (0.8.2)
mime-types (1.25.1) mime-types (1.25.1)
mini_magick (4.0.1) mini_magick (4.0.4)
mini_portile (0.6.2) mini_portile (0.6.2)
minitest (5.5.1) minitest (5.5.1)
multi_json (1.10.1) multi_json (1.10.1)
@@ -272,8 +270,8 @@ GEM
multipart-post (2.0.0) multipart-post (2.0.0)
net-scp (1.2.1) net-scp (1.2.1)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
net-ssh (2.9.1) net-ssh (2.9.2)
nokogiri (1.6.5) nokogiri (1.6.6.2)
mini_portile (~> 0.6.0) mini_portile (~> 0.6.0)
oauth2 (1.0.0) oauth2 (1.0.0)
faraday (>= 0.8, < 0.10) faraday (>= 0.8, < 0.10)
@@ -304,24 +302,24 @@ GEM
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
pry-rails (0.3.2) pry-rails (0.3.3)
pry (>= 0.9.10) pry (>= 0.9.10)
quiet_assets (1.0.3) quiet_assets (1.1.0)
railties (>= 3.1, < 5.0) railties (>= 3.1, < 5.0)
rack (1.6.0) rack (1.6.0)
rack-cors (0.3.0) rack-cors (0.3.1)
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (4.2.0.rc2) rails (4.2.0)
actionmailer (= 4.2.0.rc2) actionmailer (= 4.2.0)
actionpack (= 4.2.0.rc2) actionpack (= 4.2.0)
actionview (= 4.2.0.rc2) actionview (= 4.2.0)
activejob (= 4.2.0.rc2) activejob (= 4.2.0)
activemodel (= 4.2.0.rc2) activemodel (= 4.2.0)
activerecord (= 4.2.0.rc2) activerecord (= 4.2.0)
activesupport (= 4.2.0.rc2) activesupport (= 4.2.0)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0, < 2.0)
railties (= 4.2.0.rc2) railties (= 4.2.0)
sprockets-rails sprockets-rails
rails-deprecated_sanitizer (1.0.3) rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha) activesupport (>= 4.2.0.alpha)
@@ -331,52 +329,53 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1) rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.1) rails-html-sanitizer (1.0.1)
loofah (~> 2.0) loofah (~> 2.0)
railties (4.2.0.rc2) railties (4.2.0)
actionpack (= 4.2.0.rc2) actionpack (= 4.2.0)
activesupport (= 4.2.0.rc2) activesupport (= 4.2.0)
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rake (10.4.2) rake (10.4.2)
rdoc (4.2.0) rdoc (4.2.0)
json (~> 1.4) responders (2.1.0)
responders (2.0.2) railties (>= 4.2.0, < 5)
railties (>= 4.2.0.alpha, < 5)
rest-client (1.6.8) rest-client (1.6.8)
mime-types (~> 1.16) mime-types (~> 1.16)
rdoc (>= 2.4.2) rdoc (>= 2.4.2)
rqrcode (0.4.2) rqrcode (0.4.2)
rspec (3.1.0) rspec (3.2.0)
rspec-core (~> 3.1.0) rspec-core (~> 3.2.0)
rspec-expectations (~> 3.1.0) rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.1.0) rspec-mocks (~> 3.2.0)
rspec-core (3.1.7) rspec-core (3.2.0)
rspec-support (~> 3.1.0) rspec-support (~> 3.2.0)
rspec-expectations (3.1.2) rspec-expectations (3.2.0)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0) rspec-support (~> 3.2.0)
rspec-its (1.1.0) rspec-its (1.1.0)
rspec-core (>= 3.0.0) rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0) rspec-expectations (>= 3.0.0)
rspec-mocks (3.1.3) rspec-mocks (3.2.0)
rspec-support (~> 3.1.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-rails (3.1.0) rspec-support (~> 3.2.0)
actionpack (>= 3.0) rspec-rails (3.2.0)
activesupport (>= 3.0) actionpack (>= 3.0, <= 4.2)
railties (>= 3.0) activesupport (>= 3.0, <= 4.2)
rspec-core (~> 3.1.0) railties (>= 3.0, <= 4.2)
rspec-expectations (~> 3.1.0) rspec-core (~> 3.2.0)
rspec-mocks (~> 3.1.0) rspec-expectations (~> 3.2.0)
rspec-support (~> 3.1.0) rspec-mocks (~> 3.2.0)
rspec-support (3.1.2) rspec-support (~> 3.2.0)
rspec-support (3.2.1)
ruby-progressbar (1.7.1) ruby-progressbar (1.7.1)
rubyzip (1.1.6) rubyzip (1.1.7)
safe_yaml (1.0.4) safe_yaml (1.0.4)
sass (3.3.14) sass (3.4.11)
sass-rails (5.0.0.beta1) sass-rails (5.0.1)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 5.0)
sass (~> 3.2) sass (~> 3.1)
sprockets (~> 2.12) sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (>= 2.0, < 4.0)
tilt (~> 1.1)
selenium-webdriver (2.44.0) selenium-webdriver (2.44.0)
childprocess (~> 0.5) childprocess (~> 0.5)
multi_json (~> 1.0) multi_json (~> 1.0)
@@ -387,7 +386,7 @@ GEM
multi_json (~> 1.0) multi_json (~> 1.0)
simplecov-html (~> 0.8.0) simplecov-html (~> 0.8.0)
simplecov-html (0.8.0) simplecov-html (0.8.0)
slim (3.0.1) slim (3.0.2)
temple (~> 0.7.3) temple (~> 0.7.3)
tilt (>= 1.3.3, < 2.1) tilt (>= 1.3.3, < 2.1)
slim-rails (3.0.1) slim-rails (3.0.1)
@@ -397,7 +396,7 @@ GEM
railties (>= 3.1, < 5.0) railties (>= 3.1, < 5.0)
slim (~> 3.0) slim (~> 3.0)
slop (3.6.0) slop (3.6.0)
spring (1.2.0) spring (1.3.1)
spring-commands-rspec (1.0.4) spring-commands-rspec (1.0.4)
spring (>= 0.9.1) spring (>= 0.9.1)
sprockets (2.12.3) sprockets (2.12.3)
@@ -405,7 +404,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.2.2) sprockets-rails (2.2.4)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0) sprockets (>= 2.8, < 4.0)
@@ -424,7 +423,7 @@ GEM
rspec (>= 2.14.0, < 4.0) rspec (>= 2.14.0, < 4.0)
tzinfo (1.2.2) tzinfo (1.2.2)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (2.6.0) uglifier (2.7.0)
execjs (>= 0.3.0) execjs (>= 0.3.0)
json (>= 1.8.0) json (>= 1.8.0)
warden (1.2.3) warden (1.2.3)
@@ -450,8 +449,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
active_decorator active_decorator
active_model_serializers (= 0.9.0) active_model_serializers (= 0.9.0)
bootstrap-sass (~> 2.3) bourbon
bourbon (= 4.0.2)
capistrano (~> 3.0) capistrano (~> 3.0)
capistrano-local-precompile capistrano-local-precompile
capistrano-rails (~> 1.1) capistrano-rails (~> 1.1)
@@ -485,11 +483,11 @@ DEPENDENCIES
pry-rails pry-rails
quiet_assets quiet_assets
rack-cors rack-cors
rails (= 4.2.0.rc2) rails (= 4.2.0)
rqrcode rqrcode
rspec-its rspec-its
rspec-rails rspec-rails
sass-rails (= 5.0.0.beta1) sass-rails (~> 5.0.0)
selenium-webdriver selenium-webdriver
simplecov simplecov
simply_stored! simply_stored!
@@ -1,35 +1,50 @@
App.modals.SectionArrangeTablesController = App.modals.BaseController.extend App.modals.SectionArrangeTablesController = App.modals.BaseController.extend
title_path: 'section.arrange_tables.modal.title'
arrange_type: 'distributed' # can be distributed, by_row or by_column arrange_type: 'distributed' # can be distributed, by_row or by_column
row_count: 2 row_count: 2
column_count: 2 column_count: 2
alert_message: ''
#isDistributed: ~> @arrange_type is 'distributed' #isDistributed: ~> @arrange_type is 'distributed'
#isByRow: ~> @arrange_type is 'by_row' #isByRow: ~> @arrange_type is 'by_row'
#isByColumn: ~> @arrange_type is 'by_column' #isByColumn: ~> @arrange_type is 'by_column'
isDistributed: (->@get('arrange_type') is 'distributed').property('arrange_type') isDistributed: (->@get('arrange_type') is 'distributed').property('arrange_type')
isByRow: (->@get('arrange_type') is 'by_row').property('arrange_type') isByRow: (->@get('arrange_type') is 'by_row').property('arrange_type')
isByColumn: (->@get('arrange_type') is 'by_column').property('arrange_type') isByColumn: (->@get('arrange_type') is 'by_column').property('arrange_type')
canArrangeTables: (->
unless parseFloat(@get('model.width')) > 0 and parseFloat(@get('model.height')) > 0
@set 'alert_message', t('section.arrange_tables.modal.cannot_arrange')
return false
@set 'alert_message', ''
true
).property('model.width', 'model.height')
actions: actions:
arrangeTables: -> arrangeTables: ->
return unless @isValid()
Ember.$.post Routes.arrange_tables_suppliers_section_path(@get('model.id')), Ember.$.post Routes.arrange_tables_suppliers_section_path(@get('model.id')),
option: @get('arrange_type') option: @get('arrange_type')
row_count: @get('row_count') row_count: @get('row_count')
column_count: @get('column_count') column_count: @get('column_count')
, (result,state,xhr)=> , (result,state,xhr)=>
#@store.pushPayload 'table', result
@store.pushPayload result @store.pushPayload result
@send 'close' @send 'close'
##TODO remove followin code if Ember pushPayload is working
##properly with associations
#section_id = @get('model.id')
#tables_that_should_be_in_section = @store.all('table').filter((t)->t.get('section.id') == section_id)
#current_table_ids = @get('model.tables').mapProperty('id')
#for table in tables_that_should_be_in_section.toArray()
#@get('model.tables').pushObject(table) unless table.get('id') in current_table_ids
##TODO it still does not work for the second client side action,
##soo the good old reload for now for the failing case
#window.location.reload() if result.tables.length != tables_that_should_be_in_section.toArray().length
return return
makeDistributed: -> @set 'arrange_type', 'distributed' makeDistributed: ->
makeByRow: -> @set 'arrange_type', 'by_row' @set 'arrange_type', 'distributed'
makeByColumn: -> @set 'arrange_type', 'by_column' @set 'alert_message', ''
makeByRow: ->
@set 'arrange_type', 'by_row'
@set 'alert_message', ''
makeByColumn: ->
@set 'arrange_type', 'by_column'
@set 'alert_message', ''
isValid: ->
switch @get('arrange_type')
when 'by_row'
if parseInt(@get('row_count')) < 1
@set 'alert_message', "Must at least be 1"
return false
when 'by_column'
if parseInt(@get('column_count')) < 1
@set 'alert_message', "Must at least be 1"
return false
true
@@ -6,6 +6,9 @@ App.SectionController = Ember.ObjectController.extend
finishEditable: -> finishEditable: ->
@set('editmode', false) @set('editmode', false)
@get('model').save() @get('model').save()
rollbackEditable: ->
@get('model').rollback()
@set('editmode', false)
addSection: -> @modal 'add_section', model: @get('model') addSection: -> @modal 'add_section', model: @get('model')
addTables: -> @modal 'section_add_tables', model: @get('model') addTables: -> @modal 'section_add_tables', model: @get('model')
arrangeTables: -> @modal 'section_arrange_tables', model: @get('model') arrangeTables: -> @modal 'section_arrange_tables', model: @get('model')
@@ -6,6 +6,11 @@ aside.side-menu
li: a.supplier-close-shop{action "markSupplierClosed"}= t 'supplier.close_for_orders' li: a.supplier-close-shop{action "markSupplierClosed"}= t 'supplier.close_for_orders'
else else
li: a.supplier-open-shop{action "markSupplierOpen"}= t 'supplier.open_for_orders' li: a.supplier-open-shop{action "markSupplierOpen"}= t 'supplier.open_for_orders'
= link-to "settings" class="supplier-settings-link" li
= t 'supplier.settings' =link-to 'settings' class="supplier-settings-link"
li class="supplier-sign-out-link": a{action "signOut"}= t 'supplier.sign_out' span.settings-icon
span= t 'supplier.settings'
li class="supplier-sign-out-link"
a{action "signOut"}
span.sign-out-icon
= t 'supplier.sign_out'
@@ -1,52 +1,30 @@
.modal-alert== alert_message
p=t 'section.arrange_tables.modal.body_header' p=t 'section.arrange_tables.modal.body_header'
.arrange-type-buttons if canArrangeTables
if isDistributed .arrange-type-buttons
span.arrange-tables-current-type.distributed=t 'section.arrange_tables.modal.distributed.title' if isDistributed
else span.arrange-tables-current-type.distributed=t 'section.arrange_tables.modal.distributed.title'
button.arrange-tables-type-button.distributed{action "makeDistributed"}=t 'section.arrange_tables.modal.distributed.title' else
if isByRow button.arrange-tables-type-button.distributed{action "makeDistributed"}=t 'section.arrange_tables.modal.distributed.title'
span.arrange-tables-current-type.by_row=t 'section.arrange_tables.modal.by_row.title' if isByRow
else span.arrange-tables-current-type.by_row=t 'section.arrange_tables.modal.by_row.title'
button.arrange-tables-type-button.by_row{action "makeByRow"}=t 'section.arrange_tables.modal.by_row.title' else
if isByColumn button.arrange-tables-type-button.by_row{action "makeByRow"}=t 'section.arrange_tables.modal.by_row.title'
span.arrange-tables-current-type.by_column=t 'section.arrange_tables.modal.by_column.title' if isByColumn
else span.arrange-tables-current-type.by_column=t 'section.arrange_tables.modal.by_column.title'
button.arrange-tables-type-button.by_column{action "makeByColumn"}=t 'section.arrange_tables.modal.by_column.title' else
.arrange-content button.arrange-tables-type-button.by_column{action "makeByColumn"}=t 'section.arrange_tables.modal.by_column.title'
if isDistributed .arrange-content
==t 'section.arrange_tables.modal.distributed.explanation' if isDistributed
if isByRow ==t 'section.arrange_tables.modal.distributed.explanation'
==t 'section.arrange_tables.modal.by_row.before_field' if isByRow
App.NumberField valueBinding="row_count" =t 'section.arrange_tables.modal.by_row.before_field'
==t 'section.arrange_tables.modal.by_row.after_field' App.NumberField valueBinding="row_count"
if isByColumn =t 'section.arrange_tables.modal.by_row.after_field'
==t 'section.arrange_tables.modal.by_column.before_field' if isByColumn
App.NumberField valueBinding="column_count" =t 'section.arrange_tables.modal.by_column.before_field'
==t 'section.arrange_tables.modal.by_column.after_field' App.NumberField valueBinding="column_count"
=t 'section.arrange_tables.modal.by_column.after_field'
hr hr
button.modal-close{action "close"}=t 'section.arrange_tables.modal.close_button' button.modal-close{action "close"}=t 'section.arrange_tables.modal.close_button'
button.modal-confirm.right{action "arrangeTables"}=t 'section.arrange_tables.modal.arrange_button' if canArrangeTables
button.modal-confirm.right{action "arrangeTables"}=t 'section.arrange_tables.modal.arrange_button'
/form.form-horizontal
.control-group
label.control-label for='arrange-tables-distributed' data-t='section.arrange_tables.modal.distributed' = t('supplier.section.arrange_tables.modal.distributed')
.controls
input#arrange-tables-distributed type="radio" name="arrange-table-option" checked=true value="distributed"
.control-group
label.control-label for='arrange-tables-by_row' data-t='section.arrange_tables.modal.by_row' = t('supplier.section.arrange_tables.modal.by_row')
.controls
input#arrange-tables-by_row type="radio" name="arrange-table-option" value="by_row"
label for="arrange-tables-by-row-count" data-t='section.arrange_tables.modal.by_row_count' = t('supplier.section.arrange_tables.modal.by_row_count')
input.input-mini#arrange-tables-by-row-count type="text" value=0
'
span data-t='models.plural.table'
.control-group
label.control-label for='arrange-tables-by_column' data-t='section.arrange_tables.modal.by_column' = t('supplier.section.arrange_tables.modal.by_column')
.controls
input#arrange-tables-by_column type="radio" name="arrange-table-option" value="by_column"
label for="arrange-tables-by-column-count" data-t='section.arrange_tables.modal.by_column_count' = t('supplier.section.arrange_tables.modal.by_column_count')
input.input-mini#arrange-tables-by-column-count type="text" value=0
'
span data-t='models.plural.table'
@@ -4,33 +4,18 @@
= view "section-tab-header" context=section = view "section-tab-header" context=section
a.add-section{action "addSection"}: span a.add-section{action "addSection"}: span
.section-manage-tables.pull-right .section-manage-tables.pull-right
App.DropdownLink title="Action"
ul
li: a{action "addTables"}: span.section-add-tables-icon=t 'section.add_tables.button_label'
li: a{action "arrangeTables"}: span.section-arrange-tables-icon=t 'section.arrange_tables.modal.title'
li: a href="{{route 'qr_codes_suppliers_tables_path' section_id=id}}" target="_blank": span.qr-icon=t 'table.print_qr_codes'
li: a.section-destroy{action "destroySection"}: span.section-remove-icon=t 'helpers.links.destroy'
if editmode if editmode
/.btn-group
/a.btn.dropdown-toggle data-toggle="dropdown" href="#section-background"
span Background
span.caret
ul#section-background.dropdown-menu
each texture in textures
li
a{ action "setTexture" texture }= texture
/a.tiny.button.dropdown.section-actions-menu-header href="#" data-dropdown="section-action-list" Action
/button.btn.dropdown-toggle data-toggle="dropdown"
span Action
span.caret
App.DropdownLink title="Action"
ul
li
a{action "addTables"}: span.section-add-tables-icon=t 'section.add_tables.button_label'
li
a{action "arrangeTables"}: span.section-arrange-tables-icon=t 'section.arrange_tables.modal.title'
li
a href="{{route 'qr_codes_suppliers_tables_path' section_id=id}}": span.table-qr-codes=t 'tables.qr_codes.link'
li
a.section-destroy{action "destroySection"}: span.section-remove-icon=t 'helpers.links.destroy'
= input type="text" valueBinding="title" class="section-edit-title-field" = input type="text" valueBinding="title" class="section-edit-title-field"
App.NumberField valueBinding="width" class="dimension section-edit-width-field" App.NumberField valueBinding="width" class="dimension section-edit-width-field"
span.fa.fa-lg.fa-times span.fa.fa-lg.fa-times
App.NumberField valueBinding="height" class="dimension section-edit-height-field" App.NumberField valueBinding="height" class="dimension section-edit-height-field"
a.section-rollback-button{ action "rollbackEditable" }: span
a.section-normal-mode-button{ action "finishEditable" }: span a.section-normal-mode-button{ action "finishEditable" }: span
else else
a.section-edit-mode-button{ action "makeEditable" }: span a.section-edit-mode-button{ action "makeEditable" }: span
@@ -32,8 +32,7 @@
/td.timestamp=time list.created_at /td.timestamp=time list.created_at
td.actions td.actions
a.section-dashboard-orders{action showDashboardOrders section}: span a.section-dashboard-orders{action showDashboardOrders section}: span
a.table-qr-codes{path qr_codes_suppliers_tables section_id=section.id} a.table-qr-codes{path qr_codes_suppliers_tables section_id=section.id} target="_blank": span.qr-icon
span
else else
.row: .small-12.columns .row: .small-12.columns
.panel=t 'section.none_found' .panel=t 'section.none_found'
@@ -1,4 +1,4 @@
h2=t 'settings.title' .row: .small-12.columns: h2=t 'settings.title'
.form-row .form-row
.form-label: label=t 'attributes.supplier.name' .form-label: label=t 'attributes.supplier.name'
.form-field: Ember.TextField valueBinding="controller.model.name" classNames="supplier-name" .form-field: Ember.TextField valueBinding="controller.model.name" classNames="supplier-name"
@@ -20,7 +20,8 @@
td.actions td.actions
a.table-edit{ action 'editTable' table }: span a.table-edit{ action 'editTable' table }: span
a.table-destroy{ action 'destroyTable' table }: span a.table-destroy{ action 'destroyTable' table }: span
a.button.new-table-button{action "newTable"}= t 'table.new_button' .form-actions
a.table-qr-codes{path qr_codes_suppliers_tables} a.form-action-new{action "newTable"}= t 'table.new_button'
span a.table-qr-codes{path qr_codes_suppliers_tables} target="_blank"
= t 'table.print_qr_codes' span.qr-icon
= t 'table.print_qr_codes'
@@ -0,0 +1,14 @@
App.SideMenuItemView = Ember.View.extend
classNames: 'menu-list-item'
classNameBindings: ['active']
click: ->
if @route_param
@get('controller').transitionToRoute(@route, @route_param)
else
@get('controller').transitionToRoute(@route)
active: (->
if @get('controller.currentPath') == @route then 'active' else ''
).property('controller.currentPath')
init: ->
@templateName = "side_menu/#{@route}"
@_super()
@@ -21,7 +21,6 @@ $.extend($translations.en, <%= I18n.t('supplier', locale: :en).to_json %>);
$.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>); $.extend($translations.nl, <%= I18n.t('supplier', locale: :nl).to_json %>);
String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1); } String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1); }
window.time_zones = <%= ActiveSupport::TimeZone.all.map{|tz| {name: tz.name, formatted: "GMT#{tz.formatted_offset} #{tz.name}"}}.to_json.html_safe %>; window.time_zones = <%= ActiveSupport::TimeZone.all.map{|tz| {name: tz.name, formatted: "GMT#{tz.formatted_offset} #{tz.name}"}}.to_json.html_safe %>;
window.countries = <%= IsoCountryCodes.all.map{|cc| {name: cc.name}}.to_json.html_safe %>; window.countries = <%= IsoCountryCodes.all.map{|cc| {name: cc.name}}.to_json.html_safe %>;
@@ -7,7 +7,7 @@
+button($bg: $button-index-color, $padding: $button-sml) +button($bg: $button-index-color, $padding: $button-sml)
margin-right: $button-margin margin-right: $button-margin
&.form-action-new &.form-action-new
+button($bg: $button-new-color, $padding: $button-sml) +button($padding: $button-sml)
margin-right: $button-margin margin-right: $button-margin
&.form-action-edit &.form-action-edit
+button($bg: $button-edit-color, $padding: $button-sml) +button($bg: $button-edit-color, $padding: $button-sml)
@@ -1258,8 +1258,8 @@ $alert-color: #ee3e41
$button-margin: rem-calc(10) $button-margin: rem-calc(10)
$button-qr-code-color: #555 $button-qr-code-color: #555
$button-index-color: $secondary-color $button-index-color: $secondary-color
$button-new-color: #afa $button-new-color: $primary-color
$button-edit-color: #ffa $button-edit-color: $warning-color
$button-destroy-color: #faa $button-destroy-color: $alert-color
$button-submit-color: $primary-color $button-submit-color: $primary-color
$button-cancel-color: $secondary-color $button-cancel-color: $secondary-color
@@ -1,20 +1,21 @@
.section-edit-mode-button .section-edit-mode-button
+button margin-left: 5px
margin: 0
padding: 2px
span span
@extend .fa @extend .fa
@extend .fa-lg @extend .fa-lg
@extend .fa-edit @extend .fa-edit
.section-normal-mode-button .section-normal-mode-button
+button margin-left: 5px
margin: 0
padding: 2px
margin-left: 8px
span span
@extend .fa @extend .fa
@extend .fa-lg @extend .fa-lg
@extend .fa-save @extend .fa-save
.section-rollback-button
margin-left: 5px
span
@extend .fa
@extend .fa-lg
@extend .fa-undo
.arrange-tables-type-button .arrange-tables-type-button
+button($bg: $secondary-color, $padding: $button-tny) +button($bg: $secondary-color, $padding: $button-tny)
.arrange-tables-current-type .arrange-tables-current-type
@@ -31,7 +32,7 @@
.section-manage-tables .section-manage-tables
.dropdown-container .dropdown-container
margin-right: 10px margin-right: 10px
$icon-right-margin: 8px $icon-right-margin: 12px
ul ul
list-style: none list-style: none
margin: 0 margin: 0
@@ -44,7 +45,7 @@
padding: 4px 7px padding: 4px 7px
&:hover &:hover
background-color: #ddd background-color: #ddd
span.table-qr-codes span.qr-icon
margin-right: $icon-right-margin margin-right: $icon-right-margin
.section-destroy .section-destroy
color: $alert-color color: $alert-color
@@ -20,6 +20,15 @@ aside.side-menu
.title .title
border-bottom: 1px solid #aaa border-bottom: 1px solid #aaa
margin-bottom: 4px margin-bottom: 4px
.settings-icon
margin-right: 18px
@extend .fa, .fa-gears
.about-mozo-icon
margin-right: 18px
@extend .fa, .fa-info-circle
.sign-out-icon
margin-right: 18px
@extend .fa, .fa-caret-square-o-left
.supplier-close-shop .supplier-close-shop
+alert($bg: $alert-color, $radius: true) +alert($bg: $alert-color, $radius: true)
padding: 3px padding: 3px
@@ -24,19 +24,17 @@ table
span span
@extend .fa @extend .fa
@extend .fa-pencil @extend .fa-pencil
a.table-qr-codes span.qr-icon
+button($bg: $secondary-color)
span
@extend .fa
@extend .fa-qrcode
span.table-qr-codes
@extend .fa @extend .fa
@extend .fa-qrcode @extend .fa-qrcode
+ span
padding-left: 7px
a.table-qr-codes
+button($bg: $secondary-color, $padding: $button-sml)
.table-destroy .table-destroy
+button($bg: $secondary-color) +button($bg: $secondary-color)
+button-icon-only +button-icon-only
color: $warning-color color: $warning-color
margin-left: 8px margin-left: 8px
span span
@extend .fa @extend .fa
+1 -5
View File
@@ -19,11 +19,6 @@ en:
no_lists: No active lists no_lists: No active lists
active_orders: active_orders:
no_orders: No active orders no_orders: No active orders
messages:
could_not_arrange_tables: 'The tables could not be arranged'
could_not_arrange_tables_distributed: 'The tables could not be arranged. Does the ${models.section|downcase} have a width and a height?'
could_not_arrange_tables_by_row: 'The tables could not be arranged. Does the ${models.section|downcase} have a width and a height?'
could_not_arrange_tables_by_column: 'The tables could not be arranged. Does the ${models.section|downcase} have a width and a height?'
top_menu: top_menu:
menu: Menu menu: Menu
active_lists: active_lists:
@@ -119,6 +114,7 @@ en:
after_field: ' ${models.plural.table}' after_field: ' ${models.plural.table}'
close_button: Close close_button: Close
arrange_button: Distribute arrange_button: Distribute
cannot_arrange: 'The tables could not be arranged. Does the ${models.section|downcase} have a width and a height?'
settings: settings:
title: Settings title: Settings
save: Save settings save: Save settings
+1 -5
View File
@@ -18,11 +18,6 @@ nl:
no_lists: Geen actieve ${models.plural.list} no_lists: Geen actieve ${models.plural.list}
active_orders: active_orders:
no_orders: Geen actieve ${models.plural.order} no_orders: Geen actieve ${models.plural.order}
messages:
could_not_arrange_tables: 'De ${models.plural.table} konden niet worden gepositioneerd'
could_not_arrange_tables_distributed: 'De ${models.plural.table} konden niet worden gepositioneerd. Heeft de ${models.section|downcase} een hoogte en breedte?'
could_not_arrange_tables_by_row: 'De ${models.plural.table} konden niet worden gepositioneerd. Heeft de ${models.section|downcase} een hoogte en breedte?'
could_not_arrange_tables_by_column: 'De ${models.plural.table} konden niet worden gepositioneerd. Heeft de ${models.section|downcase} een hoogte en breedte?'
top_menu: top_menu:
menu: Menu menu: Menu
active_lists: active_lists:
@@ -118,6 +113,7 @@ nl:
after_field: ' ${models.plural.table}' after_field: ' ${models.plural.table}'
close_button: Sluiten close_button: Sluiten
arrange_button: Positioneer arrange_button: Positioneer
cannot_arrange: 'De ${models.plural.table} konden niet worden gepositioneerd. Heeft de ${models.section|downcase} een hoogte en breedte?'
settings: settings:
title: Instellingen title: Instellingen
save: Instellingen opslaan save: Instellingen opslaan