locomotive_cms 2.0.0.rc11 → 2.0.0.rc12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/Gemfile +1 -0
  2. data/app/assets/javascripts/locomotive/utils/tinymce_settings.js.coffee +3 -3
  3. data/app/assets/javascripts/locomotive/views/content_entries/_popup_form_view.js.coffee +1 -1
  4. data/app/assets/javascripts/locomotive/views/editable_elements/long_text_view.js.coffee +2 -2
  5. data/app/controllers/locomotive/api/base_controller.rb +4 -4
  6. data/app/controllers/locomotive/api/memberships_controller.rb +2 -2
  7. data/app/controllers/locomotive/api/my_account_controller.rb +18 -0
  8. data/app/controllers/locomotive/api/sites_controller.rb +1 -1
  9. data/app/controllers/locomotive/current_site_controller.rb +2 -0
  10. data/app/controllers/locomotive/passwords_controller.rb +6 -0
  11. data/app/mailers/locomotive/notifications.rb +2 -2
  12. data/app/models/locomotive/content_entry.rb +13 -1
  13. data/app/models/locomotive/editable_element.rb +4 -0
  14. data/app/models/locomotive/extensions/page/editable_elements.rb +7 -4
  15. data/app/models/locomotive/extensions/page/templatized.rb +14 -0
  16. data/app/models/locomotive/extensions/page/tree.rb +9 -0
  17. data/app/models/locomotive/extensions/site/locales.rb +7 -1
  18. data/app/models/locomotive/page.rb +8 -4
  19. data/app/presenters/locomotive/content_entry_presenter.rb +4 -4
  20. data/app/presenters/locomotive/page_presenter.rb +2 -2
  21. data/app/views/locomotive/current_site/edit.html.haml +3 -0
  22. data/app/views/locomotive/devise_mailer/reset_password_instructions.html.haml +2 -2
  23. data/app/views/locomotive/notifications/new_content_entry.html.haml +2 -4
  24. data/app/views/locomotive/pages/_form.html.haml +4 -0
  25. data/app/views/locomotive/passwords/edit.html.haml +1 -1
  26. data/config/locales/admin_ui.de.yml +1 -1
  27. data/config/locales/admin_ui.en.yml +2 -2
  28. data/config/locales/admin_ui.es.yml +1 -1
  29. data/config/locales/admin_ui.et.yml +1 -1
  30. data/config/locales/admin_ui.fr.yml +3 -3
  31. data/config/locales/admin_ui.it.yml +1 -1
  32. data/config/locales/admin_ui.nb.yml +1 -1
  33. data/config/locales/admin_ui.nl.yml +1 -1
  34. data/config/locales/admin_ui.pt-BR.yml +1 -1
  35. data/config/locales/admin_ui.ru.yml +1 -1
  36. data/config/locales/default.de.yml +2 -1
  37. data/config/locales/default.fr.yml +6 -3
  38. data/config/locales/devise.de.yml +11 -11
  39. data/config/locales/devise.en.yml +1 -1
  40. data/config/locales/devise.es.yml +9 -9
  41. data/config/locales/devise.et.yml +1 -1
  42. data/config/locales/devise.fr.yml +12 -12
  43. data/config/locales/devise.it.yml +11 -11
  44. data/config/locales/devise.nb.yml +3 -3
  45. data/config/locales/devise.nl.yml +10 -10
  46. data/config/locales/devise.pt-BR.yml +11 -11
  47. data/config/locales/devise.ru.yml +1 -1
  48. data/config/locales/flash.fr.yml +1 -1
  49. data/config/routes.rb +4 -2
  50. data/lib/generators/locomotive/install/templates/carrierwave.rb +1 -1
  51. data/lib/locomotive/liquid/tags/editable/base.rb +17 -9
  52. data/lib/locomotive/middlewares/inline_editor.rb +2 -2
  53. data/lib/locomotive/routing/site_dispatcher.rb +1 -1
  54. data/lib/locomotive/version.rb +1 -1
  55. data/vendor/assets/javascripts/locomotive/datepicker_i18n.js.erb +28 -0
  56. metadata +9 -11
  57. data/app/views/locomotive/mailer/confirmation_instructions.html.haml +0 -8
  58. data/app/views/locomotive/mailer/reset_password_instructions.html.haml +0 -12
  59. data/app/views/locomotive/mailer/unlock_instructions.html.haml +0 -10
  60. data/vendor/assets/javascripts/locomotive/datepicker_fr.js +0 -16
