diff --git a/Gemfile b/Gemfile
index b7dd7ba..a9d2d17 100644
--- a/Gemfile
+++ b/Gemfile
@@ -21,7 +21,7 @@ gem 'pg'
# Security
# gem 'secure_headers'
-gem 'dotenv-rails', :groups => [:development, :test]
+#gem 'dotenv-rails', :groups => [:development, :test]
# Miscellanea
# gem 'google-analytics-rails'
@@ -43,7 +43,7 @@ gem 'jquery-turbolinks'
gem 'sass-rails', '~> 4.0.0'
gem "compass-rails", "~> 1.1.3"
gem 'foundation-rails'
-gem 'turbolinks'
+#gem 'turbolinks' # This would be great to have working, right now lets focus on gettting it working without it.
gem 'uglifier', '>= 1.3.0'
gem 'sorcery', '>= 0.8.1'
gem 'oauth2', '~> 0.8.0'
@@ -52,7 +52,9 @@ gem 'redis'
gem 'carrierwave'
gem 'carrierwave-imageoptimizer'
gem 'mini_magick'
-#gem 'carmen', :path => '../carmen /'
+if File.directory?('../carmen/')
+ gem 'carmen', :path => '../carmen/', require: false
+end
gem 'carmen-rails'
gem 'nested_form'
gem 'acts_as_list'
diff --git a/Gemfile.lock b/Gemfile.lock
index 9b54ba3..4e200b7 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -12,6 +12,11 @@ GIT
i18n-active_record (0.0.2)
i18n (>= 0.5.0)
+PATH
+ remote: ../carmen/
+ specs:
+ carmen (1.0.1)
+
GEM
remote: http://rubygems.org/
specs:
@@ -66,8 +71,6 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
- carmen (1.0.1)
- unicode_utils (~> 1.4.0)
carmen-rails (1.0.1)
carmen (~> 1.0.0)
rails
@@ -124,11 +127,6 @@ GEM
chronic
diff-lcs (1.2.5)
docile (1.1.3)
- dotenv (0.11.1)
- dotenv-deployment (~> 0.0.2)
- dotenv-deployment (0.0.2)
- dotenv-rails (0.11.1)
- dotenv (= 0.11.1)
email_spec (1.5.0)
launchy (~> 2.1)
mail (~> 2.2)
@@ -340,14 +338,12 @@ GEM
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
- unicode_utils (1.4.0)
uniform_notifier (1.4.0)
wdm (0.1.0)
webmock (1.17.4)
addressable (>= 2.2.7)
crack (>= 0.3.2)
websocket (1.0.7)
- win32console (1.3.2)
win32console (1.3.2-x86-mingw32)
xpath (2.0.0)
nokogiri (~> 1.3)
@@ -363,6 +359,7 @@ DEPENDENCIES
binding_of_caller
bullet
capybara
+ carmen!
carmen-rails
carrierwave
carrierwave-imageoptimizer
@@ -372,7 +369,6 @@ DEPENDENCIES
database_cleaner
debugger
delorean
- dotenv-rails
email_spec
eventmachine
factory_girl_rails
@@ -407,7 +403,6 @@ DEPENDENCIES
selenium-webdriver
simplecov
sorcery (>= 0.8.1)
- turbolinks
uglifier (>= 1.3.0)
wdm (>= 0.1.0)
webmock
diff --git a/Thumbs.db b/Thumbs.db
index abcbf60..ef7f828 100644
Binary files a/Thumbs.db and b/Thumbs.db differ
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index 1313f97..655711f 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -1,8 +1,8 @@
#= require jquery
#= require jquery_ujs
#= require jquery.ui.sortable
-#= require jquery.turbolinks
-#= require turbolinks
+# = #require jquery.turbolinks
+# = #require turbolinks
#= require foundation
# FRONT END
@@ -123,6 +123,50 @@ updateFormFieldList = () ->
updateFormFieldList()
return
+saveTranslation = ($td, $move_to, auto_translate) ->
+ val = ''
+ do_auto_translate = true
+ if typeof auto_translate == "undefined" || !auto_translate
+ val = $td.find('textarea').val()
+ do_auto_translate = false
+ key = $td.parent().data().key
+ params = {translationkey: key, translationvalue: val, translationlang: window.location.href.replace(/^.*\/(\w+)\/$/, '$1')}
+ if do_auto_translate
+ params['auto_translate'] = true
+ $.post '/translate/', params,
+ (json) ->
+ #console.log json
+ $td.html(json.translation)
+ if $td.parent().hasClass('not-exists')
+ $td.parent().removeClass('not-exists')
+ $td.parent().addClass('exists')
+ $('.translation-form').remove()
+ if typeof $move_to != "undefined" && $move_to
+ startTranslating $move_to
+ return
+ return
+
+stopTranslating = () -> $('.translation-form').remove()
+
+startTranslating = ($td) ->
+ stopTranslating()
+ value = if $td.parent().hasClass('not-exists') then '' else $td.html().trim()
+ $tr = $td.parent()
+ key = $tr.data().key
+ $td.append('