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
@@ -46,7 +46,7 @@ module Alchemy
46
46
 
47
47
  case field.to_sym
48
48
  when :email
49
- validates_format_of field, :with => ::Authlogic::Regex.email, :if => :email_is_filled
49
+ validates_format_of field, :with => ::Devise.email_regexp, :if => :email_is_filled
50
50
  when :email_confirmation
51
51
  validates_confirmation_of :email
52
52
  end
@@ -46,7 +46,7 @@ module Alchemy
46
46
 
47
47
  has_many :folded_pages
48
48
  has_many :cells, :dependent => :destroy
49
- has_many :elements, :dependent => :destroy, :order => :position
49
+ has_many :elements, :order => :position
50
50
  has_many :contents, :through => :elements
51
51
  has_many :legacy_urls, :class_name => 'Alchemy::LegacyPageUrl'
52
52
  has_and_belongs_to_many :to_be_sweeped_elements, :class_name => 'Alchemy::Element', :uniq => true, :join_table => 'alchemy_elements_alchemy_pages'
@@ -74,6 +74,7 @@ module Alchemy
74
74
  after_update :trash_not_allowed_elements, :if => :page_layout_changed?
75
75
  after_update :autogenerate_elements, :if => :page_layout_changed?
76
76
  after_update :create_legacy_url, :if => :urlname_changed?
77
+ after_destroy { elements.each {|el| el.destroy unless el.trashed? } }
77
78
 
78
79
  scope :language_roots, where(:language_root => true)
79
80
  scope :layoutpages, where(:layoutpage => true)
@@ -95,6 +96,10 @@ module Alchemy
95
96
  # Used for flushing all page caches at once.
96
97
  scope :flushables, not_locked.published.contentpages
97
98
  scope :searchables, not_restricted.published.contentpages
99
+ # Scope for only the pages from Alchemy::Site.current
100
+ scope :from_current_site, lambda { where(:alchemy_languages => {site_id: Site.current}).joins(:language) }
101
+ # TODO: add this as default_scope
102
+ #default_scope { from_current_site }
98
103
 
99
104
  # Class methods
100
105
  #
@@ -158,7 +163,7 @@ module Alchemy
158
163
  #
159
164
  def copy_elements(source, target)
160
165
  new_elements = []
161
- source.elements.each do |element|
166
+ source.elements.not_trashed.each do |element|
162
167
  # detect cell for element
163
168
  if element.cell
164
169
  cell = target.cells.detect { |c| c.name == element.cell.name }
@@ -3,10 +3,9 @@ module Alchemy
3
3
 
4
4
  model_stamper
5
5
  stampable(:stamper_class_name => 'Alchemy::User')
6
- acts_as_authentic do |c|
7
- c.transition_from_restful_authentication = true
8
- c.logged_in_timeout = Config.get(:auto_logout_time).minutes
9
- end
6
+
7
+ devise(*Config.get(:devise_modules))
8
+
10
9
  acts_as_taggable
11
10
 
12
11
  attr_accessible(
@@ -24,59 +23,102 @@ module Alchemy
24
23
 
25
24
  has_many :folded_pages
26
25
 
27
- before_destroy :unlock_pages
26
+ # Unlock all locked pages before destroy and before the user gets logged out.
27
+ before_destroy :unlock_pages!
28
+ Warden::Manager.before_logout do |user, auth, opts|
29
+ if user
30
+ user.unlock_pages!
31
+ end
32
+ end
28
33
 
29
34
  scope :admins, where(:role => 'admin')
35
+ scope :logged_in, lambda { where("last_request_at > ?", logged_in_timeout.seconds.ago) }
36
+ scope :logged_out, lambda { where("last_request_at is NULL or last_request_at <= ?", logged_in_timeout.seconds.ago) }
30
37
 
31
38
  ROLES = Config.get(:user_roles)
32
39
 
40
+ class << self
41
+ def human_rolename(role)
42
+ I18n.t("user_roles.#{role}")
43
+ end
44
+
45
+ def genders_for_select
46
+ [
47
+ [I18n.t('male'), 'male'],
48
+ [I18n.t('female'), 'female']
49
+ ]
50
+ end
51
+
52
+ def logged_in_timeout
53
+ Config.get(:auto_logout_time).minutes.to_i
54
+ end
55
+ end
56
+
33
57
  def role_symbols
34
58
  [role.to_sym]
35
59
  end
36
60
 
61
+ # Returns true if the user ahs admin role
37
62
  def is_admin?
38
- self.role == "admin"
63
+ role == "admin"
39
64
  end
40
65
  alias_method :admin?, :is_admin?
41
66
 
42
- def unlock_pages
43
- for page in pages_locked_by_me
44
- page.unlock
45
- end
67
+ # Calls unlock on all locked pages
68
+ def unlock_pages!
69
+ pages_locked_by_me.map(&:unlock)
46
70
  end
47
71
 
72
+ # Returns all pages locked by user.
73
+ #
74
+ # A page gets locked, if the user requests to edit the page.
75
+ #
48
76
  def pages_locked_by_me
49
77
  Page.where(:locked => true).where(:locked_by => self.id).order(:updated_at)
50
78
  end
79
+ alias_method :locked_pages, :pages_locked_by_me
51
80
 
52
81
  # Returns the firstname and lastname as a string
82
+ #
53
83
  # If both are blank, returns the login
54
- # options
55
- # :flipped=false : returns "lastname, firstname"
84
+ #
85
+ # @option options :flipped (false)
86
+ # Flip the firstname and lastname
87
+ #
56
88
  def fullname(options = {})
57
- unless (self.lastname.blank? && self.firstname.blank?)
58
- options = (default_options = {:flipped => false}.merge(options))
59
- options[:flipped] ? "#{self.lastname}, #{self.firstname}".squeeze(" ") : "#{self.firstname} #{self.lastname}".squeeze(" ")
89
+ if lastname.blank? && firstname.blank?
90
+ login
60
91
  else
61
- self.login
92
+ options = {:flipped => false}.merge(options)
93
+ fullname = options[:flipped] ? "#{lastname}, #{firstname}" : "#{firstname} #{lastname}"
94
+ fullname.squeeze(" ").strip
62
95
  end
63
96
  end
97
+ alias_method :name, :fullname
64
98
 
65
- alias :name :fullname
99
+ # Returns true if the last request not longer ago then the logged_in_time_out
100
+ def logged_in?
101
+ raise "Can not determine the records login state because there is no last_request_at column" if !respond_to?(:last_request_at)
102
+ !last_request_at.nil? && last_request_at > logged_in_timeout.seconds.ago
103
+ end
104
+
105
+ # Opposite of logged_in?
106
+ def logged_out?
107
+ !logged_in?
108
+ end
66
109
 
67
110
  def human_role_name
68
111
  self.class.human_rolename(self.role)
69
112
  end
70
113
 
71
- def self.human_rolename(role)
72
- I18n.t("user_roles.#{role}")
114
+ def store_request_time!
115
+ update_attribute(:last_request_at, Time.now)
73
116
  end
74
117
 
75
- def self.genders_for_select
76
- [
77
- [I18n.t('male'), 'male'],
78
- [I18n.t('female'), 'female']
79
- ]
118
+ private
119
+
120
+ def logged_in_timeout
121
+ self.class.logged_in_timeout
80
122
  end
81
123
 
82
124
  end
@@ -8,7 +8,7 @@
8
8
  <% end -%>
9
9
  </h1>
10
10
  <p>
11
- <small><%= _t('Your last login was on %{time}', :time => l(current_user.last_login_at)) unless current_user.last_login_at.blank? %></small>
11
+ <small><%= _t('Your last login was on %{time}', :time => l(current_user.last_sign_in_at)) unless current_user.last_sign_in_at.blank? %></small>
12
12
  </p>
13
13
  </div>
14
14
  <div class="widget">
@@ -14,6 +14,7 @@
14
14
  [_t("left"), "left"],
15
15
  [_t("right"), "right"]
16
16
  ],
