alchemy_cms 2.5.0.b9 → 2.5.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/alchemy_cms.gemspec +2 -1
  2. data/app/assets/javascripts/alchemy/alchemy.base.js +0 -27
  3. data/app/assets/javascripts/alchemy/alchemy.growler.js +1 -1
  4. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +0 -1
  5. data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +0 -4
  6. data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +0 -1
  7. data/app/assets/stylesheets/alchemy/admin.css.scss +1 -0
  8. data/app/assets/stylesheets/alchemy/archive.scss +8 -6
  9. data/app/assets/stylesheets/alchemy/base.scss +3 -92
  10. data/app/assets/stylesheets/alchemy/elements.scss +2 -2
  11. data/app/assets/stylesheets/alchemy/flash.scss +16 -12
  12. data/app/assets/stylesheets/alchemy/frame.scss +10 -5
  13. data/app/assets/stylesheets/alchemy/icons.scss +2 -2
  14. data/app/assets/stylesheets/alchemy/pagination.scss +5 -5
  15. data/app/assets/stylesheets/alchemy/tables.scss +2 -2
  16. data/app/assets/stylesheets/alchemy/toolbar.scss +79 -0
  17. data/app/controllers/alchemy/admin/base_controller.rb +3 -2
  18. data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
  19. data/app/controllers/alchemy/admin/pictures_controller.rb +1 -1
  20. data/app/controllers/alchemy/admin/users_controller.rb +8 -2
  21. data/app/controllers/alchemy/attachments_controller.rb +1 -1
  22. data/app/controllers/alchemy/base_controller.rb +8 -0
  23. data/app/controllers/alchemy/pages_controller.rb +4 -0
  24. data/app/controllers/alchemy/passwords_controller.rb +23 -0
  25. data/app/controllers/alchemy/user_sessions_controller.rb +20 -49
  26. data/app/controllers/alchemy/users_controller.rb +49 -0
  27. data/app/mailers/alchemy/notifications.rb +5 -0
  28. data/app/models/alchemy/content.rb +6 -2
  29. data/app/models/alchemy/element.rb +9 -5
  30. data/app/models/alchemy/essence_richtext.rb +28 -16
  31. data/app/models/alchemy/essence_text.rb +22 -13
  32. data/app/models/alchemy/message.rb +1 -1
  33. data/app/models/alchemy/page.rb +7 -2
  34. data/app/models/alchemy/user.rb +66 -24
  35. data/app/views/alchemy/admin/dashboard/index.html.erb +1 -1
  36. data/app/views/alchemy/admin/essence_files/edit.html.erb +1 -0
  37. data/app/views/alchemy/admin/pages/_create_language_form.html.erb +8 -1
  38. data/app/views/alchemy/admin/partials/_flash.html.erb +1 -1
  39. data/app/views/alchemy/admin/users/_table.html.erb +2 -2
  40. data/app/views/alchemy/admin/users/_user.html.erb +1 -1
  41. data/app/views/alchemy/admin/users/index.html.erb +1 -1
  42. data/app/views/alchemy/notifications/admin_user_created.de.text.erb +11 -0
  43. data/app/views/alchemy/notifications/admin_user_created.en.text.erb +11 -0
  44. data/app/views/alchemy/notifications/registered_user_created.text.erb +2 -1
  45. data/app/views/alchemy/notifications/reset_password_instructions.de.text.erb +8 -0
  46. data/app/views/alchemy/notifications/reset_password_instructions.en.text.erb +8 -0
  47. data/app/views/alchemy/passwords/edit.html.erb +35 -0
  48. data/app/views/alchemy/passwords/new.html.erb +30 -0
  49. data/app/views/alchemy/user_sessions/leave.html.erb +3 -3
  50. data/app/views/alchemy/user_sessions/{login.html.erb → new.html.erb} +5 -2
  51. data/app/views/alchemy/{user_sessions/signup.html.erb → users/new.html.erb} +0 -0
  52. data/config/alchemy/config.yml +12 -0
  53. data/config/initializers/devise.rb +242 -0
  54. data/config/locales/alchemy.de.yml +12 -39
  55. data/config/locales/alchemy.en.yml +4 -31
  56. data/config/locales/devise.de.yml +57 -0
  57. data/config/locales/devise.en.yml +60 -0
  58. data/config/routes.rb +37 -21
  59. data/db/migrate/20130121092645_migrate_to_devise.rb +24 -0
  60. data/lib/alchemy/authentication_helpers.rb +0 -13
  61. data/lib/alchemy/engine.rb +2 -2
  62. data/lib/alchemy/essence.rb +2 -2
  63. data/lib/alchemy/upgrader.rb +33 -0
  64. data/lib/alchemy/version.rb +1 -1
  65. data/lib/alchemy_cms.rb +2 -1
  66. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +1 -1
  67. data/lib/rails/generators/alchemy/devise/devise_generator.rb +24 -0
  68. data/lib/rails/generators/alchemy/scaffold/files/elements.yml +1 -111
  69. data/lib/rails/generators/alchemy/scaffold/templates/page_layouts.yml.tt +1 -27
  70. data/lib/tasks/ferret.rake +6 -6
  71. data/spec/controllers/admin/clipboard_controller_spec.rb +2 -3
  72. data/spec/controllers/admin/contents_controller_spec.rb +1 -2
  73. data/spec/controllers/admin/elements_controller_spec.rb +1 -2
  74. data/spec/controllers/admin/languages_controller_spec.rb +2 -3
  75. data/spec/controllers/admin/pages_controller_spec.rb +2 -3
  76. data/spec/controllers/admin/trash_controller_spec.rb +1 -2
  77. data/spec/controllers/admin/users_controller_spec.rb +36 -5
  78. data/spec/controllers/attachments_controller_spec.rb +2 -4
  79. data/spec/controllers/base_controller_spec.rb +25 -0
  80. data/spec/controllers/elements_controller_spec.rb +1 -2
  81. data/spec/controllers/passwords_controller_spec.rb +16 -0
  82. data/spec/controllers/pictures_controller_spec.rb +1 -2
  83. data/spec/controllers/user_sessions_controller_spec.rb +21 -0
  84. data/spec/controllers/users_controller_spec.rb +67 -0
  85. data/spec/dummy/db/migrate/20130121092645_migrate_to_devise.rb +24 -0
  86. data/spec/dummy/db/schema.rb +17 -16
  87. data/spec/factories.rb +2 -0
  88. data/spec/integration/pages_controller_spec.rb +9 -1
  89. data/spec/models/content_spec.rb +11 -0
  90. data/spec/models/element_spec.rb +11 -2
  91. data/spec/models/essence_richtext_spec.rb +42 -6
  92. data/spec/models/essence_text_spec.rb +41 -0
  93. data/spec/models/page_spec.rb +39 -0
  94. data/spec/models/user_spec.rb +95 -6
  95. data/spec/spec_helper.rb +2 -3
  96. data/spec/support/alchemy/controller_hacks.rb +1 -1
  97. data/spec/support/alchemy/specs_helpers.rb +4 -4
  98. metadata +47 -10
  99. data/app/models/alchemy/user_session.rb +0 -14
  100. data/app/views/alchemy/notifications/admin_user_created.text.erb +0 -13
  101. data/app/views/alchemy/user_sessions/logout.html.erb +0 -3