@@ -45,7 +45,7 @@ ru:
45
45
 
46
46
 
47
47
  locomotive_account:
48
- mailer:
48
+ devise_mailer:
49
49
  common:
50
50
  hello: Здравствуйте
51
51
 
@@ -16,7 +16,7 @@ fr:
16
16
  content_entries:
17
17
  create:
18
18
  notice: "L'élément a été crée avec succès."
19
- alert: "L'élément a été crée avec succès."
19
+ alert: "L'élément n'a pas été crée avec succès."
20
20
  update:
21
21
  notice: "L'élément a été mis à jour avec succès."
22
22
  alert: "L'élément n'a pas été mis à jour."
data/config/routes.rb CHANGED
@@ -9,8 +9,8 @@ Locomotive::Engine.routes.draw do
9
9
  :controllers => { :sessions => 'locomotive/sessions', :passwords => 'locomotive/passwords' }
10
10
 
11
11
  devise_scope :locomotive_account do
12
- match '/' => 'sessions#new'
13
- delete 'signout' => 'sessions#destroy', :as => :destroy_locomotive_session
12
+ match '/' => 'sessions#new'
13
+ delete 'signout' => 'sessions#destroy', :as => :destroy_locomotive_session
14
14
  end
15
15
 
16
16
  root :to => 'pages#index'
@@ -76,6 +76,8 @@ Rails.application.routes.draw do
76
76
 
77
77
  resource :current_site, :controller => 'current_site'
78
78
 
79
+ resource :my_account, :controller => 'my_account'
80
+
79
81
  end
80
82
  end
81
83
 
@@ -15,7 +15,7 @@ CarrierWave.configure do |config|
15
15
  :provider => 'AWS',
16
16
  :aws_access_key_id => ENV['S3_KEY_ID'],
17
17
  :aws_secret_access_key => ENV['S3_SECRET_KEY'],
18
- :region => 'us-east-1'
18
+ :region => ENV['S3_BUCKET_REGION']
19
19
  }
20
20
  config.fog_directory = ENV['S3_BUCKET']
21
21
 
@@ -43,14 +43,14 @@ module Locomotive
43
43
 
44
44
  def default_element_attributes
45
45
  {
46
- :block => @options[:block] || @context[:current_block].try(:name),
47
- :slug => @slug,
48
- :hint => @options[:hint],
49
- :priority => @options[:priority] || 0,
50
- :fixed => !!@options[:fixed],
51
- :disabled => false,
52
- :from_parent => false,
53
- :_type => self.document_type.to_s
46
+ :block => self.current_block_name,
47
+ :slug => @slug,
48
+ :hint => @options[:hint],
49
+ :priority => @options[:priority] || 0,
50
+ :fixed => !!@options[:fixed],
51
+ :disabled => false,
52
+ :from_parent => false,
53
+ :_type => self.document_type.to_s
54
54
  }
55
55
  end
56
56
 
@@ -62,8 +62,16 @@ module Locomotive
62
62
  raise 'FIXME: has to be overidden'
63
63
  end
64
64
 
65
+ def current_block_name
66
+ @options[:block] || @context[:current_block].try(:name)
67
+ end
68
+
65
69
  def render_default_content(context)
66
- render_all(@nodelist, context).join(' ')
70
+ begin
71
+ render_all(@nodelist, context).join(' ')
72
+ rescue
73
+ raise ::Liquid::SyntaxError.new("Error in the #{self.current_block_name || 'default'} block for the #{@slug} editable_element - No liquid tags are allowed inside.")
74
+ end
67
75
  end
68
76
  end
69
77
 
@@ -18,7 +18,7 @@ module Locomotive
18
18
  [].tap do |parts|
19
19
  response.each do |part|
