-
-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added clearance_views generator. by default, creates formtastic views…
… which pass all tests and features.
- Loading branch information
Dan Croak
committed
Aug 4, 2009
1 parent
73a4612
commit cd85f72
Showing
25 changed files
with
5,017 additions
and
12 deletions.
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
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
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
Empty file.
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,27 @@ | ||
class ClearanceViewsGenerator < Rails::Generator::Base | ||
|
||
def manifest | ||
record do |m| | ||
strategy = "formtastic" | ||
template_strategy = "erb" | ||
|
||
m.directory File.join("app", "views", "users") | ||
m.file "#{strategy}/users/new.html.#{template_strategy}", | ||
"app/views/users/new.html.#{template_strategy}" | ||
m.file "#{strategy}/users/_inputs.html.#{template_strategy}", | ||
"app/views/users/_inputs.html.#{template_strategy}" | ||
|
||
m.directory File.join("app", "views", "sessions") | ||
m.file "#{strategy}/sessions/new.html.#{template_strategy}", | ||
"app/views/sessions/new.html.#{template_strategy}" | ||
|
||
m.directory File.join("app", "views", "passwords") | ||
m.file "#{strategy}/passwords/new.html.#{template_strategy}", | ||
"app/views/passwords/new.html.#{template_strategy}" | ||
m.file "#{strategy}/passwords/edit.html.#{template_strategy}", | ||
"app/views/passwords/edit.html.#{template_strategy}" | ||
end | ||
end | ||
|
||
end | ||
|
21 changes: 21 additions & 0 deletions
21
generators/clearance_views/templates/formtastic/passwords/edit.html.erb
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,21 @@ | ||
<h2>Change your password</h2> | ||
|
||
<p> | ||
Your password has been reset. Choose a new password below. | ||
</p> | ||
|
||
<% semantic_form_for(:user, | ||
:url => user_password_path(@user, :token => @user.token), | ||
:html => { :method => :put }) do |form| %> | ||
<%= form.error_messages %> | ||
<% form.inputs do -%> | ||
<%= form.input :password, :as => :password, | ||
:label => "Choose password" %> | ||
<%= form.input :password_confirmation, :as => :password, | ||
:label => "Confirm password" %> | ||
<% end -%> | ||
<% form.buttons do -%> | ||
<%= form.commit_button "Save this password" %> | ||
<% end -%> | ||
<% end %> | ||
|
15 changes: 15 additions & 0 deletions
15
generators/clearance_views/templates/formtastic/passwords/new.html.erb
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,15 @@ | ||
<h2>Reset your password</h2> | ||
|
||
<p> | ||
We will email you a link to reset your password. | ||
</p> | ||
|
||
<% semantic_form_for :password, :url => passwords_path do |form| -%> | ||
<% form.inputs do -%> | ||
<%= form.input :email, :label => "Email address" %> | ||
<% end -%> | ||
<% form.buttons do -%> | ||
<%= form.commit_button "Reset password" %> | ||
<% end -%> | ||
<% end -%> | ||
|
22 changes: 22 additions & 0 deletions
22
generators/clearance_views/templates/formtastic/sessions/new.html.erb
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,22 @@ | ||
<h2>Sign in</h2> | ||
|
||
<% semantic_form_for :session, :url => session_path do |form| %> | ||
<% form.inputs do %> | ||
<%= form.input :email %> | ||
<%= form.input :password, :as => :password %> | ||
<%= form.input :remember_me, :as => :boolean, :required => false %> | ||
<% end %> | ||
<% form.buttons do %> | ||
<%= form.commit_button "Sign in" %> | ||
<% end %> | ||
<% end %> | ||
|
||
<ul> | ||
<li> | ||
<%= link_to "Sign up", new_user_path %> | ||
</li> | ||
<li> | ||
<%= link_to "Forgot password?", new_password_path %> | ||
</li> | ||
</ul> | ||
|
6 changes: 6 additions & 0 deletions
6
generators/clearance_views/templates/formtastic/users/_inputs.html.erb
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,6 @@ | ||
<% form.inputs do %> | ||
<%= form.input :email %> | ||
<%= form.input :password %> | ||
<%= form.input :password_confirmation, :label => "Confirm password" %> | ||
<% end %> | ||
|
10 changes: 10 additions & 0 deletions
10
generators/clearance_views/templates/formtastic/users/new.html.erb
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,10 @@ | ||
<h2>Sign up</h2> | ||
|
||
<% semantic_form_for @user do |form| %> | ||
<%= form.error_messages %> | ||
<%= render :partial => "/users/inputs", :locals => { :form => form } %> | ||
<% form.buttons do %> | ||
<%= form.commit_button "Sign up" %> | ||
<% 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
67 changes: 67 additions & 0 deletions
67
test/rails_root/vendor/gems/justinfrench-formtastic-0.2.1/.specification
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,67 @@ | ||
--- !ruby/object:Gem::Specification | ||
name: justinfrench-formtastic | ||
version: !ruby/object:Gem::Version | ||
version: 0.2.1 | ||
platform: ruby | ||
authors: | ||
- Justin French | ||
autorequire: formtastic | ||
bindir: bin | ||
cert_chain: [] | ||
|
||
date: 2009-06-17 00:00:00 -04:00 | ||
default_executable: | ||
dependencies: [] | ||
|
||
description: A Rails form builder plugin/gem with semantically rich and accessible markup | ||
email: justin@indent.com.au | ||
executables: [] | ||
|
||
extensions: [] | ||
|
||
extra_rdoc_files: | ||
- README.textile | ||
files: | ||
- MIT-LICENSE | ||
- README.textile | ||
- Rakefile | ||
- generators/formtastic_stylesheets/formtastic_stylesheets_generator.rb | ||
- generators/formtastic_stylesheets/templates/formtastic.css | ||
- generators/formtastic_stylesheets/templates/formtastic_changes.css | ||
- lib/formtastic.rb | ||
- lib/justin_french/formtastic.rb | ||
- lib/locale/en.yml | ||
- rails/init.rb | ||
- spec/formtastic_spec.rb | ||
- spec/test_helper.rb | ||
has_rdoc: true | ||
homepage: http://github.com/justinfrench/formtastic/tree/master | ||
licenses: [] | ||
|
||
post_install_message: | ||
rdoc_options: | ||
- --charset=UTF-8 | ||
require_paths: | ||
- lib | ||
required_ruby_version: !ruby/object:Gem::Requirement | ||
requirements: | ||
- - ">=" | ||
- !ruby/object:Gem::Version | ||
version: "0" | ||
version: | ||
required_rubygems_version: !ruby/object:Gem::Requirement | ||
requirements: | ||
- - ">=" | ||
- !ruby/object:Gem::Version | ||
version: "0" | ||
version: | ||
requirements: [] | ||
|
||
rubyforge_project: | ||
rubygems_version: 1.3.4 | ||
signing_key: | ||
specification_version: 3 | ||
summary: A Rails form builder plugin/gem with semantically rich and accessible markup | ||
test_files: | ||
- spec/formtastic_spec.rb | ||
- spec/test_helper.rb |
20 changes: 20 additions & 0 deletions
20
test/rails_root/vendor/gems/justinfrench-formtastic-0.2.1/MIT-LICENSE
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,20 @@ | ||
Copyright (c) 2008 Justin French | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.