@@ -0,0 +1,57 @@
1
+ de:
2
+ errors:
3
+ messages:
4
+ expired: "ist abgelaufen, bitte neu anfordern"
5
+ not_found: "nicht gefunden"
6
+ already_confirmed: "wurde bereits bestätigt"
7
+ not_locked: "ist nicht gesperrt"
8
+ not_saved:
9
+ one: "Es konnte nicht fortfahren werden:"
10
+ other: "Es konnte nicht fortfahren werden:"
11
+
12
+ devise:
13
+ failure:
14
+ already_authenticated: 'Sie sind bereits angemeldet.'
15
+ unauthenticated: 'Sie müssen sich anmelden oder registrieren, bevor Sie fortfahren können.'
16
+ unconfirmed: 'Sie müssen Ihren Account bestätigen, bevor Sie fortfahren können.'
17
+ locked: 'Ihr Account ist gesperrt.'
18
+ invalid: 'Ungültige Anmeldedaten.'
19
+ invalid_token: 'Der Anmelde-Token ist ungültig.'
20
+ timeout: 'Ihre Sitzung ist abgelaufen, bitte melden Sie sich erneut an.'
21
+ inactive: 'Ihr Account ist nicht aktiv.'
22
+ user:
23
+ not_found_in_database: 'Ungültige Anmeldedaten.'
24
+ sessions:
25
+ signed_in: 'Erfolgreich angemeldet.'
26
+ signed_out: 'Erfolgreich abgemeldet.'
27
+ passwords:
28
+ send_instructions: 'Sie erhalten in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie ihr Passwort zurücksetzen können.'
29
+ updated: 'Ihr Passwort wurde geändert. Sie sind jetzt angemeldet.'
30
+ updated_not_active: 'Ihr Passwort wurde geändert.'
31
+ send_paranoid_instructions: "Falls Ihre E-Mail-Adresse in unserer Datenbank existiert erhalten Sie in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihr Passwort zurücksetzen können."
32
+ confirmations:
33
+ send_instructions: 'Sie erhalten in wenigen Minuten eine E-Mail, mit der Sie Ihre Registrierung bestätigen können.'
34
+ send_paranoid_instructions: 'Falls Ihre E-Mail-Adresse in unserer Datenbank existiert erhalten Sie in wenigen Minuten eine E-Mail mit der die Sie Ihre Registrierung bestätigen können.'
35
+ confirmed: 'Vielen Dank für Ihre Registrierung. Sie sind jetzt angemeldet.'
36
+ registrations:
37
+ signed_up: 'Sie haben sich erfolgreich registriert.'
38
+ signed_up_but_unconfirmed: 'Sie haben sich erfolgreich registriert. Wir konnten Sie noch nicht anmelden, da Ihr Account noch nicht bestätigt ist. Sie erhalten in Kürze eine E-Mail mit der Anleitung, wie Sie Ihren Account freischalten können.'
39
+ signed_up_but_inactive: 'Sie haben sich erfolgreich registriert. Wir konnten Sie noch nicht anmelden, da Ihr Account inaktiv ist.'
40
+ signed_up_but_locked: 'Sie haben sich erfolgreich registriert. Wir konnten Sie noch nicht anmelden, da Ihr Account gesperrt ist.'
41
+ updated: 'Ihre Daten wurden aktualisiert.'
42
+ update_needs_confirmation: "Ihre Daten wurden aktualisiert, aber Sie müssen Ihre neue E-Mail-Adresse bestätigen. Sie erhalten in wenigen Minuten eine E-Mail, mit der Sie die Änderung Ihrer E-Mail-Adresse abschließen können."
43
+ destroyed: 'Ihr Account wurde gelöscht.'
44
+ unlocks:
45
+ send_instructions: 'Sie erhalten in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihren Account entsperren können.'
46
+ unlocked: 'Ihr Account wurde entsperrt. Sie sind jetzt angemeldet.'
47
+ send_paranoid_instructions: "Falls Ihre E-Mail-Adresse in unserer Datenbank existiert erhalten Sie in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihren Account entsperren können."
48
+ omniauth_callbacks:
49
+ success: 'Die haben sich erfolgreich mit Ihrem %{kind}-Account angemeldet.'
50
+ failure: 'Sie konnten nicht mit Ihrem %{kind}-Account angemeldet werden, weil "%{reason}".'
51
+ mailer:
52
+ confirmation_instructions:
53
+ subject: 'Anleitung zur Bestätigung Ihres Accounts'
54
+ reset_password_instructions:
55
+ subject: 'Anleitung um Ihr Passwort zurückzusetzen'
56
+ unlock_instructions:
57
+ subject: 'Anleitung um Ihren Account freizuschalten'
@@ -0,0 +1,60 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
14
+
15
+ devise:
16
+ failure:
17
+ already_authenticated: 'You are already signed in.'
18
+ unauthenticated: 'You need to sign in or sign up before continuing.'
19
+ unconfirmed: 'You have to confirm your account before continuing.'
20
+ locked: 'Your account is locked.'
21
+ not_found_in_database: 'Invalid email or password.'
22
+ invalid: 'Invalid email or password.'
23
+ invalid_token: 'Invalid authentication token.'
24
+ timeout: 'Your session expired, please sign in again to continue.'
25
+ inactive: 'Your account was not activated yet.'
26
+ sessions:
27
+ signed_in: 'Signed in successfully.'
28
+ signed_out: 'Signed out successfully.'
29
+ passwords:
30
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
31
+ updated: 'Your password was changed successfully. You are now signed in.'
32
+ updated_not_active: 'Your password was changed successfully.'
33
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
34
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
35
+ confirmations:
36
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
37
+ send_paranoid_instructions: 'If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
38
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
39
+ registrations:
40
+ signed_up: 'Welcome! You have signed up successfully.'
41
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
42
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
43
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
44
+ updated: 'You updated your account successfully.'
45
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
46
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
47
+ unlocks:
48
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
49
+ unlocked: 'Your account has been unlocked successfully. Please sign in to continue.'
50
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
51
+ omniauth_callbacks:
52
+ success: 'Successfully authenticated from %{kind} account.'
53
+ failure: 'Could not authenticate you from %{kind} because "%{reason}".'
54
+ mailer:
55
+ confirmation_instructions:
56
+ subject: 'Confirmation instructions'
57
+ reset_password_instructions:
58
+ subject: 'Reset password instructions'
59
+ unlock_instructions:
60
+ subject: 'Unlock Instructions'
data/config/routes.rb CHANGED
@@ -2,40 +2,56 @@ Alchemy::Engine.routes.draw do
2
2
 