20
20
  parts << part.to_s.gsub('</body>', %(
21
- <a href="_admin"
21
+ <a href="#{File.join(response.request.path, '/_admin')}"
22
22
  onmouseout="this.style.backgroundPosition='0px 0px'"
23
23
  onmouseover="this.style.backgroundPosition='0px -45px'"
24
24
  onmousedown="this.style.backgroundPosition='0px -90px'"
@@ -33,4 +33,4 @@ module Locomotive
33
33
 
34
34
  end
35
35
  end
36
- end
36
+ end
@@ -44,7 +44,7 @@ module Locomotive
44
44
  return true if current_site.present? && current_site.accounts.include?(current_locomotive_account)
45
45
 
46
46
  sign_out(current_locomotive_account)
47
- flash[:alert] = I18n.t(:no_membership, :scope => [:devise, :failure, :locomotive])
47
+ flash[:alert] = I18n.t(:no_membership, :scope => [:devise, :failure, :locomotive_account])
48
48
  redirect_to new_locomotive_account_session_url and return false
49
49
  end
50
50
 
@@ -1,3 +1,3 @@
1
1
  module Locomotive #:nodoc
2
- VERSION = '2.0.0.rc11'
2
+ VERSION = '2.0.0.rc12'
3
3
  end
@@ -0,0 +1,28 @@
1
+ <%# encoding: utf-8 %>
2
+
3
+ <%# FIXME: Assets precompilation requires to load the I18n since we disable the config.assets.initialize_on_precompile option %>
4
+ <% if !I18n.backend.initialized? && I18n.t('locomotive.locales.en', :locale => :en, :default => '').blank? %>
5
+ <% I18n.load_path += Dir[Locomotive::Engine.root.join('config', 'locales', '**/*.{rb,yml}').to_s] %>
6
+ <% I18n.reload! %>
7
+ <% end %>
8
+
9
+ jQuery(function($){
10
+ <% Locomotive.config.locales.each do |locale| %>
11
+ <% I18n.with_locale(locale) do %>
12
+ $.datepicker.regional['<%= locale %>'] = {
13
+ closeText: '<%= I18n.t('date_picker.close_text', :default => 'Close') %>',
14
+ prevText: '<%= I18n.t('date_picker.prev_text', :default => '&#x3c;Prev') %>',
15
+ nextText: '<%= I18n.t('date_picker.next_text', :default => 'Next&#x3e;') %>',
16
+ currentText: '<%= I18n.t('date_picker.current_text', :default => 'Current') %>',
17
+ monthNames: [<%= I18n.t('date.month_names').delete_if { |m| m.blank? }.map { |m| "'#{m.capitalize}'" }.join(', ') %>],
18
+ monthNamesShort: [<%= I18n.t('date.abbr_month_names').delete_if { |m| m.blank? }.map { |m| "'#{m.capitalize.gsub(/\.$/, '')}'" }.join(', ') %>],
19
+ dayNames: [<%= I18n.t('date.day_names').delete_if { |d| d.blank? }.map { |d| "'#{d.capitalize}'" }.join(', ') %>],
20
+ dayNamesShort: [<%= I18n.t('date.abbr_day_names').delete_if { |d| d.blank? }.map { |d| "'#{d.capitalize}'" }.join(', ') %>],
21
+ dayNamesMin: [<%= I18n.t('date.abbr_day_names').delete_if { |d| d.blank? }.map { |d| "'#{d[0..1].capitalize}'" }.join(', ') %>],
22
+ dateFormat: '<%= I18n.t('date.formats.default').gsub('%d', 'dd').gsub('%m', 'mm').gsub('%Y', 'yy') %>',
23
+ firstDay: 1,
24
+ isRTL: false
25
+ };
26
+ <% end %>
27
+ <% end %>
28
+ });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotive_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc11
4
+ version: 2.0.0.rc12
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-30 00:00:00.000000000 Z
12
+ date: 2012-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 2.1.0
69
+ version: 2.1.2
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 2.1.0
77
+ version: 2.1.2
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: cancan
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -258,7 +258,7 @@ dependencies:
258
258
  requirements:
259
259
  - - ~>
260
260
  - !ruby/object:Gem::Version
261
- version: 3.4.7.2
261
+ version: 3.4.7.3
262
262
  type: :runtime
263
263
  prerelease: false
264
264
  version_requirements: !ruby/object:Gem::Requirement
@@ -266,7 +266,7 @@ dependencies:
266
266
  requirements:
267
267
  - - ~>
268
268
  - !ruby/object:Gem::Version
269
- version: 3.4.7.2
269
+ version: 3.4.7.3
270
270
  - !ruby/object:Gem::Dependency
271
271
  name: locomotive-aloha-rails
272
272
  requirement: !ruby/object:Gem::Requirement
@@ -794,6 +794,7 @@ files:
794
794
  - app/controllers/locomotive/api/content_types_controller.rb
795
795
  - app/controllers/locomotive/api/current_site_controller.rb
796
796
  - app/controllers/locomotive/api/memberships_controller.rb
797
+ - app/controllers/locomotive/api/my_account_controller.rb
797
798
  - app/controllers/locomotive/api/pages_controller.rb
798
799
  - app/controllers/locomotive/api/sites_controller.rb
799
800
  - app/controllers/locomotive/api/snippets_controller.rb
@@ -922,9 +923,6 @@ files:
922
923
  - app/views/locomotive/layouts/application.html.haml
923
924
  - app/views/locomotive/layouts/error.html.haml
924
925
  - app/views/locomotive/layouts/not_logged_in.html.haml
925
- - app/views/locomotive/mailer/confirmation_instructions.html.haml
926
- - app/views/locomotive/mailer/reset_password_instructions.html.haml
927
- - app/views/locomotive/mailer/unlock_instructions.html.haml
928
926
  - app/views/locomotive/memberships/new.html.haml
929
927
  - app/views/locomotive/my_account/edit.html.haml
930
928
  - app/views/locomotive/notifications/new_content_entry.html.haml
@@ -1120,7 +1118,7 @@ files:
1120
1118
  - vendor/assets/javascripts/locomotive/backbone.sync.js
1121
1119
  - vendor/assets/javascripts/locomotive/cmd.js
1122
1120
  - vendor/assets/javascripts/locomotive/cookies.js
1123
- - vendor/assets/javascripts/locomotive/datepicker_fr.js
1121
+ - vendor/assets/javascripts/locomotive/datepicker_i18n.js.erb
1124
1122
  - vendor/assets/javascripts/locomotive/editable_field.js
1125
1123
  - vendor/assets/javascripts/locomotive/form_submit_notification.js
1126
1124
  - vendor/assets/javascripts/locomotive/growl.js
@@ -1171,7 +1169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
1171
1169
  version: '0'
1172
1170
  segments:
1173
1171
  - 0
1174
- hash: -3115491061164600224
1172
+ hash: -3713943705302971803
1175
1173
  required_rubygems_version: !ruby/object:Gem::Requirement
1176
1174
  none: false
1177
1175
  requirements:
@@ -1,8 +0,0 @@
1
- %p
2
- != t('locomotive.mailer.common.hello')
3
- = @resource.email
4
- \!
5
- %p
6
- != t('.you_can_confirm_your_account_through_the_link_below')
7
- %p
8
- = link_to t('.confirm_my_account'), confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)
@@ -1,12 +0,0 @@
1
- / %p
2
- / != t('locomotive.mailer.common.hello')
3
- / = @resource.email
4
- / \!
5
- / %p
6
- / != t('.reset_password_instruction')
7
- / %p
8
- / = link_to t('.change_my_password'), edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
9
- / %p
10
- / != t('.wrong_request_instruction')
11
- / %p
12
- / != t('.unchange_password_message')
@@ -1,10 +0,0 @@
1
- %p
2
- != t('locomotive.mailer.common.hello')
3
- = @resource.email
4
- \!
5
- %p
6
- != t('.locked_account_message')
7
- %p
8
- != t('.unlock_account_instruction')
9
- %p
10
- = link_to t('.unlock_my_account'), unlock_url(@resource, :unlock_token => @resource.unlock_token)
@@ -1,16 +0,0 @@
1
- /* French initialisation for the jQuery UI date picker plugin. */
2
- /* Written by Keith Wood (kbwood@virginbroadband.com.au) and Stéphane Nahmani (sholby@sholby.net). */
3
- jQuery(function($){
4
- $.datepicker.regional['fr'] = {
5
- closeText: 'Fermer',
6
- prevText: '&#x3c;Préc',
7
- nextText: 'Suiv&#x3e;',
8
- currentText: 'Courant',
9
- monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
10
- monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', 'Jul','Aoû','Sep','Oct','Nov','Déc'],
11
- dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
12
- dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
13
- dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
14
- dateFormat: 'dd/mm/yy', firstDay: 1,
15
- isRTL: false};
16
- });