17
+ {},
17
18
  :class => 'alchemy_selectbox'
18
19
  ) %>
19
20
  </td>
@@ -1,3 +1,4 @@
1
+ <% if root = Alchemy::Page.rootpage %>
1
2
  <div id="create_language_tree_form" style="display: none">
2
3
  <div class="info">
3
4
  <%= render_icon('info') %>
@@ -37,7 +38,7 @@
37
38
  <%= form.hidden_field :language_code, :value => @language.code %>
38
39
  <%= form.hidden_field :page_layout, :value => @language.page_layout %>
39
40
  <%= form.hidden_field :language_root, :value => true %>
40
- <%= form.hidden_field :parent_id, :value => Alchemy::Page.rootpage.id %>
41
+ <%= form.hidden_field :parent_id, :value => root.id %>
41
42
  <%= hidden_field_tag :redirect_to, admin_pages_path %>
42
43
  <%= form.button _t("create_tree_as_new_language", :language => @language.name), :class => 'button' %>
43
44
  <% end %>
@@ -51,3 +52,9 @@
51
52
  <%- end -%>
52
53
 
53
54
  </div>
55
+ <% else %>
56
+ <%= render_message :error do %>
57
+ <h2>Root page not found.</h2>
58
+ <p>Please run <code>rake alchemy:db:seed</code> task.</p>
59
+ <% end %>
60
+ <% end %>
@@ -1,4 +1,4 @@
1
1
  <div class="flash <%= flash_type %>">
2
- <%= render_icon(flash_type.to_s == 'notice' ? 'tick' : flash_type.to_s) %>
2
+ <%= render_icon(flash_type.to_s) %>
3
3
  <%= message %>
4
4
  </div>
@@ -31,7 +31,7 @@
31
31
  <td class="label mandatory"><%= f.label 'password_confirmation' %></td>
32
32
  <td class="input"><%= f.password_field 'password_confirmation', :class => 'thin_border long', :autocomplete => "off", :required => action_name == 'signup' %></td>
33
33
  </tr>
34
- <% if action_name == 'signup' %>
34
+ <% if @signup %>
35
35
  <%= f.hidden_field :role %>
36
36
  <% elsif permitted_to? :update_role %>
37
37
  <tr>
@@ -39,7 +39,7 @@
39
39
  <td class="select"><%= f.select :role, options_for_select(@user_roles, @user.role), {}, {:class => 'alchemy_selectbox long'} %></td>
40
40
  </tr>
41
41
  <% end %>
42
- <% unless action_name == 'signup' %>
42
+ <% unless @signup %>
43
43
  <tr>
44
44
  <td class="label"><%= f.label :tag_list %></td>
45
45
  <td class="input">
@@ -8,7 +8,7 @@
8
8
  <td><%= user.lastname -%></td>
9
9
  <td class="email"><%= user.email %></td>
10
10
  <td><%= _t(user.language, :scope => 'translations') %></td>
11
- <td><%= user.last_login_at.present? ? l(user.last_login_at, :format => :default) : _t(:unknown) %></td>
11
+ <td><%= user.last_sign_in_at.present? ? l(user.last_sign_in_at, :format => :default) : _t(:unknown) %></td>
12
12
  <td class="role"><%= user.human_role_name %></td>
13
13
  <td class="tools">
14
14
  <%- permitted_to?(:destroy, :alchemy_admin_users) do -%>
@@ -26,7 +26,7 @@
26
26
  <th><%= Alchemy::User.human_attribute_name('lastname') %></th>
27
27
  <th class="email"><%= Alchemy::User.human_attribute_name('email') %></th>
28
28
  <th><%= Alchemy::User.human_attribute_name('language') %></th>
29
- <th><%= Alchemy::User.human_attribute_name('last_login_at') %></th>
29
+ <th><%= Alchemy::User.human_attribute_name('last_sign_in_at') %></th>
30
30
  <th class="role"><%= Alchemy::User.human_attribute_name('role') %></th>
31
31
  <th class="tools"></th>
