This repository has been archived by the owner on Feb 6, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8819753
commit 284aaf9
Showing
6 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<r:ba:if_flash key="reset_password_email_sent"> | ||
We have sent you an email that will allow you to reset the password. | ||
</r:ba:if_flash> | ||
|
||
<form method="post" action="."> | ||
<p> | ||
<label for="email">Email</label><br/> | ||
<input id="email" type="text" name="email" value="<r:ba:request_param name="email" />"/> | ||
</p> | ||
<p> | ||
<input type="submit" value="Send me a reset link" name="commit" /> | ||
</p> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class ForgotPasswordPage < Page | ||
description %{ | ||
This page displays a page where people can ask for a reset password link. | ||
} | ||
|
||
before_validation_on_create :create_default_content | ||
|
||
def cache? | ||
false | ||
end | ||
|
||
def process(request, response) | ||
super | ||
end | ||
|
||
def create_default_content | ||
self.parent = Page.find_by_url('/') | ||
self.slug = 'forgot' | ||
self.breadcrumb = self.title = 'Forgot Password' | ||
self.status = Status[:published] | ||
|
||
parts << PagePart.new(:name => 'body', :content => read_file('default_forgot_password_part.html')) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class CreateForgotPasswordPage < ActiveRecord::Migration | ||
def self.up | ||
ForgotPasswordPage.create! | ||
end | ||
|
||
def self.down | ||
ForgotPasswordPage.destroy_all | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,6 @@ | |
visits "/account" | ||
end | ||
|
||
When /I view the forgot password page/ do | ||
visits "/forgot" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters