Activate Ember2 for suppliers
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
source 'https://rails-assets.org'
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
gem 'rails', '~> 4.2.3'
|
gem 'rails', '~> 4.2.3'
|
||||||
@@ -9,6 +8,8 @@ gem 'rack-cors', require: 'rack/cors'
|
|||||||
|
|
||||||
# gem 'sqlite3'
|
# gem 'sqlite3'
|
||||||
|
|
||||||
|
#source 'https://rails-assets.org' do
|
||||||
|
#end
|
||||||
|
|
||||||
gem 'slim-rails'
|
gem 'slim-rails'
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ group :assets do
|
|||||||
gem 'uglifier', '>= 1.0.3'
|
gem 'uglifier', '>= 1.0.3'
|
||||||
|
|
||||||
gem 'ember-rails'
|
gem 'ember-rails'
|
||||||
#gem 'ember-source', '~> 1.13.0'
|
#gem 'ember-source', '~> 1.13.9'
|
||||||
#gem 'emblem-rails'
|
#gem 'emblem-rails'
|
||||||
gem 'ember-validations-rails'
|
gem 'ember-validations-rails'
|
||||||
gem 'ember-emblem-template'
|
gem 'ember-emblem-template'
|
||||||
|
|||||||
+54
-55
@@ -31,30 +31,29 @@ GIT
|
|||||||
rest-client (>= 1.4.2)
|
rest-client (>= 1.4.2)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rails-assets.org/
|
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
ace-rails-ap (3.0.3)
|
ace-rails-ap (4.0.0)
|
||||||
actionmailer (4.2.3)
|
actionmailer (4.2.4)
|
||||||
actionpack (= 4.2.3)
|
actionpack (= 4.2.4)
|
||||||
actionview (= 4.2.3)
|
actionview (= 4.2.4)
|
||||||
activejob (= 4.2.3)
|
activejob (= 4.2.4)
|
||||||
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.3)
|
actionpack (4.2.4)
|
||||||
actionview (= 4.2.3)
|
actionview (= 4.2.4)
|
||||||
activesupport (= 4.2.3)
|
activesupport (= 4.2.4)
|
||||||
rack (~> 1.6)
|
rack (~> 1.6)
|
||||||
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.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actionview (4.2.3)
|
actionview (4.2.4)
|
||||||
activesupport (= 4.2.3)
|
activesupport (= 4.2.4)
|
||||||
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.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
active-model-adapter-source (1.13.6)
|
active-model-adapter-source (2.0.0)
|
||||||
ember-data-source (>= 1.13, < 3.0)
|
ember-data-source (>= 1.13, < 3.0)
|
||||||
active_attr (0.8.5)
|
active_attr (0.8.5)
|
||||||
activemodel (>= 3.0.2, < 5.0)
|
activemodel (>= 3.0.2, < 5.0)
|
||||||
@@ -62,17 +61,17 @@ GEM
|
|||||||
active_decorator (0.5.3)
|
active_decorator (0.5.3)
|
||||||
active_model_serializers (0.9.3)
|
active_model_serializers (0.9.3)
|
||||||
activemodel (>= 3.2)
|
activemodel (>= 3.2)
|
||||||
activejob (4.2.3)
|
activejob (4.2.4)
|
||||||
activesupport (= 4.2.3)
|
activesupport (= 4.2.4)
|
||||||
globalid (>= 0.3.0)
|
globalid (>= 0.3.0)
|
||||||
activemodel (4.2.3)
|
activemodel (4.2.4)
|
||||||
activesupport (= 4.2.3)
|
activesupport (= 4.2.4)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
activerecord (4.2.3)
|
activerecord (4.2.4)
|
||||||
activemodel (= 4.2.3)
|
activemodel (= 4.2.4)
|
||||||
activesupport (= 4.2.3)
|
activesupport (= 4.2.4)
|
||||||
arel (~> 6.0)
|
arel (~> 6.0)
|
||||||
activesupport (4.2.3)
|
activesupport (4.2.4)
|
||||||
i18n (~> 0.7)
|
i18n (~> 0.7)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
@@ -82,15 +81,15 @@ GEM
|
|||||||
airbrussh (0.7.0)
|
airbrussh (0.7.0)
|
||||||
sshkit (>= 1.6.1, != 1.7.0)
|
sshkit (>= 1.6.1, != 1.7.0)
|
||||||
arel (6.0.3)
|
arel (6.0.3)
|
||||||
barber (0.9.1)
|
barber (0.9.2)
|
||||||
ember-source (>= 1.0, < 2)
|
ember-source (>= 1.0, < 3)
|
||||||
execjs (>= 1.2, < 3)
|
execjs (>= 1.2, < 3)
|
||||||
bcrypt (3.1.10)
|
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)
|
||||||
bourbon (4.2.3)
|
bourbon (4.2.4)
|
||||||
sass (~> 3.4)
|
sass (~> 3.4)
|
||||||
thor
|
thor (~> 0.19)
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
cancancan (1.12.0)
|
cancancan (1.12.0)
|
||||||
capistrano (3.4.0)
|
capistrano (3.4.0)
|
||||||
@@ -106,10 +105,10 @@ GEM
|
|||||||
capistrano-rvm (0.1.2)
|
capistrano-rvm (0.1.2)
|
||||||
capistrano (~> 3.0)
|
capistrano (~> 3.0)
|
||||||
sshkit (~> 1.2)
|
sshkit (~> 1.2)
|
||||||
capistrano3-puma (1.1.0)
|
capistrano3-puma (1.2.1)
|
||||||
capistrano (~> 3.0)
|
capistrano (~> 3.0)
|
||||||
puma (>= 2.6)
|
puma (>= 2.6)
|
||||||
capybara (2.4.4)
|
capybara (2.5.0)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
@@ -118,7 +117,7 @@ GEM
|
|||||||
capybara-screenshot (1.0.11)
|
capybara-screenshot (1.0.11)
|
||||||
capybara (>= 1.0, < 3)
|
capybara (>= 1.0, < 3)
|
||||||
launchy
|
launchy
|
||||||
celluloid (0.16.1)
|
celluloid (0.16.0)
|
||||||
timers (~> 4.0.0)
|
timers (~> 4.0.0)
|
||||||
childprocess (0.5.6)
|
childprocess (0.5.6)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
@@ -170,16 +169,16 @@ GEM
|
|||||||
eventmachine (>= 1.0.0.beta.4)
|
eventmachine (>= 1.0.0.beta.4)
|
||||||
email_validator (1.6.0)
|
email_validator (1.6.0)
|
||||||
activemodel
|
activemodel
|
||||||
ember-data-source (1.13.8)
|
ember-data-source (2.0.0)
|
||||||
ember-source (>= 1.8, < 3.0)
|
ember-source (>= 1.8, < 3.0)
|
||||||
ember-emblem-template (0.2.2)
|
ember-emblem-template (0.2.2)
|
||||||
barber (>= 0.9.0)
|
barber (>= 0.9.0)
|
||||||
sprockets (>= 2.1, < 3.0)
|
sprockets (>= 2.1, < 3.0)
|
||||||
ember-handlebars-template (0.3.0)
|
ember-handlebars-template (0.3.2)
|
||||||
barber (>= 0.9.0)
|
barber (>= 0.9.0)
|
||||||
sprockets (>= 2.1, < 3.3)
|
sprockets (>= 2.1, < 3.4)
|
||||||
tilt
|
tilt
|
||||||
ember-rails (0.19.0)
|
ember-rails (0.19.1)
|
||||||
active-model-adapter-source (>= 1.13.0)
|
active-model-adapter-source (>= 1.13.0)
|
||||||
active_model_serializers
|
active_model_serializers
|
||||||
ember-data-source (>= 1.13.0)
|
ember-data-source (>= 1.13.0)
|
||||||
@@ -187,12 +186,12 @@ GEM
|
|||||||
ember-source (>= 1.8.0)
|
ember-source (>= 1.8.0)
|
||||||
jquery-rails (>= 1.0.17)
|
jquery-rails (>= 1.0.17)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
ember-source (1.13.8)
|
ember-source (2.0.0)
|
||||||
ember-validations-rails (1.0.0)
|
ember-validations-rails (1.0.0)
|
||||||
railties
|
railties
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
eventmachine (1.0.8)
|
eventmachine (1.0.8)
|
||||||
execjs (2.5.2)
|
execjs (2.6.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)
|
||||||
@@ -253,7 +252,7 @@ GEM
|
|||||||
letter_opener (1.4.1)
|
letter_opener (1.4.1)
|
||||||
launchy (~> 2.2)
|
launchy (~> 2.2)
|
||||||
libv8 (3.16.14.11)
|
libv8 (3.16.14.11)
|
||||||
loofah (2.0.2)
|
loofah (2.0.3)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.6.3)
|
mail (2.6.3)
|
||||||
mime-types (>= 1.16, < 3)
|
mime-types (>= 1.16, < 3)
|
||||||
@@ -303,37 +302,37 @@ GEM
|
|||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
pry-rails (0.3.4)
|
pry-rails (0.3.4)
|
||||||
pry (>= 0.9.10)
|
pry (>= 0.9.10)
|
||||||
puma (2.12.3)
|
puma (2.13.4)
|
||||||
quiet_assets (1.1.0)
|
quiet_assets (1.1.0)
|
||||||
railties (>= 3.1, < 5.0)
|
railties (>= 3.1, < 5.0)
|
||||||
rack (1.6.4)
|
rack (1.6.4)
|
||||||
rack-cors (0.4.0)
|
rack-cors (0.4.0)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.2.3)
|
rails (4.2.4)
|
||||||
actionmailer (= 4.2.3)
|
actionmailer (= 4.2.4)
|
||||||
actionpack (= 4.2.3)
|
actionpack (= 4.2.4)
|
||||||
actionview (= 4.2.3)
|
actionview (= 4.2.4)
|
||||||
activejob (= 4.2.3)
|
activejob (= 4.2.4)
|
||||||
activemodel (= 4.2.3)
|
activemodel (= 4.2.4)
|
||||||
activerecord (= 4.2.3)
|
activerecord (= 4.2.4)
|
||||||
activesupport (= 4.2.3)
|
activesupport (= 4.2.4)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.2.3)
|
railties (= 4.2.4)
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
rails-assets-ember-qunit (0.4.9)
|
rails-assets-ember-qunit (0.4.10)
|
||||||
rails-assets-qunit (1.18.0)
|
rails-assets-qunit (1.18.0)
|
||||||
rails-deprecated_sanitizer (1.0.3)
|
rails-deprecated_sanitizer (1.0.3)
|
||||||
activesupport (>= 4.2.0.alpha)
|
activesupport (>= 4.2.0.alpha)
|
||||||
rails-dom-testing (1.0.6)
|
rails-dom-testing (1.0.7)
|
||||||
activesupport (>= 4.2.0.beta, < 5.0)
|
activesupport (>= 4.2.0.beta, < 5.0)
|
||||||
nokogiri (~> 1.6.0)
|
nokogiri (~> 1.6.0)
|
||||||
rails-deprecated_sanitizer (>= 1.0.1)
|
rails-deprecated_sanitizer (>= 1.0.1)
|
||||||
rails-html-sanitizer (1.0.2)
|
rails-html-sanitizer (1.0.2)
|
||||||
loofah (~> 2.0)
|
loofah (~> 2.0)
|
||||||
railties (4.2.3)
|
railties (4.2.4)
|
||||||
actionpack (= 4.2.3)
|
actionpack (= 4.2.4)
|
||||||
activesupport (= 4.2.3)
|
activesupport (= 4.2.4)
|
||||||
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)
|
||||||
@@ -344,7 +343,7 @@ GEM
|
|||||||
http-cookie (>= 1.0.2, < 2.0)
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
mime-types (>= 1.16, < 3.0)
|
mime-types (>= 1.16, < 3.0)
|
||||||
netrc (~> 0.7)
|
netrc (~> 0.7)
|
||||||
rqrcode (0.6.0)
|
rqrcode (0.7.0)
|
||||||
chunky_png
|
chunky_png
|
||||||
rspec (3.3.0)
|
rspec (3.3.0)
|
||||||
rspec-core (~> 3.3.0)
|
rspec-core (~> 3.3.0)
|
||||||
@@ -373,7 +372,7 @@ GEM
|
|||||||
ruby-progressbar (1.7.5)
|
ruby-progressbar (1.7.5)
|
||||||
rubyzip (1.1.7)
|
rubyzip (1.1.7)
|
||||||
safe_yaml (1.0.4)
|
safe_yaml (1.0.4)
|
||||||
sass (3.4.16)
|
sass (3.4.18)
|
||||||
sass-rails (5.0.3)
|
sass-rails (5.0.3)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
sass (~> 3.1)
|
sass (~> 3.1)
|
||||||
@@ -416,8 +415,8 @@ GEM
|
|||||||
colorize (>= 0.7.0)
|
colorize (>= 0.7.0)
|
||||||
net-scp (>= 1.1.2)
|
net-scp (>= 1.1.2)
|
||||||
net-ssh (>= 2.8.0)
|
net-ssh (>= 2.8.0)
|
||||||
sucker_punch (1.5.0)
|
sucker_punch (1.5.1)
|
||||||
celluloid (~> 0.16.0)
|
celluloid (= 0.16.0)
|
||||||
temple (0.7.6)
|
temple (0.7.6)
|
||||||
test_squad (0.0.1)
|
test_squad (0.0.1)
|
||||||
rails
|
rails
|
||||||
@@ -429,14 +428,14 @@ GEM
|
|||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
timers (4.0.1)
|
timers (4.0.1)
|
||||||
hitimes
|
hitimes
|
||||||
tinymce-rails (4.2.3)
|
tinymce-rails (4.2.4)
|
||||||
railties (>= 3.1.1)
|
railties (>= 3.1.1)
|
||||||
turnip (1.3.1)
|
turnip (1.3.1)
|
||||||
gherkin (>= 2.5)
|
gherkin (>= 2.5)
|
||||||
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.7.1)
|
uglifier (2.7.2)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
App.ApplicationView = Ember.View.extend
|
App.ApplicationView = Ember.Component.extend
|
||||||
|
layoutName: 'application'
|
||||||
classNames: ['application-view']
|
classNames: ['application-view']
|
||||||
didInsertElement: ->
|
didRender: ->
|
||||||
$('.toggle-side-menu,.side-menu').click ->
|
$('.toggle-side-menu,.side-menu').click ->
|
||||||
menu = $('.side-menu')
|
menu = $('.side-menu')
|
||||||
toggle = $('.toggle-side-menu')
|
toggle = $('.toggle-side-menu')
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
App.LanguageSwitcherButtonView = Ember.View.extend
|
App.ButtonLanguageSwitcherComponent = Ember.Component.extend
|
||||||
tagName: 'a'
|
tagName: 'a'
|
||||||
templateName: 'components/language-switcher-button'
|
layoutName: 'components/language-switcher-button'
|
||||||
classNameBindings: ['isCurrent:current']
|
classNameBindings: ['isCurrent:current']
|
||||||
classNames: ['language-switch-button']
|
classNames: ['language-switch-button']
|
||||||
isCurrent: Ember.computed 'locale', 'controller.current_locale', ->
|
isCurrent: Ember.computed 'locale', 'controller.current_locale', ->
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
App.ButtonMarkListHelpedComponent = Ember.View.extend
|
App.ButtonMarkListHelpedComponent = Ember.Component.extend
|
||||||
layoutName: 'components/button/mark-list-helped'
|
layoutName: 'components/button/mark-list-helped'
|
||||||
classNames: ['mark-list-as-helped-button']
|
classNames: ['mark-list-as-helped-button']
|
||||||
classNameBindings: ['content.needs_help:show:hide']
|
classNameBindings: ['content.needs_help:show:hide']
|
||||||
|
|||||||
+2
-3
@@ -3,9 +3,8 @@ App.ButtonMarkOrderCancelledComponent = Ember.Component.extend
|
|||||||
layoutName: 'components/button/mark-order-cancelled'
|
layoutName: 'components/button/mark-order-cancelled'
|
||||||
classNames: ['mark-order-cancelled-button']
|
classNames: ['mark-order-cancelled-button']
|
||||||
classNameBindings: ['showButton:active:hide']
|
classNameBindings: ['showButton:active:hide']
|
||||||
showButton: Ember.computed 'order.state', ->
|
showButton: Ember.computed 'order.list.state', ->
|
||||||
state = @get('order.state')
|
@get('order.list.state') is 'active'
|
||||||
state is 'placed' or state is 'active'
|
|
||||||
click: ->
|
click: ->
|
||||||
@modal 'confirm',
|
@modal 'confirm',
|
||||||
model: @get('order')
|
model: @get('order')
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
App.DashboardActiveListComponent = Ember.Component.extend
|
||||||
|
tagName: 'tr'
|
||||||
|
layoutName: 'dashboard/active-list'
|
||||||
|
classNameBindings: ['classIdentifier']
|
||||||
|
classIdentifier: Ember.computed 'list.id', -> "list-row-#{@get('list.id')}"
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
App.DashboardActiveOrderComponent = Ember.Component.extend
|
||||||
|
tagName: 'tr'
|
||||||
|
layoutName: 'dashboard/active-order'
|
||||||
|
classNameBindings: ['content.active:active', 'content.delivered:delivered', 'classIdentifier']
|
||||||
|
classIdentifier: Ember.computed 'order.id', -> "order-row-#{@get('order.id')}"
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
App.UploadFileView = Ember.TextField.extend
|
App.FormFileUploadComponent = Ember.TextField.extend
|
||||||
tagName: 'input'
|
tagName: 'input'
|
||||||
attributeBindings: ['name']
|
attributeBindings: ['name']
|
||||||
type: 'file'
|
type: 'file'
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
App.MySelectComponent = Ember.Component.extend
|
||||||
|
# possible passed-in values with their defaults:
|
||||||
|
layoutName: 'supplier/app/form/my-select'
|
||||||
|
content: null
|
||||||
|
prompt: null
|
||||||
|
optionValuePath: 'id'
|
||||||
|
optionLabelPath: 'title'
|
||||||
|
action: Ember.K # action to fire on change
|
||||||
|
selection: null
|
||||||
|
identity: true
|
||||||
|
|
||||||
|
# shadow the passed-in `selection` to avoid
|
||||||
|
# leaking changes to it via a 2-way binding
|
||||||
|
#_selection: Ember.computed.reads('selection')
|
||||||
|
|
||||||
|
setContent: (->
|
||||||
|
@set('content', []) unless @get('content')
|
||||||
|
).on('init')
|
||||||
|
|
||||||
|
actions:
|
||||||
|
change: ->
|
||||||
|
selectedIndex = @$('select:first').get(0).selectedIndex
|
||||||
|
|
||||||
|
# decrement index by 1 if we have a prompt
|
||||||
|
hasPrompt = !!@get('prompt')
|
||||||
|
contentIndex = if hasPrompt then selectedIndex - 1 else selectedIndex
|
||||||
|
|
||||||
|
selection = @get('content')[contentIndex]
|
||||||
|
|
||||||
|
# set the local, shadowed selection to avoid leaking
|
||||||
|
# changes to `selection` out via 2-way binding
|
||||||
|
@set('selection', selection)
|
||||||
|
|
||||||
|
#changeCallback(selection) if changeCallback = @get('action')
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
App.ListDisplayDateSelectorView = Ember.TextField.extend
|
App.ListDisplayDateSelectorComponent = Ember.TextField.extend
|
||||||
classNames: 'datepicker'
|
classNames: 'datepicker'
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
setTranslations @$().hide()
|
setTranslations @$().hide()
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
App.ListOrderComponent = Ember.Component.extend
|
||||||
|
layoutName: 'lists/list-order'
|
||||||
|
classNames: ['list-order-container']
|
||||||
|
classNameBindings: ['order.state']
|
||||||
@@ -41,8 +41,8 @@ App.MenuProductComponent = Ember.Component.extend
|
|||||||
@get('product').deleteRecord()
|
@get('product').deleteRecord()
|
||||||
else
|
else
|
||||||
@get('product.product_variants').forEach (product_variant)->
|
@get('product.product_variants').forEach (product_variant)->
|
||||||
product_variant.rollback()
|
product_variant.rollbackAttributes()
|
||||||
@get('product').rollback()
|
@get('product').rollbackAttributes()
|
||||||
@set 'editMode', false
|
@set 'editMode', false
|
||||||
addProductVariant: ->
|
addProductVariant: ->
|
||||||
product_variant = @get('targetObject.store').createRecord('product_variant')
|
product_variant = @get('targetObject.store').createRecord('product_variant')
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
App.ModalView = Ember.View.extend
|
App.ModalView = Ember.Component.extend
|
||||||
layoutName: 'modals/layout'
|
layoutName: 'modals/layout'
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
@$('input:first').focus()
|
@$('input:first').focus()
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
App.MyScheduleView = Ember.Component.extend
|
||||||
|
layoutName: 'my-schedule'
|
||||||
|
classNames: ['schedule-view']
|
||||||
|
didInsertElement: ->
|
||||||
|
placeholder = @$('#schedule-placeholder')
|
||||||
|
events = @get('globals.current_employee.employee_shifts').map( (employee_shift)->employee_shift.get('calendar_event_for_employee') )
|
||||||
|
placeholder.fullCalendar
|
||||||
|
header:
|
||||||
|
left: 'prev,next,today'
|
||||||
|
center: 'title'
|
||||||
|
right: 'agendaDay,agendaWeek,month'
|
||||||
|
selectable: false
|
||||||
|
defaultView: 'agendaWeek'
|
||||||
|
events: events
|
||||||
|
timezone: 'UTC'
|
||||||
|
timeFormat: 'H(:mm)'
|
||||||
|
axisFormat: 'H:mm'
|
||||||
|
lang: moment.locale()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+21
-9
@@ -1,10 +1,22 @@
|
|||||||
App.ScheduleView = Ember.View.extend
|
App.ScheduleView = Ember.Component.extend
|
||||||
|
event_changed: (event)->
|
||||||
|
@get('globals.current_employee').store.findRecord('employee-shift', event.id).then (employee_shift)->
|
||||||
|
employee_shift.set 'start_from', event.start
|
||||||
|
employee_shift.set 'end_on', event.end
|
||||||
|
employee_shift.save()
|
||||||
|
editEvent: (id, callbacks)->
|
||||||
|
if employee_shift = @get('globals.current_employee').store.peekRecord('employee-shift', id)
|
||||||
|
@modal 'employee_shift',
|
||||||
|
title_path: 'employee_shift.modal.title'
|
||||||
|
destroy_text_path: 'employee_shift.modal.destroy_confirmation'
|
||||||
|
model: employee_shift
|
||||||
|
save: -> callbacks.save.call(@, employee_shift) if callbacks.save
|
||||||
|
destroy_callback: -> callbacks.destroy.call(@, employee_shift) if callbacks.destroy
|
||||||
classNames: ['schedule-view']
|
classNames: ['schedule-view']
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
placeholder = @$('#schedule-placeholder')
|
placeholder = @$('#schedule-placeholder')
|
||||||
controller = @get('controller')
|
|
||||||
events = @get('globals.current_supplier.employee_shifts').filter((employee_shift) -> employee_shift.get('employee.active') ).map( (employee_shift)->employee_shift.get('calendar_event') )
|
events = @get('globals.current_supplier.employee_shifts').filter((employee_shift) -> employee_shift.get('employee.active') ).map( (employee_shift)->employee_shift.get('calendar_event') )
|
||||||
editable = !!controller.get('globals.current_employee.manager')
|
editable = !!@get('globals.current_employee.manager')
|
||||||
fullCalendarOptions =
|
fullCalendarOptions =
|
||||||
header:
|
header:
|
||||||
left: 'prev,next,today'
|
left: 'prev,next,today'
|
||||||
@@ -16,17 +28,17 @@ App.ScheduleView = Ember.View.extend
|
|||||||
defaultView: 'agendaWeek'
|
defaultView: 'agendaWeek'
|
||||||
events: events
|
events: events
|
||||||
timezone: 'UTC'
|
timezone: 'UTC'
|
||||||
eventDrop: controller.event_changed.bind(controller)
|
eventDrop: @event_changed.bind(@)
|
||||||
eventResize: controller.event_changed.bind(controller)
|
eventResize: @event_changed.bind(@)
|
||||||
dayClick: (date, jsEvent, view)->
|
dayClick: (date, jsEvent, view)->
|
||||||
jsEvent.preventDefault()
|
jsEvent.preventDefault()
|
||||||
if view.type is 'month'
|
if view.type is 'month'
|
||||||
placeholder.fullCalendar('changeView', 'agendaDay')
|
placeholder.fullCalendar('changeView', 'agendaDay')
|
||||||
placeholder.fullCalendar('gotoDate', date)
|
placeholder.fullCalendar('gotoDate', date)
|
||||||
false
|
false
|
||||||
eventClick: (event)->
|
eventClick: (event)=>
|
||||||
return unless editable
|
return unless editable
|
||||||
controller.editEvent event.id,
|
@editEvent event.id,
|
||||||
save: (shift)->
|
save: (shift)->
|
||||||
placeholder.fullCalendar('removeEvents', [event.id])
|
placeholder.fullCalendar('removeEvents', [event.id])
|
||||||
placeholder.fullCalendar('renderEvent', shift.get('calendar_event'), true)
|
placeholder.fullCalendar('renderEvent', shift.get('calendar_event'), true)
|
||||||
@@ -39,11 +51,11 @@ App.ScheduleView = Ember.View.extend
|
|||||||
fullCalendarOptions.select = (start, end, jsEvent, view) =>
|
fullCalendarOptions.select = (start, end, jsEvent, view) =>
|
||||||
return if view.type is 'month'
|
return if view.type is 'month'
|
||||||
format = 'dddd h:mm'
|
format = 'dddd h:mm'
|
||||||
controller.modal 'select_employee',
|
@modal 'select_employee',
|
||||||
ok: ->
|
ok: ->
|
||||||
# this context is SelectEmployeeController
|
# this context is SelectEmployeeController
|
||||||
if employee = @get('employee')
|
if employee = @get('employee')
|
||||||
shift = controller.store.createRecord 'employee-shift', start_from: start, end_on: end
|
shift = employee.store.createRecord 'employee-shift', start_from: start, end_on: end
|
||||||
shift.set 'employee', employee
|
shift.set 'employee', employee
|
||||||
shift.save().then ->
|
shift.save().then ->
|
||||||
placeholder.fullCalendar('renderEvent', shift.get('calendar_event'), true)
|
placeholder.fullCalendar('renderEvent', shift.get('calendar_event'), true)
|
||||||
@@ -23,7 +23,7 @@ App.SectionElementComponent = Ember.Component.extend DragNDrop.Draggable,
|
|||||||
# box size in dots [d]
|
# box size in dots [d]
|
||||||
box_size: (-> (@get('dpm') || 0 ) * @get('section_element.box_size')).property('dpm', 'section_element.box_size')
|
box_size: (-> (@get('dpm') || 0 ) * @get('section_element.box_size')).property('dpm', 'section_element.box_size')
|
||||||
style: Ember.computed 'offsetX', 'offsetY', 'box_size', 'section_element.rotation', ->
|
style: Ember.computed 'offsetX', 'offsetY', 'box_size', 'section_element.rotation', ->
|
||||||
"position:absolute;width:#{@get('box_size')}px;height:#{@get('box_size')}px;left:#{@get('offsetX')}px;top:#{@get('offsetY')}px"
|
"position:absolute;width:#{@get('box_size')}px;height:#{@get('box_size')}px;left:#{@get('offsetX')}px;top:#{@get('offsetY')}px".htmlSafe()
|
||||||
positionChange: (position)->
|
positionChange: (position)->
|
||||||
dpm = @get('dpm')
|
dpm = @get('dpm')
|
||||||
return if !dpm or parseFloat(dpm) is 0
|
return if !dpm or parseFloat(dpm) is 0
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ App.SectionTableComponent = Ember.Component.extend DragNDrop.Draggable,
|
|||||||
#"position:absolute;width:83px;height:48px;left:#{@get('offsetX')}px;top:#{@get('offsetY')}px"
|
#"position:absolute;width:83px;height:48px;left:#{@get('offsetX')}px;top:#{@get('offsetY')}px"
|
||||||
#).property('offsetX', 'offsetY')
|
#).property('offsetX', 'offsetY')
|
||||||
style: Ember.computed 'offsetX', 'offsetY', 'myWidth', 'myHeight', ->
|
style: Ember.computed 'offsetX', 'offsetY', 'myWidth', 'myHeight', ->
|
||||||
"position:absolute;width:#{@get('myWidth')}px;height:#{@get('myHeight')}px;left:#{@get('offsetX')}px;top:#{@get('offsetY')}px"
|
"position:absolute;width:#{@get('myWidth')}px;height:#{@get('myHeight')}px;left:#{@get('offsetX')}px;top:#{@get('offsetY')}px".htmlSafe()
|
||||||
|
|
||||||
draggable: Ember.computed.alias 'section.editmode'
|
draggable: Ember.computed.alias 'section.editmode'
|
||||||
positionChange: (position)->
|
positionChange: (position)->
|
||||||
@@ -52,7 +52,7 @@ App.SectionTableComponent = Ember.Component.extend DragNDrop.Draggable,
|
|||||||
table = @get('table')
|
table = @get('table')
|
||||||
@modal 'table_edit',
|
@modal 'table_edit',
|
||||||
model: table
|
model: table
|
||||||
close: -> table.rollback()
|
close: -> table.rollbackAttributes()
|
||||||
else
|
else
|
||||||
@$('.table-actions').toggle() if @$el.hasClass('occupied')
|
@$('.table-actions').toggle() if @$el.hasClass('occupied')
|
||||||
false
|
false
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
App.SectionsHeaderSectionComponent = Ember.Component.extend
|
||||||
|
tagName: 'dd'
|
||||||
|
attributeBindings: ['dataSectionId:data-section']
|
||||||
|
dataSectionId: Ember.computed 'section.id', -> @get('section.id')
|
||||||
@@ -3,15 +3,15 @@ App.SectionsHeaderComponent = Ember.Component.extend
|
|||||||
sections: (-> @get('targetObject.store').peekAll('section') ).property()
|
sections: (-> @get('targetObject.store').peekAll('section') ).property()
|
||||||
actions:
|
actions:
|
||||||
setSection: (section)->
|
setSection: (section)->
|
||||||
if section and section is @get('section')
|
if section and section is @get('active_section')
|
||||||
# click on already active section
|
# click on already active section
|
||||||
#return @transitionTo('section', section.id)
|
#return @transitionTo('section', section.id)
|
||||||
#return App.Router.router.transitionTo('section', section)
|
#return App.Router.router.transitionTo('section', section)
|
||||||
return @get('targetObject').transitionToRoute('section', section)
|
return @get('targetObject').transitionToRoute('section', section)
|
||||||
@$('dd').removeClass('active')
|
@$('dd').removeClass('active')
|
||||||
@$("[data-section=#{if section then section.id else 'all'}]").addClass('active')
|
@$("[data-section=#{if section then section.id else 'all'}]").addClass('active')
|
||||||
@set('section', section)
|
@set('active_section', section)
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
@$('dd').removeClass('active')
|
@$('dd').removeClass('active')
|
||||||
section = @get('section')
|
section = @get('active_section')
|
||||||
@$("[data-section=#{if section then section.id else 'all'}]").addClass('active')
|
@$("[data-section=#{if section then section.id else 'all'}]").addClass('active')
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
App.TableNumberWithInfoView = Ember.View.extend
|
App.TableNumberWithInfoComponent = Ember.Component.extend
|
||||||
tagName: 'span'
|
tagName: 'span'
|
||||||
templateName: 'table_number_with_info'
|
layoutName: 'table_number_with_info'
|
||||||
classNames: 'table-number-with-info'
|
classNames: 'table-number-with-info'
|
||||||
click: ->
|
click: ->
|
||||||
$el = $(@get('element')).find('.extra-list-info')
|
$el = $(@get('element')).find('.extra-list-info')
|
||||||
@@ -9,7 +9,7 @@ App.IndexController = Ember.Controller.extend
|
|||||||
if section_id = @get('active_section.id')
|
if section_id = @get('active_section.id')
|
||||||
lists = @get('lists').filter (l)=>( l.get('section.id') == section_id && l.get('state') == 'active' )
|
lists = @get('lists').filter (l)=>( l.get('section.id') == section_id && l.get('state') == 'active' )
|
||||||
else
|
else
|
||||||
lists = @get('lists').filterProperty('state', 'active')
|
lists = @get('lists').filterBy('state', 'active')
|
||||||
lists.sortBy('created_at') # Not reversed, oldest on top, start with oldest order first :-) Customer happyness
|
lists.sortBy('created_at') # Not reversed, oldest on top, start with oldest order first :-) Customer happyness
|
||||||
).property('lists.@each.state', 'active_section.id')
|
).property('lists.@each.state', 'active_section.id')
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ App.MenuController = Ember.Controller.extend
|
|||||||
editProductCategory: (product_category)->
|
editProductCategory: (product_category)->
|
||||||
@modal 'product_category_edit',
|
@modal 'product_category_edit',
|
||||||
model: product_category
|
model: product_category
|
||||||
close: -> product_category.rollback()
|
close: -> product_category.rollbackAttributes()
|
||||||
destroy_text_path: 'product_category.modal.destroy_confirm_text'
|
destroy_text_path: 'product_category.modal.destroy_confirm_text'
|
||||||
|
|
||||||
moveProductCategory: (product_category)->
|
moveProductCategory: (product_category)->
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
App.MyScheduleController = Ember.Controller.extend
|
#App.MyScheduleController = Ember.Controller.extend
|
||||||
actions:
|
# actions:
|
||||||
debugger: -> debugger
|
# debugger: -> debugger
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
App.ScheduleController = Ember.Controller.extend
|
#App.ScheduleController = Ember.Controller.extend
|
||||||
event_changed: (event)->
|
# event_changed: (event)->
|
||||||
@store.findRecord('employee-shift', event.id).then (employee_shift)->
|
# @store.findRecord('employee-shift', event.id).then (employee_shift)->
|
||||||
employee_shift.set 'start_from', event.start
|
# employee_shift.set 'start_from', event.start
|
||||||
employee_shift.set 'end_on', event.end
|
# employee_shift.set 'end_on', event.end
|
||||||
employee_shift.save()
|
# employee_shift.save()
|
||||||
editEvent: (id, callbacks)->
|
# editEvent: (id, callbacks)->
|
||||||
if employee_shift = @store.peekRecord('employee-shift', id)
|
# if employee_shift = @store.peekRecord('employee-shift', id)
|
||||||
@modal 'employee_shift',
|
# @modal 'employee_shift',
|
||||||
title_path: 'employee_shift.modal.title'
|
# title_path: 'employee_shift.modal.title'
|
||||||
destroy_text_path: 'employee_shift.modal.destroy_confirmation'
|
# destroy_text_path: 'employee_shift.modal.destroy_confirmation'
|
||||||
model: employee_shift
|
# model: employee_shift
|
||||||
save: -> callbacks.save.call(@, employee_shift) if callbacks.save
|
# save: -> callbacks.save.call(@, employee_shift) if callbacks.save
|
||||||
destroy_callback: -> callbacks.destroy.call(@, employee_shift) if callbacks.destroy
|
# destroy_callback: -> callbacks.destroy.call(@, employee_shift) if callbacks.destroy
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
App.SectionController = Ember.Controller.extend
|
App.SectionController = Ember.Controller.extend
|
||||||
#needs: ['application', 'sections', 'section'] #wtf? section, otherwise an Ember error
|
#needs: ['application', 'sections', 'section'] #wtf? section, otherwise an Ember error
|
||||||
actions:
|
actions:
|
||||||
makeEditable: -> @set('model.editmode', true)
|
makeEditable: ->
|
||||||
|
@set('model.editmode', true)
|
||||||
|
false
|
||||||
finishEditable: ->
|
finishEditable: ->
|
||||||
@set('model.editmode', false)
|
@set('model.editmode', false)
|
||||||
@get('model').save()
|
@get('model').save()
|
||||||
@get('model.tables').filterProperty('hasDirtyAttributes').invoke 'save'
|
@get('model.tables').filterBy('hasDirtyAttributes').invoke 'save'
|
||||||
@get('model.section_elements').filterProperty('hasDirtyAttributes').invoke 'save'
|
@get('model.section_elements').filterBy('hasDirtyAttributes').invoke 'save'
|
||||||
@get('model.section_areas').filterProperty('hasDirtyAttributes').invoke 'save'
|
@get('model.section_areas').filterBy('hasDirtyAttributes').invoke 'save'
|
||||||
rollbackEditable: ->
|
rollbackEditable: ->
|
||||||
@get('model').rollback()
|
@get('model').rollbackAttributes()
|
||||||
@get('model.tables').forEach (table) ->
|
@get('model.tables').forEach (table) ->
|
||||||
if table.get('isNew')
|
if table.get('isNew')
|
||||||
table.deleteRecord()
|
table.deleteRecord()
|
||||||
else
|
else
|
||||||
table.rollback()
|
table.rollbackAttributes()
|
||||||
@get('model.section_elements').forEach (section_element) ->
|
@get('model.section_elements').forEach (section_element) ->
|
||||||
if section_element.get('isNew')
|
if section_element.get('isNew')
|
||||||
section_element.deleteRecord()
|
section_element.deleteRecord()
|
||||||
else
|
else
|
||||||
section_element.rollback()
|
section_element.rollbackAttributes()
|
||||||
@get('model.section_areas').forEach (section_area) ->
|
@get('model.section_areas').forEach (section_area) ->
|
||||||
if section_area.get('isNew')
|
if section_area.get('isNew')
|
||||||
section_area.deleteRecord()
|
section_area.deleteRecord()
|
||||||
else
|
else
|
||||||
section_area.rollback()
|
section_area.rollbackAttributes()
|
||||||
@set('model.editmode', false)
|
@set('model.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')
|
||||||
@@ -51,7 +53,7 @@ App.SectionController = Ember.Controller.extend
|
|||||||
if section_area.get('isNew')
|
if section_area.get('isNew')
|
||||||
section_area.deleteRecord()
|
section_area.deleteRecord()
|
||||||
else
|
else
|
||||||
section_area.rollback()
|
section_area.rollbackAttributes()
|
||||||
textures: ['wood1', 'wood2']
|
textures: ['wood1', 'wood2']
|
||||||
|
|
||||||
#sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
#sections: (-> @get('controllers.sections.model')).property('controllers.sections.model')
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
App.SettingsController = Ember.Controller.extend
|
App.SettingsController = Ember.Controller.extend
|
||||||
supplier: Ember.computed.alias 'globals.current_supplier'
|
#supplier: Ember.computed.alias 'globals.current_supplier'
|
||||||
time_zones: (-> window.time_zones ).property()
|
time_zones: (-> window.time_zones ).property()
|
||||||
countries: (-> window.countries ).property()
|
countries: (-> window.countries.map (el)-> el.name ).property()
|
||||||
saving: false
|
saving: false
|
||||||
editIensProfile: (-> @get('supplier.country') is 'Netherlands' ).property('supplier.country')
|
editIensProfile: Ember.computed 'globals.current_supplier.country', ->
|
||||||
|
@get('globals.current_supplier.country') is 'Netherlands'
|
||||||
actions:
|
actions:
|
||||||
saveSettings: ->
|
saveSettings: ->
|
||||||
@set 'saving', true
|
@set 'saving', true
|
||||||
@get('supplier').save().then (supplier) =>
|
@get('globals.current_supplier').save().then (supplier) =>
|
||||||
@set 'saving', false
|
@set 'saving', false
|
||||||
$('.top-menu .supplier-name').text @get('supplier.name')
|
#$('.top-menu .supplier-name').text @get('globals.current_supplier.name')
|
||||||
@transitionToRoute 'index'
|
@transitionToRoute 'index'
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
App.IsEqualHelper = Ember.Helper.helper ([lhs, rhs])->
|
||||||
|
lhs is rhs
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
App.IsNotHelper = Ember.Helper.helper ([value])->
|
||||||
|
return !value
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
App.ReadPathHelper = Ember.Helper.helper ([object, path])->
|
||||||
|
Ember.get(object, path)
|
||||||
@@ -40,7 +40,6 @@ App.List = DS.Model.extend
|
|||||||
).property('relevant_orders.@each.total')
|
).property('relevant_orders.@each.total')
|
||||||
has_active_orders: (->
|
has_active_orders: (->
|
||||||
return false unless @get('state') == 'active'
|
return false unless @get('state') == 'active'
|
||||||
#!!@get('orders').filterProperty('state', 'active').length
|
|
||||||
!!@get('orders').filter( (order) -> order.get('state') is 'active' or order.get('state') is 'placed').length
|
!!@get('orders').filter( (order) -> order.get('state') is 'active' or order.get('state') is 'placed').length
|
||||||
).property('state', 'orders.@each.state')
|
).property('state', 'orders.@each.state')
|
||||||
close: ->
|
close: ->
|
||||||
|
|||||||
@@ -13,4 +13,3 @@ ControllerExtensions = Ember.Mixin.create
|
|||||||
all_sections: (-> @store.peekAll('section')).property()
|
all_sections: (-> @store.peekAll('section')).property()
|
||||||
|
|
||||||
Ember.Controller.reopen ControllerExtensions
|
Ember.Controller.reopen ControllerExtensions
|
||||||
Ember.ArrayController.reopen ControllerExtensions # Added for auto generated employeesController Ember 1,13.5
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ App.ApplicationRoute = Ember.Route.extend
|
|||||||
editTable: (table)->
|
editTable: (table)->
|
||||||
@send 'openModal', 'table_edit',
|
@send 'openModal', 'table_edit',
|
||||||
model: table
|
model: table
|
||||||
close: -> table.rollback()
|
close: -> table.rollbackAttributes()
|
||||||
events:
|
events:
|
||||||
list_needs_help: (data) ->
|
list_needs_help: (data) ->
|
||||||
if list = @store.getById('list', data.id)
|
if list = @store.getById('list', data.id)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ App.EmployeesRoute = Ember.Route.extend
|
|||||||
@get('controller').modal 'employee_edit',
|
@get('controller').modal 'employee_edit',
|
||||||
model: employee
|
model: employee
|
||||||
title_path: 'employee.modal.edit_title'
|
title_path: 'employee.modal.edit_title'
|
||||||
close: -> employee.rollback()
|
close: -> employee.rollbackAttributes()
|
||||||
destroyEmployee: (employee)->
|
destroyEmployee: (employee)->
|
||||||
ac = @controllerFor('application')
|
ac = @controllerFor('application')
|
||||||
if ac.get('employee.id') isnt employee.id
|
if ac.get('employee.id') isnt employee.id
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
# controller.set('model', model)
|
# controller.set('model', model)
|
||||||
# #$('#section_selector').on 'change', (-> controller.set('sectionId', $(this).val()))
|
# #$('#section_selector').on 'change', (-> controller.set('sectionId', $(this).val()))
|
||||||
# #controller.set 'lists', @store.peekAll('list')
|
# #controller.set 'lists', @store.peekAll('list')
|
||||||
# #controller.set 'lists', App.List.all() #.filterProperty('state', 'active')
|
# #controller.set 'lists', App.List.all() #.filterBy('state', 'active')
|
||||||
# #controller.set 'orders', App.Order.all()
|
# #controller.set 'orders', App.Order.all()
|
||||||
# #controller.set 'lists', model.get('lists')
|
# #controller.set 'lists', model.get('lists')
|
||||||
# #controller.set 'orders', model.get('orders')
|
# #controller.set 'orders', model.get('orders')
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ App.CssObject = Ember.Object.extend
|
|||||||
if @pixel_fields.indexOf(k) > -1
|
if @pixel_fields.indexOf(k) > -1
|
||||||
v = "#{v}px" if @isNumeric.test(v)
|
v = "#{v}px" if @isNumeric.test(v)
|
||||||
ret += "#{k}:#{v};"
|
ret += "#{k}:#{v};"
|
||||||
ret
|
ret.htmlSafe()
|
||||||
|
|||||||
@@ -20,14 +20,7 @@ if list.closed_at
|
|||||||
if list.sorted_orders
|
if list.sorted_orders
|
||||||
.list-orders-container
|
.list-orders-container
|
||||||
each list.sorted_orders as |order|
|
each list.sorted_orders as |order|
|
||||||
.list-order-container class=order.state
|
= list-order order=order
|
||||||
= order.display
|
|
||||||
span.currency= currency order.total
|
|
||||||
span.created_at= time order.created_at
|
|
||||||
.list-order-actions
|
|
||||||
= button-mark-order-active order=order
|
|
||||||
= button-mark-order-delivered order=order
|
|
||||||
= button-mark-order-cancelled order=order
|
|
||||||
if showTotal
|
if showTotal
|
||||||
.list-orders-total.total
|
.list-orders-total.total
|
||||||
= t 'general.total'
|
= t 'general.total'
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
td.user-info.show-for-large-up
|
|
||||||
each view.content.users as |user|
|
|
||||||
= user.avatar_tag
|
|
||||||
td.status-icons
|
|
||||||
if view.content.needs_help
|
|
||||||
span.icon.needs-help
|
|
||||||
if view.content.needs_payment
|
|
||||||
|
|
|
||||||
span.icon.needs-payment
|
|
||||||
td.numeric.table_number= view "table-number-with-info" contextBinding="view.content"
|
|
||||||
td.section_title: link-to 'section' view.content.table.section.id: span=view.content.table.section.title
|
|
||||||
td.currency.total_list_amount=currency view.content.total
|
|
||||||
td.actions
|
|
||||||
/ if view.content.needs_help
|
|
||||||
button.mark-list-as-helped-button{ action "markListAsHelped" view.content.id}
|
|
||||||
span.fa-stack.fa-2x.fa-stack-sized
|
|
||||||
i.fa.fa-bell.fa-stack-small
|
|
||||||
i.fa.fa-ban.revoke
|
|
||||||
/= view "mark-list-helped-button" content=view.content
|
|
||||||
= button-mark-list-helped content=view.content
|
|
||||||
/= view "remove-list-needs-payment" content=view.content
|
|
||||||
/= view "close-list-button" content=view.content
|
|
||||||
= button-close-list content=view.content
|
|
||||||
|
|
||||||
button.show-list.button{action "showList" view.content.id}: span
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
td.user-info.show-for-large-up
|
|
||||||
each view.content.list.users as |user|
|
|
||||||
= user.avatar_tag
|
|
||||||
td.status-icons
|
|
||||||
if view.content.active
|
|
||||||
span.active-order.fa.fa-check.fa-lg
|
|
||||||
td= view.content.display
|
|
||||||
td.numeric.table_number= view "table-number-with-info" contextBinding="view.content.list"
|
|
||||||
td.section_title= link-to 'section' view.content.list.table.section.id: span=view.content.list.table.section.title
|
|
||||||
td.currency=currency view.content.total
|
|
||||||
td.time= time view.content.created_at format="HH:mm"
|
|
||||||
td.actions
|
|
||||||
= button-mark-order-active order=view.content
|
|
||||||
= button-mark-order-delivered order=view.content
|
|
||||||
= button-mark-order-cancelled order=view.content
|
|
||||||
@@ -2,6 +2,6 @@ if gravatar
|
|||||||
span.dropdown-trigger.gravatar= gravatar-image gravatar
|
span.dropdown-trigger.gravatar= gravatar-image gravatar
|
||||||
else
|
else
|
||||||
span.dropdown-trigger.button.tiny.dropdown
|
span.dropdown-trigger.button.tiny.dropdown
|
||||||
span.dropdown-trigger-text= view.title
|
span.dropdown-trigger-text= title
|
||||||
.dropdown-list-container
|
.dropdown-list-container
|
||||||
= yield
|
= yield
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
= flag view.locale
|
= flag locale
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
each locales as |locale|
|
each locales as |locale|
|
||||||
view "language-switcher-button" locale=locale
|
= button-language-switcher locale=locale
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if editMode
|
|||||||
= descriptionPlaceholder
|
= descriptionPlaceholder
|
||||||
= textarea value=product.description placeholder=descriptionPlaceholder
|
= textarea value=product.description placeholder=descriptionPlaceholder
|
||||||
.small-12.medium-6.columns
|
.small-12.medium-6.columns
|
||||||
= view "upload-file" name="image" accept="image/*" file=product.image
|
= form-file-upload name="image" accept="image/*" file=product.image
|
||||||
img src=product.image_src
|
img src=product.image_src
|
||||||
each product.product_variants as |product_variant|
|
each product.product_variants as |product_variant|
|
||||||
.row
|
.row
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ else
|
|||||||
.menu-time-preview-selection-container
|
.menu-time-preview-selection-container
|
||||||
a.close-time-preview-handle{action "closeTimePreview"}: span
|
a.close-time-preview-handle{action "closeTimePreview"}: span
|
||||||
h4= t 'product_category.time_preview.title'
|
h4= t 'product_category.time_preview.title'
|
||||||
= view "select" content=daysContent optionValuePath="content.value" optionLabelPath="content.text" selection=preview_day prompt=" -- "
|
= my-select content=daysContent optionValuePath="value" optionLabelPath="text" selection=preview_day prompt=" -- "
|
||||||
br
|
br
|
||||||
= boolean-button value=preview_full_day reverse=true text_path="product_category.time_preview.active_at"
|
= boolean-button value=preview_full_day reverse=true text_path="product_category.time_preview.active_at"
|
||||||
unless preview_full_day
|
unless preview_full_day
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
dl.sections-header-container.sub-nav
|
dl.sections-header-container.sub-nav
|
||||||
dd data-section="all": a.section-header-title{action "setSection"} href="" = t 'sections_header.all_sections'
|
dd data-section="all": a.section-header-title{action "setSection"} href="" = t 'sections_header.all_sections'
|
||||||
each sections as |section|
|
each sections as |section|
|
||||||
dd data-section=section.id
|
= sections-header-section section=section
|
||||||
a.section-header-title{action "setSection" section} href="#" = section.title
|
a.section-header-title{action "setSection" section} href="#"
|
||||||
|
= section.title
|
||||||
/= link-to "section" section.id class="section-jumper"
|
/= link-to "section" section.id class="section-jumper"
|
||||||
span.fa.fa-chevron-circle-right
|
span.fa.fa-chevron-circle-right
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
td.user-info.show-for-large-up
|
||||||
|
h3= list.users.length
|
||||||
|
each list.users as |user|
|
||||||
|
= user.avatar_tag
|
||||||
|
td.status-icons
|
||||||
|
if list.needs_help
|
||||||
|
span.icon.needs-help
|
||||||
|
if list.needs_payment
|
||||||
|
|
|
||||||
|
span.icon.needs-payment
|
||||||
|
td.numeric.table_number= table-number-with-info list=list
|
||||||
|
td.section_title: link-to 'section' list.table.section.id: span=list.table.section.title
|
||||||
|
td.currency.total_list_amount=currency list.total
|
||||||
|
td.actions
|
||||||
|
/ if list.needs_help
|
||||||
|
button.mark-list-as-helped-button{ action "markListAsHelped" list.id}
|
||||||
|
span.fa-stack.fa-2x.fa-stack-sized
|
||||||
|
i.fa.fa-bell.fa-stack-small
|
||||||
|
i.fa.fa-ban.revoke
|
||||||
|
/= view "mark-list-helped-button" content=list
|
||||||
|
= button-mark-list-helped content=list
|
||||||
|
/= view "remove-list-needs-payment" content=list
|
||||||
|
/= view "close-list-button" content=list
|
||||||
|
= button-close-list content=list
|
||||||
|
|
||||||
|
button.show-list.button{action "showList" list.id}: span
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
td.user-info.show-for-large-up
|
||||||
|
each order.list.users as |user|
|
||||||
|
= user.avatar_tag
|
||||||
|
td.status-icons
|
||||||
|
if order.active
|
||||||
|
span.active-order.fa.fa-check.fa-lg
|
||||||
|
td= order.display
|
||||||
|
td.numeric.table_number= table-number-with-info list=order.list
|
||||||
|
td.section_title= link-to 'section' order.list.table.section.id: span=order.list.table.section.title
|
||||||
|
td.currency=currency order.total
|
||||||
|
td.time= time order.created_at format="HH:mm"
|
||||||
|
td.actions
|
||||||
|
= button-mark-order-active order=order
|
||||||
|
= button-mark-order-delivered order=order
|
||||||
|
= button-mark-order-cancelled order=order
|
||||||
@@ -14,6 +14,6 @@
|
|||||||
.display-field: span.current-color= colorbox model.color
|
.display-field: span.current-color= colorbox model.color
|
||||||
.page-actions
|
.page-actions
|
||||||
.small-12.columns
|
.small-12.columns
|
||||||
link-to 'employees' class="button"
|
= link-to 'employees' class="button"
|
||||||
span=t 'models.plural.employee'
|
span=t 'models.plural.employee'
|
||||||
a.edit-button{ action 'editEmployee' model}= t 'helpers.links.edit'
|
a.edit-button{ action 'editEmployee' model}= t 'helpers.links.edit'
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
= input type="checkbox" id=view.switchId checked=value
|
= input type="checkbox" id=switchId checked=value
|
||||||
label for=switchId
|
label for=switchId
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<select {{action 'change' on='change'}}>
|
||||||
|
{{#if prompt}}
|
||||||
|
<option selected={{is-not selection}}>
|
||||||
|
{{prompt}}
|
||||||
|
</option>
|
||||||
|
{{/if}}
|
||||||
|
{{#if identity}}
|
||||||
|
{{#each content key="@identity" as |item|}}
|
||||||
|
<option value="{{read-path item optionValuePath}}" selected={{is-equal item selection}}>
|
||||||
|
{{read-path item optionLabelPath}}
|
||||||
|
</option>
|
||||||
|
{{/each}}
|
||||||
|
{{else}}
|
||||||
|
{{#each content key="@index" as |item|}}
|
||||||
|
<option value="{{item}}" selected={{is-equal item selection}}>
|
||||||
|
{{item}}
|
||||||
|
</option>
|
||||||
|
{{/each}}
|
||||||
|
{{/if}}
|
||||||
|
</select>
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
.row.select-minute-of-day
|
.row.select-minute-of-day
|
||||||
.small-5.columns
|
.small-5.columns= my-select content=hours_list selection=hour identity=false
|
||||||
view "select" content=view.hours_list value=view.hour
|
.small-1.columns: span
|
||||||
.small-1.columns: span :
|
.small-5.columns.end= my-select content=minutes_list selection=minute identity=false
|
||||||
.small-5.columns.end
|
|
||||||
view "select" content=view.minutes_list value=view.minute
|
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
.row: .small-12.columns
|
.row: .small-12.columns
|
||||||
= sections-header section=globals.active_section
|
= sections-header active_section=globals.active_section
|
||||||
if (can "manage" globals.current_supplier)
|
if (can "manage" globals.current_supplier)
|
||||||
unless globals.current_supplier.open
|
unless globals.current_supplier.open
|
||||||
.alert-box.alert.radius data-alert=true
|
.alert-box.alert.radius data-alert=true
|
||||||
= t 'supplier.you_are_currently_closed_alert'
|
= t 'supplier.you_are_currently_closed_alert'
|
||||||
a{ action "markSupplierOpen" }= t 'supplier.open_for_orders'
|
a{ action "markSupplierOpen" }= t 'supplier.open_for_orders'
|
||||||
.page-header
|
.page-header
|
||||||
div.dashboard-section-selection
|
|
||||||
/App.HomeSectionSelectorView selectionBinding="globals.active_section" content=controller.sections prompt=globals.current_supplier.name
|
|
||||||
/= home-section-selector sectionBinding="globals.active_section"
|
|
||||||
/= view "home-section-jumper"
|
|
||||||
if active_lists.length
|
if active_lists.length
|
||||||
h3.dashboard-lists-header{action "toggleDashboardLists"}
|
h3.dashboard-lists-header{action "toggleDashboardLists"}
|
||||||
if show_lists
|
if show_lists
|
||||||
@@ -32,7 +28,9 @@
|
|||||||
th.actions
|
th.actions
|
||||||
tbody
|
tbody
|
||||||
each active_lists as |list|
|
each active_lists as |list|
|
||||||
= view "active-list" content=list
|
tr
|
||||||
|
td= list.users.length
|
||||||
|
= dashboard-active-list list=list
|
||||||
.page-header
|
.page-header
|
||||||
if active_orders.length
|
if active_orders.length
|
||||||
h3.dashboard-orders-header{action "toggleDashboardOrders"}
|
h3.dashboard-orders-header{action "toggleDashboardOrders"}
|
||||||
@@ -58,4 +56,4 @@
|
|||||||
th.actions
|
th.actions
|
||||||
tbody
|
tbody
|
||||||
each active_orders as |order|
|
each active_orders as |order|
|
||||||
= view "active-order" content=order
|
= dashboard-active-order order=order
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.row: .small-12.columns
|
.row: .small-12.columns
|
||||||
h2.main-section-header=t 'models.plural.list'
|
h2.main-section-header=t 'models.plural.list'
|
||||||
= view "list-display-date-selector" valueBinding="date"
|
= list-display-date-selector value=date
|
||||||
if sorted_lists
|
if sorted_lists
|
||||||
table.table
|
table.table
|
||||||
thead
|
thead
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
= order.display
|
||||||
|
span.currency= currency order.total
|
||||||
|
span.created_at= time order.created_at
|
||||||
|
.list-order-actions
|
||||||
|
= button-mark-order-active order=order
|
||||||
|
= button-mark-order-delivered order=order
|
||||||
|
= button-mark-order-cancelled order=order
|
||||||
@@ -4,7 +4,7 @@ p=t 'table.modal.body_header'
|
|||||||
.form-field= number-field numericValue=model.number
|
.form-field= number-field numericValue=model.number
|
||||||
.form-row.section
|
.form-row.section
|
||||||
.form-label=t 'models.section'
|
.form-label=t 'models.section'
|
||||||
.form-field= view "select" content=sections selectionBinding="model.section" optionLabelPath="content.title" optionValuePath="content.id"
|
.form-field= my-select content=sections selection=model.section optionLabelPath="title" optionValuePath="id"
|
||||||
.form-row.width
|
.form-row.width
|
||||||
.form-label=t 'attributes.table.width'
|
.form-label=t 'attributes.table.width'
|
||||||
.form-field= number-field numericValue=model.width
|
.form-field= number-field numericValue=model.width
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
= sections-header sectionBinding="section"
|
= sections-header active_section=section
|
||||||
table.table
|
table.table
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
@@ -19,7 +19,9 @@ table.table
|
|||||||
if order.active
|
if order.active
|
||||||
span.active-order.fa.fa-check.fa-lg
|
span.active-order.fa.fa-check.fa-lg
|
||||||
td= order.display
|
td= order.display
|
||||||
td.numeric.table_number: App.TableNumberWithInfoView contextBinding="order.list"
|
td.numeric.table_number=table-number-with-info list=order.list
|
||||||
td.section_title: link-to 'section' order.list.table.section.id: span=order.list.table.section.title
|
td.section_title
|
||||||
|
= link-to 'section' order.list.table.section.id
|
||||||
|
span=order.list.table.section.title
|
||||||
td.currency=currency order.total
|
td.currency=currency order.total
|
||||||
td.time= time order.created_at format="HH:mm"
|
td.time= time order.created_at format="HH:mm"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.row: .small-12.columns
|
.row: .small-12.columns
|
||||||
h2.main-section-header=model.title
|
h2.main-section-header=model.title
|
||||||
/= page-body model.body
|
/= page-body model.body
|
||||||
view "page-body" templateBody=model.body
|
= page-body templateBody=model.body
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
.row: .small-12.columns: 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= input type="text" value=supplier.name class="supplier-name"
|
.form-field= input type="text" value=globals.current_supplier.name class="supplier-name"
|
||||||
.form-row
|
.form-row
|
||||||
.form-label: label=t 'attributes.supplier.email'
|
.form-label: label=t 'attributes.supplier.email'
|
||||||
.form-field= input value=supplier.email type="email" class="supplier-email"
|
.form-field= input value=globals.current_supplier.email type="email" class="supplier-email"
|
||||||
/input.location_picker name="location" type="text" valueBinding="location"
|
/input.location_picker name="location" type="text" valueBinding="location"
|
||||||
/.form-row
|
/.form-row
|
||||||
.location_picker_map
|
.location_picker_map
|
||||||
@@ -16,24 +16,24 @@
|
|||||||
.form-label: label=t 'attributes.supplier.address'
|
.form-label: label=t 'attributes.supplier.address'
|
||||||
.form-field.full
|
.form-field.full
|
||||||
.row
|
.row
|
||||||
.large-8.medium-8.columns= input value=supplier.address
|
.large-8.medium-8.columns= input value=globals.current_supplier.address
|
||||||
.large-1.show-for-large-up.columns
|
.large-1.show-for-large-up.columns
|
||||||
.large-2.medium-2.small-3.columns= number-field numericValue=supplier.house_number
|
.large-2.medium-2.small-3.columns= number-field numericValue=globals.current_supplier.house_number
|
||||||
.large-1.medium-2.small-2.columns= input value=supplier.house_number_addition
|
.large-1.medium-2.small-2.columns= input value=globals.current_supplier.house_number_addition
|
||||||
.form-row
|
.form-row
|
||||||
.form-label: label=t 'attributes.supplier.postal_code'
|
.form-label: label=t 'attributes.supplier.postal_code'
|
||||||
.form-field= input value=supplier.postal_code
|
.form-field= input value=globals.current_supplier.postal_code
|
||||||
.form-row
|
.form-row
|
||||||
.form-label: label=t 'attributes.supplier.city'
|
.form-label: label=t 'attributes.supplier.city'
|
||||||
.form-field= input value=supplier.city
|
.form-field= input value=globals.current_supplier.city
|
||||||
.form-row
|
.form-row
|
||||||
.form-label: label=t 'attributes.supplier.country'
|
.form-label: label=t 'attributes.supplier.country'
|
||||||
.form-field: view "select" content=countries optionValuePath="content.name" optionLabelPath="content.name" value=supplier.country
|
.form-field: my-select content=countries selection=globals.current_supplier.country identity=false
|
||||||
if editIensProfile
|
if editIensProfile
|
||||||
.form-row
|
.form-row
|
||||||
.form-label: label=t 'attributes.supplier.iens_profile'
|
.form-label: label=t 'attributes.supplier.iens_profile'
|
||||||
.form-field
|
.form-field
|
||||||
= number-field numericValue=supplier.iens_profile
|
= number-field numericValue=globals.current_supplier.iens_profile
|
||||||
= image-tag 'supplier/settings/iens-example.png'
|
= image-tag 'supplier/settings/iens-example.png'
|
||||||
span=t "settings.reviews.explanation"
|
span=t "settings.reviews.explanation"
|
||||||
.row: .small-12.columns= language-switcher
|
.row: .small-12.columns= language-switcher
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
.number= table.number
|
.number= list.table.number
|
||||||
.extra-list-info
|
.extra-list-info
|
||||||
span.loading.medium
|
span.loading.medium
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
App.ActiveListView = Ember.View.extend
|
|
||||||
tagName: 'tr'
|
|
||||||
templateName: 'active_list'
|
|
||||||
classNameBindings: ['classIdentifier']
|
|
||||||
classIdentifier: (-> "list-row-#{@get('content.id')}").property()
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
App.ActiveOrderView = Ember.View.extend
|
|
||||||
tagName: 'tr'
|
|
||||||
templateName: 'active_order'
|
|
||||||
classNameBindings: ['content.active:active', 'content.delivered:delivered', 'classIdentifier']
|
|
||||||
classIdentifier: (-> "order-row-#{@get('content.id')}").property()
|
|
||||||
didInsertElement: ->
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
App.MarkOrderCancelledView = Ember.View.extend
|
#App.MarkOrderCancelledView = Ember.View.extend
|
||||||
tagName: 'button'
|
# tagName: 'button'
|
||||||
templateName: 'buttons/mark-order-cancelled'
|
# templateName: 'buttons/mark-order-cancelled'
|
||||||
classNames: ['mark-order-cancelled-button']
|
# classNames: ['mark-order-cancelled-button']
|
||||||
classNameBindings: ['showButton:active:hide']
|
# classNameBindings: ['showButton:active:hide']
|
||||||
showButton: Ember.computed 'order.state', ->
|
# showButton: Ember.computed 'order.state', ->
|
||||||
state = @get('order.state')
|
# state = @get('order.state')
|
||||||
state is 'placed' or state is 'active'
|
# state is 'placed' or state is 'active'
|
||||||
click: -> @get('order').mark_cancelled()
|
# click: -> @get('order').mark_cancelled()
|
||||||
|
#
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
App.MyScheduleView = Ember.View.extend
|
|
||||||
classNames: ['schedule-view']
|
|
||||||
didInsertElement: ->
|
|
||||||
placeholder = @$('#schedule-placeholder')
|
|
||||||
controller = @get('controller')
|
|
||||||
events = @get('globals.current_employee.employee_shifts').map( (employee_shift)->employee_shift.get('calendar_event_for_employee') )
|
|
||||||
placeholder.fullCalendar
|
|
||||||
header:
|
|
||||||
left: 'prev,next,today'
|
|
||||||
center: 'title'
|
|
||||||
right: 'agendaDay,agendaWeek,month'
|
|
||||||
selectable: false
|
|
||||||
#selectHelper: true
|
|
||||||
#select: (start, end)=>
|
|
||||||
#format = 'dddd h:mm'
|
|
||||||
#controller.modal 'select_employee',
|
|
||||||
#ok: ->
|
|
||||||
##this context is SelectEmployeeController
|
|
||||||
#if employee = @get('employee')
|
|
||||||
#shift = controller.store.createRecord 'employee-shift', start_from: start, end_on: end
|
|
||||||
#shift.set 'employee', employee
|
|
||||||
#shift.save().then ->
|
|
||||||
#placeholder.fullCalendar('renderEvent', shift.get('calendar_event'), true)
|
|
||||||
#header: t('employee_shift.time_window', start: start.format(format), end: end.format(format))
|
|
||||||
#editable: true
|
|
||||||
defaultView: 'agendaWeek'
|
|
||||||
events: events
|
|
||||||
timezone: 'UTC'
|
|
||||||
#eventDrop: controller.event_changed.bind(controller)
|
|
||||||
#eventResize: controller.event_changed.bind(controller)
|
|
||||||
#eventClick: (event)->
|
|
||||||
#controller.editEvent event.id,
|
|
||||||
#save: (shift)->
|
|
||||||
#placeholder.fullCalendar('removeEvents', [event.id])
|
|
||||||
#placeholder.fullCalendar('renderEvent', shift.get('calendar_event'), true)
|
|
||||||
#destroy: (shift)->
|
|
||||||
#placeholder.fullCalendar('removeEvents', [event.id])
|
|
||||||
timeFormat: 'H(:mm)'
|
|
||||||
axisFormat: 'H:mm'
|
|
||||||
lang: moment.locale()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
App.PageBodyView = Ember.View.extend
|
#App.PageBodyView = Ember.View.extend
|
||||||
setTemplate: (->
|
# setTemplate: (->
|
||||||
body = @get('templateBody')
|
# body = @get('templateBody')
|
||||||
body ||= ""
|
# body ||= ""
|
||||||
try
|
# try
|
||||||
template = Ember.Handlebars.compile(body)
|
# template = Ember.Handlebars.compile(body)
|
||||||
catch
|
# catch
|
||||||
template = Ember.Handlebars.compile(tspan('page.cannot_compile'))
|
# template = Ember.Handlebars.compile(tspan('page.cannot_compile'))
|
||||||
@set 'template', template
|
# @set 'template', template
|
||||||
@rerender()
|
# @rerender()
|
||||||
).on('init').observes('templateBody')
|
# ).on('init').observes('templateBody')
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
App.RemoveListNeedsPaymentView = Ember.View.extend
|
#App.RemoveListNeedsPaymentView = Ember.View.extend
|
||||||
templateName: 'remove_list_needs_payment_button'
|
# templateName: 'remove_list_needs_payment_button'
|
||||||
classNames: ['remove_list_needs_payment']
|
# classNames: ['remove_list_needs_payment']
|
||||||
classNameBindings: ['content.needs_payment:show:hide']
|
# classNameBindings: ['content.needs_payment:show:hide']
|
||||||
tagName: 'button'
|
# tagName: 'button'
|
||||||
click: (e)->
|
# click: (e)->
|
||||||
@get('content').then (l)->l.remove_needs_payment()
|
# @get('content').then (l)->l.remove_needs_payment()
|
||||||
|
|||||||
@@ -1,90 +1,90 @@
|
|||||||
App.SettingsView = Ember.View.extend
|
#App.SettingsView = Ember.View.extend
|
||||||
templateName: 'settings'
|
# templateName: 'settings'
|
||||||
didInsertElement: ->
|
# didInsertElement: ->
|
||||||
return
|
# return
|
||||||
|
#
|
||||||
iconBase = 'https://maps.google.com/mapfiles/kml/'
|
# iconBase = 'https://maps.google.com/mapfiles/kml/'
|
||||||
#location_input = @$('.location_picker')
|
# #location_input = @$('.location_picker')
|
||||||
#map_div = $('<div>').addClass("location_picker_map")
|
# #map_div = $('<div>').addClass("location_picker_map")
|
||||||
map_div = @$('.location_picker_map')
|
# map_div = @$('.location_picker_map')
|
||||||
|
#
|
||||||
#location_input.before(map_div)
|
# #location_input.before(map_div)
|
||||||
#this.parentNode.insertBefore(map_div, this)
|
# #this.parentNode.insertBefore(map_div, this)
|
||||||
#location_input.hide()
|
# #location_input.hide()
|
||||||
|
#
|
||||||
#lat = 52.07436798080633
|
# #lat = 52.07436798080633
|
||||||
#lng = 4.316811561584473
|
# #lng = 4.316811561584473
|
||||||
#if @get('controller.location') and @get('controller.location').split(',').length == 2
|
# #if @get('controller.location') and @get('controller.location').split(',').length == 2
|
||||||
#values = @get('controller.location').split(',')
|
# #values = @get('controller.location').split(',')
|
||||||
#lat = values[0]
|
# #lat = values[0]
|
||||||
#lng = values[1]
|
# #lng = values[1]
|
||||||
lat = @get('controller.model.lat')
|
# lat = @get('controller.model.lat')
|
||||||
lng = @get('controller.model.lng')
|
# lng = @get('controller.model.lng')
|
||||||
center = new google.maps.LatLng(lat,lng)
|
# center = new google.maps.LatLng(lat,lng)
|
||||||
mapOptions =
|
# mapOptions =
|
||||||
zoom: 15
|
# zoom: 15
|
||||||
center: center
|
# center: center
|
||||||
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
# mapTypeId: google.maps.MapTypeId.ROADMAP,
|
||||||
zoomControl: true
|
# zoomControl: true
|
||||||
zoomControlOptions:
|
# zoomControlOptions:
|
||||||
style: google.maps.ZoomControlStyle.SMALL
|
# style: google.maps.ZoomControlStyle.SMALL
|
||||||
mapTypeControl: false
|
# mapTypeControl: false
|
||||||
panControl: false
|
# panControl: false
|
||||||
scaleControl: false
|
# scaleControl: false
|
||||||
streetViewControl: false
|
# streetViewControl: false
|
||||||
|
#
|
||||||
map = new google.maps.Map(map_div.get(0), mapOptions)
|
# map = new google.maps.Map(map_div.get(0), mapOptions)
|
||||||
marker = new google.maps.Marker(
|
# marker = new google.maps.Marker(
|
||||||
position: center
|
# position: center
|
||||||
map: map
|
# map: map
|
||||||
title: 'Location'
|
# title: 'Location'
|
||||||
icon: '/assets/icons/maps_location.png'
|
# icon: '/assets/icons/maps_location.png'
|
||||||
)
|
# )
|
||||||
google.maps.event.addListener(map, 'click', (point)=>
|
# google.maps.event.addListener(map, 'click', (point)=>
|
||||||
marker.setPosition(point.latLng)
|
# marker.setPosition(point.latLng)
|
||||||
#location_input.val point.latLng.lat() + ','+ point.latLng.lng()
|
# #location_input.val point.latLng.lat() + ','+ point.latLng.lng()
|
||||||
@set 'controller.model.lat', point.latLng.lat()
|
# @set 'controller.model.lat', point.latLng.lat()
|
||||||
@set 'controller.model.lng', point.latLng.lng()
|
# @set 'controller.model.lng', point.latLng.lng()
|
||||||
)
|
# )
|
||||||
|
#
|
||||||
search_field = $('<input type="text">')
|
# search_field = $('<input type="text">')
|
||||||
search_field.addClass('location_picker_search')
|
# search_field.addClass('location_picker_search')
|
||||||
autocomplete = new google.maps.places.Autocomplete(search_field.get(0))
|
# autocomplete = new google.maps.places.Autocomplete(search_field.get(0))
|
||||||
autocomplete.bindTo('bounds', map)
|
# autocomplete.bindTo('bounds', map)
|
||||||
search_field.keypress( (e) ->
|
# search_field.keypress( (e) ->
|
||||||
if e.which == 13
|
# if e.which == 13
|
||||||
e.preventDefault()
|
# e.preventDefault()
|
||||||
)
|
# )
|
||||||
window.autocomplete = autocomplete
|
# window.autocomplete = autocomplete
|
||||||
map_div.before(search_field)
|
# map_div.before(search_field)
|
||||||
infowindow = new google.maps.InfoWindow()
|
# infowindow = new google.maps.InfoWindow()
|
||||||
search_marker = new google.maps.Marker({map: map, icon: iconBase + 'shapes/placemark_circle.png'})
|
# search_marker = new google.maps.Marker({map: map, icon: iconBase + 'shapes/placemark_circle.png'})
|
||||||
google.maps.event.addListener autocomplete, 'place_changed', ->
|
# google.maps.event.addListener autocomplete, 'place_changed', ->
|
||||||
infowindow.close()
|
# infowindow.close()
|
||||||
search_marker.setVisible(false)
|
# search_marker.setVisible(false)
|
||||||
place = autocomplete.getPlace()
|
# place = autocomplete.getPlace()
|
||||||
return unless place.geometry
|
# return unless place.geometry
|
||||||
#if place.geometry.viewport
|
# #if place.geometry.viewport
|
||||||
# map.fitBounds(place.geometry.viewport)
|
# # map.fitBounds(place.geometry.viewport)
|
||||||
#else
|
# #else
|
||||||
map.setCenter(place.geometry.location)
|
# map.setCenter(place.geometry.location)
|
||||||
map.setZoom(17)
|
# map.setZoom(17)
|
||||||
image =
|
# image =
|
||||||
url: place.icon
|
# url: place.icon
|
||||||
size: new google.maps.Size(71, 71)
|
# size: new google.maps.Size(71, 71)
|
||||||
origin: new google.maps.Point(0, 0)
|
# origin: new google.maps.Point(0, 0)
|
||||||
anchor: new google.maps.Point(17, 34)
|
# anchor: new google.maps.Point(17, 34)
|
||||||
scaledSize: new google.maps.Size(35, 35)
|
# scaledSize: new google.maps.Size(35, 35)
|
||||||
#search_marker.setIcon(image)
|
# #search_marker.setIcon(image)
|
||||||
search_marker.setPosition(place.geometry.location)
|
# search_marker.setPosition(place.geometry.location)
|
||||||
search_marker.setVisible(true)
|
# search_marker.setVisible(true)
|
||||||
|
#
|
||||||
address = ''
|
# address = ''
|
||||||
if place.address_components
|
# if place.address_components
|
||||||
address = [
|
# address = [
|
||||||
(place.address_components[0] && place.address_components[0].short_name || ''),
|
# (place.address_components[0] && place.address_components[0].short_name || ''),
|
||||||
(place.address_components[1] && place.address_components[1].short_name || ''),
|
# (place.address_components[1] && place.address_components[1].short_name || ''),
|
||||||
(place.address_components[2] && place.address_components[2].short_name || '')
|
# (place.address_components[2] && place.address_components[2].short_name || '')
|
||||||
].join(' ')
|
# ].join(' ')
|
||||||
infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address + '</div>')
|
# infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address + '</div>')
|
||||||
infowindow.open(map, search_marker)
|
# infowindow.open(map, search_marker)
|
||||||
|
|||||||
@@ -3,12 +3,13 @@
|
|||||||
#= require handlebars
|
#= require handlebars
|
||||||
#= require ember
|
#= require ember
|
||||||
#= require ember-data
|
#= require ember-data
|
||||||
#= require shared-ember-helpers/all
|
#= require active-model-adapter
|
||||||
#= require_directory ./modifications
|
#= require_directory ./modifications
|
||||||
#= require ./app
|
#= require ./app
|
||||||
|
#= require shared-ember-helpers/all
|
||||||
#= require_directory ./modules
|
#= require_directory ./modules
|
||||||
#= require_tree .
|
#= require_tree .
|
||||||
@EmberENV = {FEATURES: {'query-params-new': true}}
|
#@EmberENV = {FEATURES: {'query-params-new': true}}
|
||||||
|
|
||||||
### Debug in app
|
### Debug in app
|
||||||
storageDebugParams = ['user_id', 'auth_token']
|
storageDebugParams = ['user_id', 'auth_token']
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ module Suppliers
|
|||||||
end
|
end
|
||||||
@lists.include_relation(:table, :users, orders: {product_orders: :product})
|
@lists.include_relation(:table, :users, orders: {product_orders: :product})
|
||||||
|
|
||||||
render json: @lists, each_serializer: SupplierListSerializer
|
render json: @lists, each_serializer: Suppliers::ListSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ module Suppliers
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @section.save
|
if @section.save
|
||||||
format.html { redirect_to [:suppliers, @section], notice: t('action.create.successfull', model: Section.model_name.human) }
|
format.html { redirect_to [:suppliers, @section], notice: t('action.create.successfull', model: Section.model_name.human) }
|
||||||
format.json { render json: @section, serializer: SupplierSectionSerializer, status: :created }
|
format.json { render json: @section, serializer: Suppliers::SectionSerializer, status: :created }
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
format.json { render json: {errors: @section.errors}, status: :unprocessable_entity }
|
format.json { render json: {errors: @section.errors}, status: :unprocessable_entity }
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
class SupplierExtendedListSerializer < Qwaiter::Serializer
|
|
||||||
# user ids for facebook pictures
|
|
||||||
root 'list'
|
|
||||||
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :section_id, :supplier_id, :closed_at #, :has_active_orders
|
|
||||||
|
|
||||||
#def has_active_orders
|
|
||||||
#object.has_active_orders?
|
|
||||||
#end
|
|
||||||
has_many :users, serializer: SupplierUserSerializer
|
|
||||||
end
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
class SupplierSectionSerializer < Qwaiter::Serializer
|
|
||||||
root 'section'
|
|
||||||
attributes :title, :path, :width, :height
|
|
||||||
end
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
class SupplierUserSerializer < Qwaiter::Serializer
|
|
||||||
self.root = :user
|
|
||||||
attributes :email, :provider, :uid, :name, :avatar
|
|
||||||
|
|
||||||
def name
|
|
||||||
object.supplier_name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
class Suppliers::EmployeeShiftSerializer < Qwaiter::Serializer
|
class Suppliers::EmployeeShiftSerializer < Qwaiter::Serializer
|
||||||
self.root = :employee_shift
|
self.root = :employee_shift
|
||||||
#embed :ids, include: true
|
#embed :ids, include: true
|
||||||
attributes :start_from, :end_on, :employee_id
|
attributes :start_from, :end_on, :employee_id, :supplier_id
|
||||||
has_one :supplier
|
#has_one :supplier
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Suppliers::ExtendedTableSerializer < Qwaiter::Serializer
|
class Suppliers::ExtendedTableSerializer < Qwaiter::Serializer
|
||||||
root 'table'
|
root :table
|
||||||
attributes :number, :width, :height, :position_x, :position_y, :section_id#, :active_list_id
|
attributes :number, :width, :height, :position_x, :position_y, :section_id#, :active_list_id
|
||||||
|
|
||||||
#def list_id
|
#def list_id
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
class SupplierListSerializer < Qwaiter::Serializer
|
class Suppliers::ListSerializer < Qwaiter::Serializer
|
||||||
# user ids for facebook pictures
|
# user ids for facebook pictures
|
||||||
self.root = :list
|
self.root = :list
|
||||||
attributes :extended_version, :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price,
|
attributes :extended_version, :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price,
|
||||||
@@ -7,7 +7,7 @@ class SupplierListSerializer < Qwaiter::Serializer
|
|||||||
#has_many :product_categories
|
#has_many :product_categories
|
||||||
#has_one :table, serializer: SupplierTableSerializer # tables are part of the sectoins load
|
#has_one :table, serializer: SupplierTableSerializer # tables are part of the sectoins load
|
||||||
has_many :join_requests
|
has_many :join_requests
|
||||||
has_many :users, serializer: SupplierUserSerializer
|
has_many :users, serializer: Suppliers::UserSerializer
|
||||||
|
|
||||||
#def has_active_orders
|
#def has_active_orders
|
||||||
#object.has_active_orders?
|
#object.has_active_orders?
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
class Suppliers::SectionSerializer < Qwaiter::Serializer
|
||||||
|
root :section
|
||||||
|
attributes :title, :path, :width, :height
|
||||||
|
end
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
class Suppliers::UserSerializer < Qwaiter::Serializer
|
||||||
|
self.root = :user
|
||||||
|
attributes :email, :provider, :uid, :name, :avatar, :list_id
|
||||||
|
|
||||||
|
def list_id
|
||||||
|
object.active_list_id
|
||||||
|
end
|
||||||
|
|
||||||
|
def name
|
||||||
|
object.supplier_name
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user