3
3
  root :to => 'pages#show'
4
4
 
5
- match '/admin' => redirect(
5
+ get '/admin' => redirect(
6
6
  "#{Alchemy.mount_point}/admin/dashboard"
7
7
  )
8
- match '/admin/login' => 'user_sessions#login',
9
- :as => :login
10
- match '/admin/signup' => 'user_sessions#signup',
11
- :as => :signup
12
- match '/admin/leave' => 'user_sessions#leave',
13
- :as => :leave_admin
14
- match '/admin/logout' => 'user_sessions#logout',
15
- :as => :logout
16
- match '/admin/dashboard' => 'admin/dashboard#index',
8
+
9
+ get '/admin/dashboard' => 'admin/dashboard#index',
17
10
  :as => :admin_dashboard
18
11
 
19
- match '/attachment/:id/download(/:name)(.:format)' => 'attachments#download',
20
- :as => :download_attachment
12
+ devise_scope :user do
13
+ get '/admin/login' => 'user_sessions#new', :as => :login
14
+ post '/admin/login' => 'user_sessions#create', :as => :login
15
+ delete '/admin/logout' => 'user_sessions#destroy', :as => :logout
16
+ get '/admin/dashboard' => 'admin/dashboard#index', :as => :user_root
17
+ get '/admin/leave' => 'user_sessions#leave', :as => :leave_admin
18
+ get '/admin/passwords' => 'passwords#new', :as => :new_password
19
+ get '/admin/passwords/:id/edit' => 'passwords#edit', :as => :edit_password
20
+ post '/admin/passwords' => 'passwords#create', :as => :password
21
+ put '/admin/passwords' => 'passwords#update', :as => :password
22
+ end
23
+
24
+ # This actualy does all the Devise magic. I.e. current_user method in ApplicationController
25
+ devise_for(
26
+ :user,
27
+ :class_name => 'Alchemy::User',
28
+ :controllers => {
29
+ :sessions => 'alchemy/user_sessions'
30
+ },
31
+ :skip => [:sessions, :passwords] # skipping Devise default routes.
32
+ )
21
33
 
22
- # catching legacy download urls
23
- match '/wa_files/download/:id' => 'attachments#download'
24
- match '/uploads/files/0000/:id/:name(.:suffix)' => 'attachments#download'
34
+ get '/admin/signup' => 'users#new', :as => :signup
35
+ post '/admin/signup' => 'users#create', :as => :signup
25
36
 
26
- match '/attachment/:id/show' => 'attachments#show',
37
+ get '/attachment/:id/download(/:name)(.:format)' => 'attachments#download',
38
+ :as => :download_attachment
39
+ get '/attachment/:id/show' => 'attachments#show',
27
40
  :as => :show_attachment
28
41
 
29
- match "/pictures/:id/show(/:size)(/:crop)(/:crop_from/:crop_size)(/:quality)/:name.:format" => 'pictures#show',
42
+ # Legacy download urls
43
+ get '/wa_files/download/:id' => 'attachments#download'
44
+ get '/uploads/files/0000/:id/:name(.:suffix)' => 'attachments#download'
45
+
46
+ # Picture urls
47
+ get "/pictures/:id/show(/:size)(/:crop)(/:crop_from/:crop_size)(/:quality)/:name.:format" => 'pictures#show',
30
48
  :as => :show_picture
31
- match '/pictures/:id/zoom/:name.:format' => 'pictures#zoom',
49
+ get '/pictures/:id/zoom/:name.:format' => 'pictures#zoom',
32
50
  :as => :zoom_picture
33
- match "/pictures/:id/thumbnails/:size(/:crop)(/:crop_from/:crop_size)/:name.:format" => 'pictures#thumbnail',
51
+ get "/pictures/:id/thumbnails/:size(/:crop)(/:crop_from/:crop_size)/:name.:format" => 'pictures#thumbnail',
34
52
  :as => :thumbnail, :defaults => {:format => 'png', :name => "thumbnail"}
35
53
 
36
54
  resources :messages, :only => [:index, :new, :create]
37
-
38
- resources :user_sessions
39
55
  resources :elements, :only => :show
40
56
 
41
57
  namespace :admin do
@@ -0,0 +1,24 @@
1
+ class MigrateToDevise < ActiveRecord::Migration
2
+ def change
3
+ change_table :alchemy_users do |t|
4
+ t.rename :crypted_password, :encrypted_password
5
+ t.rename :login_count, :sign_in_count
6
+ t.rename :current_login_at, :current_sign_in_at
7
+ t.rename :last_login_at, :last_sign_in_at
8
+ t.rename :current_login_ip, :current_sign_in_ip
9
+ t.rename :last_login_ip, :last_sign_in_ip
10
+ t.rename :failed_login_count, :failed_attempts
11
+
12
+ t.remove :persistence_token
13
+ t.remove :perishable_token
14
+ t.remove :single_access_token
15
+
16
+ t.column :reset_password_token, :string
17
+ t.column :reset_password_sent_at, :datetime
18
+
19
+ t.index :email, :unique => true
20
+ t.index :login, :unique => true
21
+ t.index :reset_password_token, :unique => true
22
+ end
23
+ end
24
+ end
@@ -3,19 +3,6 @@ module Alchemy
3
3
 
4
4
  def self.included(base)
5
5
  base.send :alias_method, :current_alchemy_user, :current_user
6
- base.send :helper_method, :current_user
7
- end
8
-
9
- def current_user
10
- return @current_user if defined?(@current_user)
11
- @current_user = current_user_session && current_user_session.record
12
- end
13
-
14
- private
15
-
16
- def current_user_session
17
- return @current_user_session if defined?(@current_user_session)
18
- @current_user_session = UserSession.find
19
6
  end
20
7
 
21
8
  end
@@ -40,8 +40,8 @@ module Alchemy
40
40
  Alchemy::AuthEngine.get_instance.load(File.join(File.dirname(__FILE__), '../..', 'config/authorization_rules.rb'))
41
41
  end
42
42
 
43
- config.to_prepare do
44
- ApplicationController.send :include, Alchemy::AuthenticationHelpers
43
+ config.after_initialize do
44
+ #ApplicationController.send :include, Alchemy::AuthenticationHelpers
45
45
  end
46
46
 
47
47
  end
@@ -106,7 +106,7 @@ module Alchemy #:nodoc:
106
106
  case description['validate_format_as']
107
107
  when 'email'
108
108
  then
109
- matcher = Authlogic::Regex.email
109
+ matcher = Devise.email_regexp
110
110
  when 'url'
111
111
  then
112
112
  matcher = /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix
@@ -116,7 +116,7 @@ module Alchemy #:nodoc:
116
116
  else
117
117
  raise 'No validation format matcher given'
118
118
  end
119
- if ingredient.match(matcher).nil?
119
+ if ingredient.to_s.match(matcher).nil?
120
120
  self.validation_errors << :invalid
121
121
  end
122
122
  elsif validation == 'uniqueness' && !acts_as_essence_class.send("find_by_#{ingredient_column}", ingredient).blank?
@@ -23,6 +23,7 @@ module Alchemy
23
23
  upgrade_to_sites
24
24
  removed_standard_set_notice
25
25
  renamed_t_method
26
+ migrated_to_devise
26
27
 
27
28
  display_todos
28
29
  end
@@ -265,6 +266,38 @@ WARN
265
266
  warn = <<-WARN
266
267
  We renamed alchemy's `t` method override into `_t` to avoid conflicts with Rails own t method!
267
268
  If you use the `t` method to translate alchemy scoped keys, then you have to use the `_t` method from now on.
269
+ WARN
270
+ todo warn
271
+ end
272
+
273
+ def migrated_to_devise
274
+ warn = <<-WARN
275
+ We changed the authentication provider from Authlogic to Devise.
276
+
277
+ If you are upgrading from an old Alchemy version < 2.5.0, then you have to make changes to your Devise configuration.
278
+
279
+ 1. Run:
280
+
281
+ $ rails g alchemy:devise
282
+
283
+ And alter the encryptor to authlogic_sha512
284
+ and the stretches value from 10 to 20
285
+
286
+ # config/initializers/devise.rb
287
+ config.stretches = Rails.env.test? ? 1 : 20
288
+ config.encryptor = :authlogic_sha512
289
+
290
+ 2. Add the encryptable module to your Alchemy config.yml:
291
+
292
+ # config/alchemy/config.yml
293
+ devise_modules:
294
+ - :database_authenticatable
295
+ - :trackable
296
+ - :validatable
297
+ - :timeoutable
298
+ - :recoverable
299
+ - :encryptable
300
+
268
301
  WARN
269
302
  todo warn
270
303
  end
@@ -1,6 +1,6 @@
1
1
  module Alchemy
2
2
 
3
- VERSION = "2.5.0.b9"
3
+ VERSION = "2.5.0.rc3"
4
4
 
5
5
  def self.version
6
6
  VERSION
data/lib/alchemy_cms.rb CHANGED
@@ -4,7 +4,8 @@ if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 2
4
4
  require 'acts_as_list'
5
5
  require 'acts-as-taggable-on'
6
6
  require 'attachment_magic'
7
- require 'authlogic'
7
+ require 'devise'
8
+ require 'devise-encryptable'
8
9
  require 'awesome_nested_set'
9
10
  require 'dragonfly'
10
11
  require 'dynamic_form'
@@ -63,7 +63,7 @@ before "deploy:create_symlink", "deploy:migrate"
63
63
  # after hooks
64
64
  <%- if @database_type == "mysql" -%>
65
65
  after "deploy:setup", "alchemy:database_yml:create"
66
- after "deploy:assets:symlink", "alchemy:database_yml:symlink"
66
+ after "deploy:finalize_update", "alchemy:database_yml:symlink"
67
67
  <%- end -%>
68
68
  after "deploy", "deploy:cleanup"
69
69
 
@@ -0,0 +1,24 @@
1
+ require 'rails'
2
+
3
+ module Alchemy
4
+ module Generators
5
+ class DeviseGenerator < ::Rails::Generators::Base
6
+ desc "This generator copies the Alchemy Devise configuration into your app."
7
+ source_root File.expand_path('../../../../../config/initializers', File.dirname(__FILE__))
8
+
9
+ def copy_devise_config
10
+ copy_file "devise.rb", "#{Rails.root}/config/initializers/devise.rb"
11
+ msg = <<-MSG
12
+ If your are upgrading from Alchemy < 2.5.0, alter the encryptor to authlogic_sha512
13
+ and the stretches value from 10 to 20:
14
+
15
+ config.stretches = Rails.env.test? ? 1 : 20
16
+ config.encryptor = :authlogic_sha512
17
+
18
+ MSG
19
+ puts msg
20
+ end
21
+
22
+ end
23
+ end
24
+ end
@@ -1,113 +1,3 @@
1
1
  # == In this configuration you setup Alchemy´s element layouts.
2
2
  #
3
- # Use rails generate alchemy:scaffold to generate this file for your app.
4
- #
5
- # Elements containing all necessary basic tools for displaying and editing content inside Alchemy.
6
- # They consists of composed contents (different essence-types) as shown in the illustration of an elements-sheme below.
7
- #
8
- # == Schema of an element
9
- #
10
- # =================================
11
- # # Content 1 (EssenceText) #
12
- # # #
13
- # # Content 2 (EssencePicture) #
14
- # # #
15
- # # Content 3 (EssenceRichtext) #
16
- # =================================
17
- #
18
- # == Example of a basic element layout
19
- #
20
- # - name: a_unique_name (Used for the partial name in +app/views/elements+ and translated as Element.display_name)
21
- # unique: Bool //pass true if this element only can be displayed once on page
22
- # contents:
23
- # - name: head
24
- # type: EssenceText
25
- # - name: text
26
- # type: EssenceRichtext
27
- #
28
- # As already mentioned above, there are different content-types wich can be defined for each content in an element.
29
- # Defining these types is used to render predefined views in the element.
30
- #
31
- # == Content-Types:
32
- #
33
- # * EssenceText (Used to store a String (max. 255 Chars.) i.e. a headline, or productname. The editor is renderd as a single-lined input field. The view output will be sanitized and escaped. So it's XSS save.)
34
- # * EssenceRichtext (Used to store editable richtext. Editor is rendered as a textarea with TinyMCE Editor.)
35
- # * EssencePicture (Used to store picture ids from pictures assigned through the library. The editor is rendered as a picture-editor collection with a lot of options (i.e. image cropper). The view renders the assigned picture, resizes it, crops it and caches the result.)
36
- # * EssenceFlash (Used to store attachment ids from attachments assigned through the library. The view renders an embeded object.)
37
- # * EssenceDate (Used to store a DateTime object. The view output is passed through Rails I18n Library, so it will be fully localized.)
38
- # * EssenceHtml (Used to store a String (max. 255 Chars.). The view output renders the raw, not sanitized or unescaped String. So be carefull!)
39
- #
40
- # After finishing the setup of your element layouts, you need to generate the files for the elements before using them in Alchemy.
41
- # For creating these files, use the following command in your terminal:
42
- #
43
- # rails generate alchemy:elements
44
- #
45
- # All new elements will be created as two different partials in Rails.root/app/views/elements.
46
- # For each element there is an editor-view wich will be rendered when editing them in Alchemy and another view for the website´s frontend.
47
- #
48
- # app/views/elements/_elements_name_editor.html.erb
49
- # app/views/elements/_elements_name_view.html.erb
50
- #
51
- # For most contents of an element you can specify additional options, so they get rendered in a specific way.
52
- # These options can be defined as symbols, but its too much to list them up here.
53
- # You can find these options described in the application_helper.rb, most of them at the render_essence method.
54
- #
55
- # == Setting a content as preview-text for the element
56
- #
57
- # You can set a content-essence as preview-text for its element like this
58
- # take_me_for_preview: true
59
- #
60
- #
61
- # == Adding contents dynamically in the frontend
62
- #
63
- # You are able to add content-essences dynamically to the element from the Alchemy frontend.
64
- # You just have to make contents available for adding them.
65
- # This example enables this feature
66
- #
67
- # - name: headline
68
- # unique: false
69
- # contents:
70
- # - name: headline
71
- # type: EssenceText
72
- # - name: big_text
73
- # type: EssenceRichtext
74
- # available_contents:
75
- # - name: big_text
76
- # type: EssenceRichtext
77
- #
78
- # Now an Alchemy user can add the content 'big_text' from the element as much as desired.
79
- #
80
- #
81
- # == Deactivate indexing (Ferret search) for certain contents
82
- #
83
- # Contents of type EssenceText and EssenceRichtext can be excluded from being indexed by the Ferret search engine.
84
- #
85
- # Example:
86
- #
87
- # - name: contactform
88
- # unique: true
89
- # contents:
90
- # - name: mail_to
91
- # type: EssenceText
92
- # do_not_index: true
93
- #
94
- #
95
- # == Validate contents before updating the element
96
- #
97
- # More informations in [Content#essence_validations]
98
- #
99
- #
100
- # == Translate element and content names
101
- #
102
- # Element and content names are passed through the I18n library. So you can translate them in your config/locales language yml file.
103
- #
104
- # Example:
105
- #
106
- # de:
107
- # alchemy:
108
- # element_names:
109
- # contact: Kontakt
110
- # search: Suche
111
- # content_names:
112
- # headline: Überschrift
113
-
3
+ # For further informations please see http://guides.alchemy-cms.com/create_elements.html