jabe 0.5.9 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE.txt → MIT-LICENSE} +1 -1
- data/README.textile +46 -31
- data/Rakefile +30 -47
- data/app/assets/images/jabe/delete.png +0 -0
- data/{public/images → app/assets/images/jabe}/delete_page.png +0 -0
- data/{public/images → app/assets/images/jabe}/full_page.png +0 -0
- data/{public/images → app/assets/images/jabe}/gravatar.gif +0 -0
- data/{public/javascripts → app/assets/javascripts/jabe}/application.js +15 -0
- data/{public/javascripts → app/assets/javascripts/jabe}/libs/dd_belatedpng.js +0 -0
- data/{public/javascripts → app/assets/javascripts/jabe}/libs/modernizr-1.6.min.js +0 -0
- data/{public/javascripts → app/assets/javascripts/jabe}/plugins.js +0 -0
- data/app/assets/stylesheets/jabe/application.css +3 -0
- data/app/{stylesheets → assets/stylesheets/jabe}/boilerplate.scss +0 -0
- data/app/{stylesheets → assets/stylesheets/jabe}/jabe.scss +47 -8
- data/app/controllers/jabe/admin/base_controller.rb +7 -0
- data/app/controllers/jabe/admin/entries_controller.rb +49 -0
- data/app/controllers/jabe/admin/settings_controller.rb +13 -0
- data/app/controllers/jabe/application_controller.rb +5 -0
- data/app/controllers/jabe/comments_controller.rb +34 -0
- data/app/controllers/jabe/entries_controller.rb +30 -0
- data/app/controllers/jabe/feed_controller.rb +8 -0
- data/app/controllers/jabe/sessions_controller.rb +4 -0
- data/app/helpers/jabe/application_helper.rb +25 -0
- data/app/mailers/jabe/comment_mailer.rb +12 -0
- data/app/models/jabe/admin.rb +11 -0
- data/app/models/jabe/comment.rb +35 -0
- data/app/models/jabe/entry.rb +22 -0
- data/app/models/jabe/settings.rb +14 -0
- data/app/views/{admin → jabe/admin}/entries/_form.html.haml +1 -1
- data/app/views/{admin → jabe/admin}/entries/edit.html.haml +0 -0
- data/app/views/{admin → jabe/admin}/entries/index.html.haml +9 -7
- data/app/views/{admin → jabe/admin}/entries/new.html.haml +0 -0
- data/app/views/{admin → jabe/admin}/settings/edit.html.haml +2 -1
- data/app/views/jabe/comment_mailer/notification.html.erb +19 -0
- data/app/views/jabe/confirmations/new.html.erb +15 -0
- data/app/views/{entries → jabe/entries}/index.html.haml +4 -3
- data/app/views/jabe/entries/show.html.haml +49 -0
- data/app/views/{feed → jabe/feed}/index.xml.builder +3 -3
- data/app/views/jabe/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/jabe/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/jabe/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/jabe/passwords/edit.html.erb +19 -0
- data/app/views/jabe/passwords/new.html.erb +15 -0
- data/app/views/jabe/registrations/edit.html.erb +22 -0
- data/app/views/jabe/registrations/new.html.erb +17 -0
- data/app/views/jabe/sessions/new.html.erb +15 -0
- data/app/views/jabe/shared/_links.erb +25 -0
- data/app/views/jabe/unlocks/new.html.erb +15 -0
- data/app/views/layouts/jabe/_flashes.html.haml +3 -0
- data/app/views/layouts/{_footer.html.haml → jabe/_footer.html.haml} +0 -0
- data/app/views/layouts/jabe/_header.html.haml +4 -0
- data/app/views/layouts/jabe/_sidebar.html.haml +21 -0
- data/app/views/layouts/jabe/application.html.haml +63 -0
- data/{test/dummy/vendor/plugins/acts_as_textiled/init.rb → config/initializers/acts_as_textiled.rb} +2 -1
- data/config/initializers/devise.rb +3 -0
- data/config/initializers/settings.rb +5 -5
- data/config/initializers/simple_form.rb +93 -0
- data/config/initializers/time_formats.rb +1 -2
- data/config/locales/simple_form.en.yml +24 -0
- data/config/routes.rb +10 -5
- data/{test/dummy/db/migrate/20101229224027_create_settings.rb → db/migrate/20101230010434_create_settings.rb} +7 -2
- data/{lib/generators/jabe/templates/migrations/devise_create_admins.rb → db/migrate/20101230010436_devise_create_admins.rb} +6 -6
- data/{test/dummy/db/migrate/20101229224030_create_entries.rb → db/migrate/20101230010437_create_entries.rb} +2 -2
- data/{test/dummy/db/migrate/20101229224031_create_comments.rb → db/migrate/20101230010438_create_comments.rb} +3 -4
- data/{test/dummy/vendor/plugins/acts_as_textiled/lib/acts_as_textiled.rb → lib/acts_as_textiled/base.rb} +0 -0
- data/lib/jabe.rb +7 -15
- data/lib/jabe/engine.rb +5 -0
- data/lib/jabe/version.rb +3 -0
- data/lib/tasks/jabe_tasks.rake +4 -0
- metadata +187 -601
- data/Gemfile +0 -35
- data/Gemfile.lock +0 -214
- data/VERSION +0 -1
- data/app/controllers/admin/base_controller.rb +0 -3
- data/app/controllers/admin/entries_controller.rb +0 -42
- data/app/controllers/admin/settings_controller.rb +0 -11
- data/app/controllers/comments_controller.rb +0 -25
- data/app/controllers/entries_controller.rb +0 -26
- data/app/controllers/feed_controller.rb +0 -8
- data/app/helpers/jabe_helper.rb +0 -13
- data/app/models/admin.rb +0 -9
- data/app/models/comment.rb +0 -22
- data/app/models/entry.rb +0 -17
- data/app/models/settings.rb +0 -7
- data/app/stylesheets/_will_paginate.scss +0 -102
- data/app/stylesheets/handheld.scss +0 -7
- data/app/views/entries/_comment_form.html.haml +0 -3
- data/app/views/entries/show.html.haml +0 -38
- data/app/views/layouts/_header.html.haml +0 -4
- data/app/views/layouts/_sidebar.html.haml +0 -21
- data/app/views/layouts/application.html.haml +0 -59
- data/config/initializers/sass.rb +0 -5
- data/lib/generators/jabe/migrations/migrations_generator.rb +0 -38
- data/lib/generators/jabe/stylesheets/stylesheets_generator.rb +0 -9
- data/lib/generators/jabe/templates/migrations/add_new_settings.rb +0 -17
- data/lib/generators/jabe/templates/migrations/create_comments.rb +0 -20
- data/lib/generators/jabe/templates/migrations/create_entries.rb +0 -16
- data/lib/generators/jabe/templates/migrations/create_settings.rb +0 -21
- data/lib/generators/jabe/templates/migrations/create_slugs.rb +0 -18
- data/public/.htaccess +0 -220
- data/public/apple-touch-icon.png +0 -0
- data/public/blackbird/blackbird.css +0 -80
- data/public/blackbird/blackbird.js +0 -365
- data/public/blackbird/blackbird.png +0 -0
- data/public/crossdomain.xml +0 -25
- data/public/javascripts/jquery-ui.js +0 -11511
- data/public/javascripts/jquery-ui.min.js +0 -404
- data/public/javascripts/jquery.js +0 -7179
- data/public/javascripts/jquery.min.js +0 -167
- data/public/javascripts/libs/profiling/charts.swf +0 -0
- data/public/javascripts/libs/profiling/config.js +0 -59
- data/public/javascripts/libs/profiling/yahoo-profiling.css +0 -7
- data/public/javascripts/libs/profiling/yahoo-profiling.min.js +0 -39
- data/public/javascripts/rails.js +0 -154
- data/public/nginx.conf +0 -108
- data/public/robots.txt +0 -5
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/config/application.rb +0 -52
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -26
- data/test/dummy/config/environments/production.rb +0 -49
- data/test/dummy/config/environments/test.rb +0 -35
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/devise.rb +0 -142
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/routes.rb +0 -58
- data/test/dummy/db/migrate/20101229224028_create_slugs.rb +0 -18
- data/test/dummy/db/migrate/20101229224029_devise_create_admins.rb +0 -26
- data/test/dummy/db/migrate/20110104004400_add_new_settings.rb +0 -17
- data/test/dummy/db/schema.rb +0 -110
- data/test/dummy/features/step_definitions/admin_steps.rb +0 -14
- data/test/dummy/features/step_definitions/email_steps.rb +0 -194
- data/test/dummy/features/step_definitions/entry_steps.rb +0 -54
- data/test/dummy/features/step_definitions/support_steps.rb +0 -3
- data/test/dummy/features/step_definitions/web_steps.rb +0 -219
- data/test/dummy/features/support/blueprints.rb +0 -37
- data/test/dummy/features/support/env.rb +0 -59
- data/test/dummy/features/support/paths.rb +0 -39
- data/test/dummy/spec/spec_helper.rb +0 -0
- data/test/dummy/spec/support/blueprints.rb +0 -9
- data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/author.rb +0 -4
- data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/story.rb +0 -4
- data/test/dummy/vendor/plugins/acts_as_textiled/test/helper.rb +0 -87
- data/test/dummy/vendor/plugins/acts_as_textiled/test/textiled_test.rb +0 -145
@@ -0,0 +1,30 @@
|
|
1
|
+
module Jabe
|
2
|
+
class EntriesController < ApplicationController
|
3
|
+
include ApplicationHelper
|
4
|
+
|
5
|
+
helper_method :entry, :comment
|
6
|
+
|
7
|
+
def index
|
8
|
+
@entries = Entry.published.
|
9
|
+
page(params[:page]).
|
10
|
+
per( Jabe::SETTINGS.entries_per_page || 5)
|
11
|
+
end
|
12
|
+
|
13
|
+
def show
|
14
|
+
if entry.draft? && ! admin_signed_in?
|
15
|
+
render 'public/404.html', :layout => false, :status => 404
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def entry
|
22
|
+
@entry ||= Entry.find(params[:id])
|
23
|
+
end
|
24
|
+
|
25
|
+
def comment
|
26
|
+
@comment ||= entry.comments.new
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Jabe
|
2
|
+
module ApplicationHelper
|
3
|
+
include PublicEntryUrl
|
4
|
+
|
5
|
+
def default_gravatar_url
|
6
|
+
"#{request.protocol}#{request.host_with_port}#{asset_path('jabe/gravatar.gif')}"
|
7
|
+
end
|
8
|
+
|
9
|
+
def page_title(title)
|
10
|
+
@page_title = title
|
11
|
+
end
|
12
|
+
|
13
|
+
def stylesheet(name)
|
14
|
+
content_for :stylesheets do
|
15
|
+
stylesheet_link_tag(name)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def javascript(name)
|
20
|
+
content_for :javascripts do
|
21
|
+
javascript_include_tag(name)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CommentMailer < ActionMailer::Base
|
2
|
+
default :from => Jabe::SETTINGS.mail_from
|
3
|
+
|
4
|
+
def notification(comment, request)
|
5
|
+
@comment = comment
|
6
|
+
@request = request
|
7
|
+
|
8
|
+
mail(:to => Admin.all.map(&:email),
|
9
|
+
:subject => "Comment on: #{comment.entry.title}"
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Jabe
|
2
|
+
class Admin < ActiveRecord::Base
|
3
|
+
# Include default devise modules. Others available are:
|
4
|
+
# :token_authenticatable, :confirmable, :lockable and :timeoutable
|
5
|
+
devise :database_authenticatable, :recoverable, :rememberable, :trackable,
|
6
|
+
:validatable
|
7
|
+
|
8
|
+
# Setup accessible (or protected) attributes for your model
|
9
|
+
attr_accessible :email, :password, :password_confirmation, :remember_me
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Jabe
|
2
|
+
class Comment < ActiveRecord::Base
|
3
|
+
if defined?(Gravtastic)
|
4
|
+
include Gravtastic
|
5
|
+
is_gravtastic :size => 64
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_accessor :nickname
|
9
|
+
|
10
|
+
belongs_to :entry
|
11
|
+
default_scope :order => 'created_at ASC'
|
12
|
+
|
13
|
+
before_validation :bot_check
|
14
|
+
validates_presence_of :name, :email, :body, :message => 'Required'
|
15
|
+
|
16
|
+
acts_as_textiled :body
|
17
|
+
|
18
|
+
def send_notification(request)
|
19
|
+
begin
|
20
|
+
CommentMailer.notification(self, request).deliver
|
21
|
+
rescue => e
|
22
|
+
logger.error "#{e}\n#{e.backtrace.join("\n")}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def bot_check
|
29
|
+
unless self.nickname.blank?
|
30
|
+
errors.add(:nickname, 'You shouldn\'t have seen this...')
|
31
|
+
false
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Jabe
|
2
|
+
class Entry < ActiveRecord::Base
|
3
|
+
before_save :set_published_at
|
4
|
+
|
5
|
+
has_many :comments
|
6
|
+
|
7
|
+
extend FriendlyId
|
8
|
+
friendly_id :title, :use => :slugged
|
9
|
+
|
10
|
+
acts_as_textiled :body
|
11
|
+
|
12
|
+
default_scope :order => 'published_at DESC'
|
13
|
+
scope :drafts, :conditions => { :draft => true }
|
14
|
+
scope :published, :conditions => { :draft => false }
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def set_published_at
|
19
|
+
self.published_at = Time.now unless draft? || self.published_at
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Jabe
|
2
|
+
class Settings < ActiveRecord::Base
|
3
|
+
def do_updates
|
4
|
+
Time.zone = self.time_zone
|
5
|
+
ActionMailer::Base.default_url_options[:host] = self.host_name
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
# begin
|
10
|
+
SETTINGS = Settings.first || Settings.create
|
11
|
+
SETTINGS.do_updates
|
12
|
+
# rescue ActiveRecord::StatementInvalid
|
13
|
+
# end
|
14
|
+
end
|
File without changes
|
@@ -9,12 +9,12 @@
|
|
9
9
|
- @drafts.each do |entry|
|
10
10
|
%tr
|
11
11
|
%td
|
12
|
-
= link_to image_tag('delete_page.png'),
|
12
|
+
= link_to image_tag('jabe/delete_page.png'),
|
13
13
|
admin_entry_path(entry),
|
14
14
|
:confirm => 'Are you sure?',
|
15
15
|
:method => :delete,
|
16
16
|
:title => 'Delete'
|
17
|
-
= link_to image_tag('full_page.png'),
|
17
|
+
= link_to image_tag('jabe/full_page.png'),
|
18
18
|
entry_path(entry),
|
19
19
|
:title => 'Preview'
|
20
20
|
%td
|
@@ -29,15 +29,17 @@
|
|
29
29
|
- @published.each do |entry|
|
30
30
|
%tr
|
31
31
|
%td.icons
|
32
|
-
= link_to image_tag('delete_page.png'),
|
32
|
+
= link_to image_tag('jabe/delete_page.png'),
|
33
33
|
admin_entry_path(entry),
|
34
34
|
:confirm => 'Are you sure?',
|
35
35
|
:method => :delete,
|
36
36
|
:title => 'Delete'
|
37
|
-
= link_to image_tag('full_page.png'),
|
38
|
-
|
37
|
+
= link_to image_tag('jabe/full_page.png'),
|
38
|
+
public_entry_url(entry),
|
39
39
|
:title => 'Preview'
|
40
40
|
%td
|
41
41
|
= link_to entry.title, edit_admin_entry_path(entry)
|
42
|
-
|
43
|
-
|
42
|
+
.when
|
43
|
+
= entry.published_at.to_s(:long)
|
44
|
+
|
45
|
+
= paginate @published
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
%h2 Site Settings
|
2
|
-
=
|
2
|
+
= simple_form_for Jabe::SETTINGS, :url => admin_settings_path do |form|
|
3
3
|
= form.input :host_name, :label => 'Domain and port', :hint => '(e.g. pixels-and-bits.com or localhost:3000)'
|
4
4
|
= form.input :site_name
|
5
5
|
= form.input :tagline
|
@@ -10,4 +10,5 @@
|
|
10
10
|
= form.input :show_github_badge
|
11
11
|
= form.input :twitter_username
|
12
12
|
= form.input :facebook_url
|
13
|
+
= form.input :google_tracker_id
|
13
14
|
= form.submit 'Save'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<p>
|
2
|
+
From: <%= @comment.name %>
|
3
|
+
</p>
|
4
|
+
<p>
|
5
|
+
Email: <%= @comment.email %>
|
6
|
+
</p>
|
7
|
+
<p>
|
8
|
+
URL: <%= @comment.url %>
|
9
|
+
</p>
|
10
|
+
<p>
|
11
|
+
<%= @comment.body.html_safe %>
|
12
|
+
</p>
|
13
|
+
<hr>
|
14
|
+
<p>
|
15
|
+
Remote IP: <%= @request.remote_ip %>
|
16
|
+
</p>
|
17
|
+
<p>
|
18
|
+
User agent: <%= @request.user_agent %>
|
19
|
+
</p>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<h2>Resend confirmation instructions</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="inputs">
|
7
|
+
<%= f.input :email, :required => true %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="actions">
|
11
|
+
<%= f.button :submit, "Resend confirmation instructions" %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -2,12 +2,13 @@
|
|
2
2
|
- @entries.each do |entry|
|
3
3
|
.entry{ :class => entry == @entries.last ? 'last' : '' }
|
4
4
|
.title
|
5
|
-
|
5
|
+
%h1
|
6
|
+
= link_to entry.title, public_entry_url(entry)
|
6
7
|
.date
|
7
8
|
= entry.published_at.to_s(:long)
|
8
9
|
.content
|
9
10
|
~ entry.body.html_safe
|
10
11
|
.meta
|
11
|
-
= link_to "Comments: #{entry.comments.count}",
|
12
|
+
= link_to "Comments: #{entry.comments.count}", public_entry_url(entry) + '#comments'
|
12
13
|
#pagination.apple_pagination
|
13
|
-
=
|
14
|
+
= paginate @entries
|
@@ -0,0 +1,49 @@
|
|
1
|
+
- page_title entry.title
|
2
|
+
|
3
|
+
#entries
|
4
|
+
.entry.last
|
5
|
+
.title
|
6
|
+
%h1
|
7
|
+
= entry.title
|
8
|
+
.date
|
9
|
+
= entry.published_at.try(:to_s, :long)
|
10
|
+
.content
|
11
|
+
~ entry.body.html_safe
|
12
|
+
|
13
|
+
%a{ :name => 'comments' }
|
14
|
+
#comments
|
15
|
+
%h2 Comments
|
16
|
+
- if entry.comments.any?
|
17
|
+
- entry.comments.each do |comment|
|
18
|
+
.comment
|
19
|
+
- if admin_signed_in?
|
20
|
+
.delete
|
21
|
+
= link_to image_tag('jabe/delete.png'),
|
22
|
+
entry_comment_path(entry, comment),
|
23
|
+
:confirm => 'Are you sure?',
|
24
|
+
:method => :delete
|
25
|
+
- if comment.respond_to?(:gravatar_url)
|
26
|
+
.gravatar
|
27
|
+
= image_tag comment.gravatar_url(:default => default_gravatar_url)
|
28
|
+
.author
|
29
|
+
= comment.name
|
30
|
+
%span.when
|
31
|
+
= comment.created_at.to_s(:long)
|
32
|
+
.body
|
33
|
+
= comment.body.html_safe
|
34
|
+
- else
|
35
|
+
.comment
|
36
|
+
.author
|
37
|
+
None yet...
|
38
|
+
|
39
|
+
%a{ :name => 'add-comment' }
|
40
|
+
#new_comment
|
41
|
+
%h2 Add a comment
|
42
|
+
= simple_form_for [entry, comment] do |form|
|
43
|
+
= form.input :name
|
44
|
+
= form.input :nickname
|
45
|
+
= form.input :email, :label => 'Email (not shown to the public)'
|
46
|
+
= form.input :url, :label => 'Website'
|
47
|
+
= form.input :body, :label => 'Comment',
|
48
|
+
:hint => "Textile enabled (#{link_to 'Reference', 'http://redcloth.org/try-redcloth/', :target => '_blank'})".html_safe
|
49
|
+
= form.submit 'Add comment'
|
@@ -1,15 +1,15 @@
|
|
1
1
|
atom_feed do |feed|
|
2
|
-
feed.title(SETTINGS.site_name)
|
2
|
+
feed.title( Jabe::SETTINGS.site_name)
|
3
3
|
|
4
4
|
feed.updated @entries.first.try(:published_at)
|
5
5
|
|
6
6
|
@entries.each do |post|
|
7
|
-
feed.entry(post, :url => public_entry_url(post)) do |entry|
|
7
|
+
feed.entry(post, :url => 'http:' + public_entry_url(post)) do |entry|
|
8
8
|
entry.title h post.title
|
9
9
|
entry.content post.body, :type => 'html'
|
10
10
|
|
11
11
|
entry.author do |author|
|
12
|
-
author.name(SETTINGS.site_name)
|
12
|
+
author.name( Jabe::SETTINGS.site_name)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
|
4
|
+
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
|
6
|
+
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
|
4
|
+
|
5
|
+
<p>Click the link below to unlock your account:</p>
|
6
|
+
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<h2>Change your password</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<%= f.input :reset_password_token, :as => :hidden %>
|
7
|
+
<%= f.full_error :reset_password_token %>
|
8
|
+
|
9
|
+
<div class="inputs">
|
10
|
+
<%= f.input :password, :label => "New password", :required => true %>
|
11
|
+
<%= f.input :password_confirmation, :label => "Confirm your new password", :required => true %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="actions">
|
15
|
+
<%= f.button :submit, "Change my password" %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<h2>Forgot your password?</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="inputs">
|
7
|
+
<%= f.input :email, :required => true %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="actions">
|
11
|
+
<%= f.button :submit, "Send me reset password instructions" %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="inputs">
|
7
|
+
<%= f.input :email, :required => true, :autofocus => true %>
|
8
|
+
<%= f.input :password, :hint => "leave it blank if you don't want to change it", :required => false %>
|
9
|
+
<%= f.input :password_confirmation, :required => false %>
|
10
|
+
<%= f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="actions">
|
14
|
+
<%= f.button :submit, "Update" %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<h3>Cancel my account</h3>
|
19
|
+
|
20
|
+
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
|
21
|
+
|
22
|
+
<%= link_to "Back", :back %>
|