32
32
  </tr>
@@ -0,0 +1,11 @@
1
+ Willkommen in Alchemy!
2
+
3
+ Um die Inhalte Ihrer Webseite zu bearbeiten klicken Sie bitte auf folgenden Link:
4
+
5
+ <%= @url %>
6
+
7
+ Ihr Benutzername lautet: <%= @user.login %>
8
+
9
+ (Aus Sicherheitsgründen stellen wir Ihr Passwort hier nicht da. Wenn Sie Ihr Passwort vergessen haben oder dies Ihr erster Login ist, gehen Sie bitte auf: <%= new_password_url(@user) %>)
10
+
11
+ Viel Spaß mit Alchemy!
@@ -0,0 +1,11 @@
1
+ Welcome to Alchemy!
2
+
3
+ To manage your website open a browser and go to:
4
+
5
+ <%= @url %>
6
+
7
+ Your username is: <%= @user.login %>
8
+
9
+ (For security reasons we do not show your password here. If you forgot your password or this is your first login, please goto: <%= new_password_url(@user) %>)
10
+
11
+ Have much fun with Alchemy!
@@ -5,6 +5,7 @@
5
5
  <%= @url %>
6
6
 
7
7
  <%= Alchemy::I18n.t('mailer.new_user_mail.username') %>: <%= @user.login %>
8
- <%= Alchemy::I18n.t('mailer.new_user_mail.password') %>: <%= @user.password %>
8
+
9
+ <%= Alchemy::I18n.t('mailer.new_user_mail.password_notice') % {:url => new_password_url(@user)}%>
9
10
 
10
11
  <%= Alchemy::I18n.t('mailer.new_user_mail.greeting') %>
@@ -0,0 +1,8 @@
1
+ Hallo <%= @user.fullname %>.
2
+
3
+ Sie haben angefordert Ihr Passwort zurückzusetzen. Dies kann durch anklicken des nachfolgenden Links bestätigt werden.
4
+
5
+ <%= alchemy.edit_password_url(@user, :reset_password_token => @user.reset_password_token) %>
6
+
7
+ Wenn Sie diese Zurücksetzung nicht angefragt haben, dann können Sie diese E-Mail einfach ignorieren.
8
+ Ihr Passwort wird erst dann zurückgesetzt, wenn Sie den Link anklicken.
@@ -0,0 +1,8 @@
1
+ Hello <%= @user.fullname %>.
2
+
3
+ You has requested to change your password. Please confirm this by clicking the link below.
4
+
5
+ <%= alchemy.edit_password_url(@user, :reset_password_token => @user.reset_password_token) %>
6
+
7
+ If you didn't request this, please ignore this email.
8
+ Your password won't change until you access the link above and create a new one.
@@ -0,0 +1,35 @@
1
+ <div id="login_box">
2
+ <div id="alchemy_greeting">
3
+ <%= image_tag("alchemy/alchemy-logo.png", :style => "width: 240px; height: 70px") %>
4
+ </div>
5
+ <div class="login_signup_box">
6
+ <% if @user.errors.blank? %>
7
+ <%= render_message do %>
8
+ <h1><%= _t 'Password reset' %></h1>
9
+ <p><%= _t 'Please enter a new password' %></p>
10
+ <% end %>
11
+ <% else %>
12
+ <div id="errors" style="display: block">
13
+ <%= devise_error_messages! %>
14
+ </div>
15
+ <% end %>
16
+ <%= form_for(:user, :url => password_path, :html => { :method => :put }) do |f| %>
17
+ <table>
18
+ <tr>
19
+ <td class="label"><%= f.label :password, _t("New password") %></td>
20
+ <td class="input"><%= f.password_field :password, :autofocus => true %></td>
21
+ </tr>
22
+ <tr>
23
+ <td class="label"><%= f.label :password_confirmation, _t("Confirm new password") %></td>
24
+ <td class="input"><%= f.password_field :password_confirmation %></td>
25
+ </tr>
26
+ <tr>
27
+ <td colspan="2" class="submit">
28
+ <%= f.hidden_field :reset_password_token %>
29
+ <%= f.button _t("Change password") %>
30
+ </td>
31
+ </tr>
32
+ </table>
33
+ <% end %>
34
+ </div>
35
+ </div>
@@ -0,0 +1,30 @@
1
+ <div id="login_box">
2
+ <div id="alchemy_greeting">
3
+ <%= image_tag("alchemy/alchemy-logo.png", :style => "width: 240px; height: 70px") %>
4
+ </div>
5
+ <div class="login_signup_box">
6
+ <% if @user.errors.blank? %>
7
+ <%= render_message do %>
8
+ <h1><%= _t 'Password reset' %></h1>
9
+ <p><%= _t 'Please enter your email address' %></p>
10
+ <% end %>
11
+ <% else %>
12
+ <div id="errors" style="display: block">
13
+ <%= devise_error_messages! %>
14
+ </div>
15
+ <% end %>
16
+ <%= form_for(:user, :url => password_path, :html => { :method => :post }) do |f| %>
17
+ <table>
18
+ <tr>
19
+ <td class="label"><%= f.label :email %></td>
20
+ <td class="input"><%= f.email_field :email, :autofocus => true %></td>
21
+ </tr>
22
+ <tr>
23
+ <td colspan="2" class="submit">
24
+ <%= f.button _t("Send reset instructions") %>
25
+ </td>
26
+ </tr>
27
+ </table>
28
+ <% end %>
29
+ </div>
30
+ </div>
@@ -4,8 +4,8 @@
4
4
  <label><%= _t("Do you want to") %></label>
5
5
  <%= link_to _t('stay logged in'), alchemy.root_path, :class => 'button' %>
6
6
  </p>
7
- <p class="buttons">
7
+ <%= form_tag alchemy.logout_path, :method => :delete, :class => 'buttons' do %>
8
8
  <label><%= _t('or to completly') %></label>
9
- <%= link_to _t('logout'), alchemy.logout_path, :class => 'button' %>
10
- </p>
9
+ <%= button _t('logout') %>
10
+ <% end %>
11
11
  </div>
@@ -3,7 +3,7 @@
3
3
  <%= image_tag("alchemy/alchemy-logo.png", :style => "width: 240px; height: 70px") %>
4
4
  </div>
5
5
  <div class="login_signup_box">
6
- <%= form_for @user_session, :url => {:action => 'login'}, :html => { :id => "login" } do |f| %>
6
+ <%= form_for :user, :url => {:action => :create}, :html => { :id => "login" } do |f| %>
7
7
  <%= f.error_messages %>
8
8
  <table>
9
9
  <tr>
@@ -20,6 +20,9 @@
20
20
  </td>
21
21
  <td class="input">
22
22
  <%= f.password_field :password, :class => 'thin_border' %>
23
+ <p class="foot_note">
24
+ <%= link_to _t('Forgot your password?'), new_password_path(@user) %>
25
+ </p>
23
26
  </td>
24
27
  </tr>
25
28
  <tr>
@@ -36,7 +39,7 @@
36
39
  <%- content_for :javascripts do -%>
37
40
  <script type="text/javascript" charset="utf-8">
38
41
  jQuery(function($) {
39
- $('#alchemy_user_session_login').focus();
42
+ $('#user_login').focus();
40
43
  $('#user_screensize').val(function() {
41
44
  return screen.width+'x'+screen.height;
42
45
  });
@@ -185,3 +185,15 @@ link_target_options: [blank]
185
185
 
186
186
  # Should pages that redirect to an external url open the link in a new tab/window?
187
187
  open_external_links_in_new_tab: true
188
+
189
+ # === Devise modules
190
+ #
191
+ # List of Devise modules that should be activated on the user model.
192
+ #
193
+ devise_modules:
194
+ - :database_authenticatable
195
+ - :trackable
196
+ - :validatable
197
+ - :timeoutable
198
+ - :recoverable
199
+ # - :encryptable # Uncomment this if you are upgrading from an Alchemy version < 2.5.0