ios support
This commit is contained in:
@@ -110,6 +110,8 @@ group :development do
|
||||
gem 'spring'
|
||||
gem 'spring-commands-rspec'
|
||||
gem 'web-console', '~> 2.0.0'
|
||||
gem 'foreman'
|
||||
gem 'thin'
|
||||
end
|
||||
|
||||
group :test do
|
||||
@@ -128,7 +130,6 @@ end
|
||||
|
||||
# Use unicorn as the app server
|
||||
# gem 'unicorn'
|
||||
# gem 'foreman'
|
||||
|
||||
# Deploy with Capistrano
|
||||
# gem 'capistrano'
|
||||
|
||||
+13
-2
@@ -1,6 +1,6 @@
|
||||
GIT
|
||||
remote: git://github.com/bterkuile/cmtool.git
|
||||
revision: b0491aa997cca6e791b7352f40e2adf90191a1cd
|
||||
revision: 2b0d4816b82ca202728893d5800f2fc13a17b63b
|
||||
specs:
|
||||
cmtool (1.0.0)
|
||||
bourbon
|
||||
@@ -138,7 +138,7 @@ GEM
|
||||
climate_control (0.0.3)
|
||||
activesupport (>= 3.0)
|
||||
cliver (0.3.2)
|
||||
cocaine (0.5.5)
|
||||
cocaine (0.5.7)
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
coderay (1.1.0)
|
||||
coffee-rails (4.1.0)
|
||||
@@ -157,6 +157,7 @@ GEM
|
||||
rest-client (~> 1.6.1)
|
||||
crack (0.4.2)
|
||||
safe_yaml (~> 1.0.0)
|
||||
daemons (1.1.9)
|
||||
debug_inspector (0.0.2)
|
||||
devise (3.4.1)
|
||||
bcrypt (~> 3.0)
|
||||
@@ -168,6 +169,7 @@ GEM
|
||||
devise-i18n (0.11.3)
|
||||
diff-lcs (1.2.5)
|
||||
docile (1.1.5)
|
||||
dotenv (1.0.2)
|
||||
em-http-request (1.1.2)
|
||||
addressable (>= 2.3.4)
|
||||
cookiejar
|
||||
@@ -226,6 +228,9 @@ GEM
|
||||
ffi (1.9.6)
|
||||
font-awesome-rails (4.3.0.0)
|
||||
railties (>= 3.2, < 5.0)
|
||||
foreman (0.77.0)
|
||||
dotenv (~> 1.0.2)
|
||||
thor (~> 0.19.1)
|
||||
foundation-rails (5.5.1.0)
|
||||
railties (>= 3.1.0)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
@@ -427,6 +432,10 @@ GEM
|
||||
temple (0.7.5)
|
||||
test_squad (0.0.1)
|
||||
rails
|
||||
thin (1.6.3)
|
||||
daemons (~> 1.0, >= 1.0.9)
|
||||
eventmachine (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
thor (0.19.1)
|
||||
thread_safe (0.3.4)
|
||||
tilt (1.4.1)
|
||||
@@ -487,6 +496,7 @@ DEPENDENCIES
|
||||
factory_girl_rails
|
||||
faye
|
||||
font-awesome-rails
|
||||
foreman
|
||||
foundation-rails
|
||||
fuubar
|
||||
iso_country_codes
|
||||
@@ -519,6 +529,7 @@ DEPENDENCIES
|
||||
spring
|
||||
spring-commands-rspec
|
||||
test_squad
|
||||
thin
|
||||
turnip
|
||||
uglifier (>= 1.0.3)
|
||||
web-console (~> 2.0.0)
|
||||
|
||||
@@ -4,4 +4,6 @@
|
||||
# production: faye: thin start -d -R faye/config.ru -p 9296
|
||||
#counters: bin/drb_counter.rb run -- development
|
||||
# production: conters: bin/drb_counter.rb start
|
||||
server: bundle exec rails s -e production
|
||||
counters: drb_counter/drb_counter.rb development
|
||||
faye: thin start -R faye/config.ru -p 9296
|
||||
#server: bundle exec rails s -e production
|
||||
|
||||
@@ -6,20 +6,20 @@ App.SectionController = Ember.ObjectController.extend
|
||||
finishEditable: ->
|
||||
@set('editmode', false)
|
||||
@get('model').save()
|
||||
@get('model.section_elements').forEach (section_element) -> section_element.save()
|
||||
@get('model.section_areas').forEach (section_area) -> section_area.save()
|
||||
@get('model.section_elements').filterProperty('isDirty').invoke 'save'
|
||||
@get('model.section_areas').filterProperty('isDirty').invoke 'save'
|
||||
rollbackEditable: ->
|
||||
@get('model').rollback()
|
||||
@get('model.section_elements').forEach (section_element) ->
|
||||
if section_element.get('id')
|
||||
section_element.rollback()
|
||||
else
|
||||
if section_element.get('isNew')
|
||||
section_element.deleteRecord()
|
||||
@get('model.section_areas').forEach (section_area) ->
|
||||
if section_area.get('id')
|
||||
section_area.rollback()
|
||||
else
|
||||
section_element.rollback()
|
||||
@get('model.section_areas').forEach (section_area) ->
|
||||
if section_area.get('isNew')
|
||||
section_area.deleteRecord()
|
||||
else
|
||||
section_area.rollback()
|
||||
@set('editmode', false)
|
||||
addSection: -> @modal 'add_section', model: @get('model')
|
||||
addTables: -> @modal 'section_add_tables', model: @get('model')
|
||||
|
||||
@@ -28,7 +28,39 @@ DragNDrop.Draggable = Ember.Mixin.create
|
||||
@set 'targetObject.isDragging', false
|
||||
@set 'targetObject.controllers.application.isDragging', false
|
||||
localStorage.removeItem 'draggingView' if localStorage.getItem 'draggingView'
|
||||
touchStart: (ev)->
|
||||
ev.preventDefault()
|
||||
target = @$()
|
||||
return unless target.prop 'draggable'
|
||||
touch = ev.originalEvent.changedTouches[0]
|
||||
@touchStartEvent =
|
||||
left: parseFloat(target.css('left'))
|
||||
top: parseFloat(target.css('top'))
|
||||
pageX: touch.pageX
|
||||
pageY: touch.pageY
|
||||
|
||||
touchMove: (ev)->
|
||||
ev.preventDefault()
|
||||
target = @$()
|
||||
return unless target.prop 'draggable'
|
||||
if ev.originalEvent.changedTouches.length is 1
|
||||
touch = ev.originalEvent.changedTouches[0]
|
||||
target.css
|
||||
left: "#{@touchStartEvent.left + touch.pageX - @touchStartEvent.pageX}px"
|
||||
top: "#{@touchStartEvent.top + touch.pageY - @touchStartEvent.pageY}px"
|
||||
touchEnd: (ev)->
|
||||
ev.preventDefault()
|
||||
touch = ev.originalEvent.changedTouches[0]
|
||||
if Math.abs(@touchStartEvent.pageX - touch.pageX) < 2 and Math.abs(@touchStartEvent.pageY - touch.pageY) < 2
|
||||
# The preventDefaults are preventing the click action to fire, therefore we trigger it ourselves
|
||||
# But do not trigger when a handle insed the element is clicked
|
||||
unless $(ev.target).parents('.handles-inside-draggable') or $(ev.target).hasClass('handles-inside-draggable')
|
||||
@click() if @click
|
||||
else
|
||||
$(ev.target).click()
|
||||
|
||||
@touchStartEvent = null
|
||||
this
|
||||
DragNDrop.Droppable = Ember.Mixin.create
|
||||
dragEnter: (e)->
|
||||
if @dragEntered
|
||||
@@ -40,6 +72,20 @@ DragNDrop.Droppable = Ember.Mixin.create
|
||||
# DragNDrop.cancel(e)
|
||||
dragOver: DragNDrop.cancel # don't know why, but crucial for the current way of working with section tables
|
||||
# dragOver: (e)->(e.preventDefault(); false)
|
||||
touchEnd: (ev)->
|
||||
ev.preventDefault()
|
||||
view = ev.result
|
||||
return unless view._parentView
|
||||
target = view.$()
|
||||
return unless target.prop 'draggable'
|
||||
newX = parseFloat(target.css('left'))
|
||||
newY = parseFloat(target.css('top'))
|
||||
return unless newX? and newY?
|
||||
position =
|
||||
left: newX
|
||||
top: newY
|
||||
@dropped view, position if @dropped
|
||||
this
|
||||
dragLeave: ->
|
||||
if @dragLeft
|
||||
@dragLeft()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
= svg view.content.svg width=view.content.box_width height=view.content.box_height rotation=view.content.rotation
|
||||
if view.showHandles
|
||||
.section-element-handles
|
||||
.section-element-handles.handles-inside-draggable
|
||||
a.rotate-left{action "rotateLeft" view.content bubbles=false}: span.icon
|
||||
a.rotate-right{action "rotateRight" view.content bubbles=false}: span.icon
|
||||
a.remove-section-element{action "removeSectionElement" view.content bubbles=false}: span.icon
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
App.SectionElementView = Ember.View.extend DragNDrop.Draggable,
|
||||
templateName: 'section/section-element'
|
||||
classNames: ['section-element']
|
||||
classNames: ['section-element-container']
|
||||
attributeBindings: ['style']
|
||||
show_handles: false
|
||||
classNameBindings: [
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
App.SectionTablesView = Ember.View.extend DragNDrop.Droppable,
|
||||
classNames: ['well', 'section-tables-container', 'section-tables-active']
|
||||
classNameBindings: ['controller.editmode:editing']
|
||||
templateName: 'section/tables'
|
||||
dpm: 1
|
||||
didInsertElement: ->
|
||||
@$el = $(@get('element'))
|
||||
height = @$el.width() * @get('controller.model.height') / @get('controller.model.width')
|
||||
@$el.css('height', height)
|
||||
dropped: (view, position)->
|
||||
view.positionChange(position, @content)
|
||||
observeSectionDimensions: (->
|
||||
@@ -21,10 +18,9 @@ App.SectionTablesView = Ember.View.extend DragNDrop.Droppable,
|
||||
dpm = viewport_height / section_height
|
||||
@$el.css 'width', dpm * section_width
|
||||
@$el.css 'height', dpm * section_height
|
||||
console.log "SECTION dpm #{dpm}"
|
||||
@set 'dpm', dpm
|
||||
).observes('controller.model.height', 'controller.model.width')
|
||||
tables: (->@get('content')).property('content')
|
||||
tables: (->@get('content')).property('content.@each')
|
||||
didInsertElement: ->
|
||||
# the first observable event is triggered without the container having its dimensions
|
||||
@get('controller.model').notifyPropertyChange('width').notifyPropertyChange('height')
|
||||
@get('controller.model').notifyPropertyChange('width') #.notifyPropertyChange('height')
|
||||
|
||||
@@ -2,17 +2,14 @@
|
||||
//= require jquery
|
||||
//= require jquery_ujs
|
||||
//= require jquery-ui/sortable
|
||||
//= require jquery.ui.touch-punch
|
||||
// require ./im
|
||||
// require foundation FOUNDATION 5 JAVASCRIPT IMPLEMENTATIONS AND EMBER ARE NOT COMPATIBLE, FOUNDATION IS TOO SIMPLISTIC AT THE MOMENT AND DESTROYS DOM EVENTS
|
||||
//= require js-routes
|
||||
//= require moment
|
||||
//= require fullcalendar
|
||||
//= require translations
|
||||
// require qwaiter
|
||||
// require ./qsupplier
|
||||
//= require faye
|
||||
//= require ./base
|
||||
// require qtip # was used for table actions in section view, now done by EMBER
|
||||
//= require pickdate
|
||||
//= require_directory .
|
||||
//= require_self
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
* jQuery UI Touch Punch 0.2.2
|
||||
*
|
||||
* Copyright 2011, Dave Furfero
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.mouse.js
|
||||
*/
|
||||
(function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return;}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return;}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f);}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return;}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown");};c._touchMove=function(f){if(!a){return;}this._touchMoved=true;d(f,"mousemove");};c._touchEnd=function(f){if(!a){return;}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click");}a=false;};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f);};})(jQuery);
|
||||
@@ -12,8 +12,6 @@ $side-spacing: 0px
|
||||
display: inline-block
|
||||
.location_picker_search
|
||||
float: left
|
||||
.draggable
|
||||
cursor: move !important
|
||||
.text-alert
|
||||
color: $alert-color
|
||||
.text-warning
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
margin-right: 10px
|
||||
margin-bottom: 10px
|
||||
width: 80px
|
||||
max-height: 120px
|
||||
border: 2px outset #aaa
|
||||
&:hover
|
||||
border-color: $active-color
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
position: relative
|
||||
padding: 0
|
||||
height: 400px
|
||||
&.editing
|
||||
background-color: rgba(240, 138, 36, 0.5)
|
||||
.section-element-container, .section-area-container
|
||||
cursor: pointer
|
||||
//background-image: image-url('textures/wood4.jpg')
|
||||
//background-color: rgba(0,0,0,0.4)
|
||||
.section-table
|
||||
|
||||
@@ -15,7 +15,6 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
private
|
||||
|
||||
|
||||
def allow_all_origins
|
||||
headers['Access-Control-Allow-Origin'] = '*'
|
||||
headers['Access-Control-Request-Method'] = '*'
|
||||
@@ -24,7 +23,11 @@ private
|
||||
end
|
||||
|
||||
def authorize_cmtool
|
||||
redirect_to '/', alert: t('general.unauthorized') unless current_user.present? && current_user.admin?
|
||||
redirect_to new_administrator_session_path, alert: t('general.unauthorized') unless current_administrator.present?
|
||||
end
|
||||
|
||||
def cmtool_user
|
||||
current_administrator
|
||||
end
|
||||
|
||||
def cmtool_locale
|
||||
@@ -65,6 +68,7 @@ private
|
||||
def after_sign_in_path_for(resource)
|
||||
case resource
|
||||
when Employee then supplier_root_path
|
||||
when Administrator then cmtool.root_path
|
||||
else root_path
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ module Suppliers
|
||||
|
||||
def show
|
||||
[current_supplier].include_relations(sections: :tables, product_categories: :products)
|
||||
render json: Suppliers::SupplierSerializer.new(current_supplier).as_json
|
||||
render json: current_supplier, serializer: Suppliers::SupplierSerializer #.new(current_supplier).as_json
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- model_class = SvgElement
|
||||
div.page-header= title :index, model_class
|
||||
- title :index, model_class
|
||||
- if @svg_elements.any?
|
||||
table.table
|
||||
thead
|
||||
|
||||
Regular → Executable
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env ruby
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
load Gem.bin_path('bundler', 'bundle')
|
||||
Regular → Executable
@@ -1,8 +1,4 @@
|
||||
#!/usr/bin/env ruby
|
||||
begin
|
||||
load File.expand_path("../spring", __FILE__)
|
||||
rescue LoadError
|
||||
end
|
||||
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/usr/bin/env ruby
|
||||
begin
|
||||
load File.expand_path("../spring", __FILE__)
|
||||
rescue LoadError
|
||||
end
|
||||
require 'bundler/setup'
|
||||
load Gem.bin_path('rake', 'rake')
|
||||
require_relative '../config/boot'
|
||||
require 'rake'
|
||||
Rake.application.run
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'pathname'
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
||||
|
||||
Dir.chdir APP_ROOT do
|
||||
# This script is a starting point to setup your application.
|
||||
# Add necessary setup steps to this file:
|
||||
|
||||
puts "== Installing dependencies =="
|
||||
system "gem install bundler --conservative"
|
||||
system "bundle check || bundle install"
|
||||
|
||||
# puts "\n== Copying sample files =="
|
||||
# unless File.exist?("config/database.yml")
|
||||
# system "cp config/database.yml.sample config/database.yml"
|
||||
# end
|
||||
|
||||
puts "\n== Preparing database =="
|
||||
system "bin/rake db:setup"
|
||||
|
||||
puts "\n== Removing old logs and tempfiles =="
|
||||
system "rm -f log/*"
|
||||
system "rm -rf tmp/cache"
|
||||
|
||||
puts "\n== Restarting application server =="
|
||||
system "touch tmp/restart.txt"
|
||||
end
|
||||
Reference in New Issue
Block a user