bootstrap_devise_base 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. data/Gemfile +54 -0
  2. data/Gemfile.lock +237 -0
  3. data/Rakefile +7 -0
  4. data/app/.svn/all-wcprops +5 -0
  5. data/app/.svn/entries +31 -0
  6. data/app/assets/images/rails.png +0 -0
  7. data/app/assets/javascripts/application.js +16 -0
  8. data/app/assets/javascripts/registrations.js.coffee +3 -0
  9. data/app/assets/stylesheets/application.css +23 -0
  10. data/app/assets/stylesheets/bootstrap.scss +29 -0
  11. data/app/assets/stylesheets/forms.scss +481 -0
  12. data/app/assets/stylesheets/mixins.scss +220 -0
  13. data/app/assets/stylesheets/patterns.scss +1061 -0
  14. data/app/assets/stylesheets/registrations.css.scss +3 -0
  15. data/app/assets/stylesheets/reset.scss +144 -0
  16. data/app/assets/stylesheets/scaffolding.scss +144 -0
  17. data/app/assets/stylesheets/tables.scss +226 -0
  18. data/app/assets/stylesheets/type.scss +190 -0
  19. data/app/assets/stylesheets/variables.scss +60 -0
  20. data/app/controllers/.svn/all-wcprops +11 -0
  21. data/app/controllers/.svn/entries +62 -0
  22. data/app/controllers/.svn/text-base/assets_offline_controller.rb.svn-base +85 -0
  23. data/app/controllers/application_controller.rb +6 -0
  24. data/app/controllers/authentications_controller.rb +34 -0
  25. data/app/controllers/home_controller.rb +83 -0
  26. data/app/controllers/registrations_controller.rb +18 -0
  27. data/app/helpers/application_helper.rb +2 -0
  28. data/app/helpers/authentications_helper.rb +2 -0
  29. data/app/helpers/devise_helper.rb +29 -0
  30. data/app/helpers/home_helper.rb +2 -0
  31. data/app/helpers/registrations_helper.rb +2 -0
  32. data/app/mailers/.gitkeep +0 -0
  33. data/app/models/.gitkeep +0 -0
  34. data/app/models/authentication.rb +3 -0
  35. data/app/models/user.rb +20 -0
  36. data/app/views/authentications/_form.html.erb +16 -0
  37. data/app/views/authentications/edit.html.erb +8 -0
  38. data/app/views/authentications/index.html.erb +22 -0
  39. data/app/views/authentications/new.html.erb +5 -0
  40. data/app/views/authentications/show.html.erb +20 -0
  41. data/app/views/devise/confirmations/new.html.erb +12 -0
  42. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  43. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  44. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  45. data/app/views/devise/passwords/edit.html.erb +16 -0
  46. data/app/views/devise/passwords/new.html.erb +12 -0
  47. data/app/views/devise/sessions/new.html.erb +58 -0
  48. data/app/views/devise/shared/_links.erb +25 -0
  49. data/app/views/devise/unlocks/new.html.erb +12 -0
  50. data/app/views/home/_form.html.erb +17 -0
  51. data/app/views/home/edit.html.erb +6 -0
  52. data/app/views/home/index.html.erb +21 -0
  53. data/app/views/home/new.html.erb +5 -0
  54. data/app/views/home/show.html.erb +5 -0
  55. data/app/views/layouts/application.html.erb +112 -0
  56. data/app/views/registrations/edit.html.erb +25 -0
  57. data/app/views/registrations/new.html.erb +47 -0
  58. data/bootstrap_devise_base.gemspec +20 -0
  59. data/config.ru +4 -0
  60. data/config/.svn/all-wcprops +11 -0
  61. data/config/.svn/entries +62 -0
  62. data/config/.svn/text-base/routes.rb.svn-base +3 -0
  63. data/config/application.rb +48 -0
  64. data/config/boot.rb +6 -0
  65. data/config/cucumber.yml +8 -0
  66. data/config/database.yml +45 -0
  67. data/config/environment.rb +5 -0
  68. data/config/environments/development.rb +30 -0
  69. data/config/environments/production.rb +60 -0
  70. data/config/environments/test.rb +39 -0
  71. data/config/initializers/backtrace_silencers.rb +7 -0
  72. data/config/initializers/devise.rb +208 -0
  73. data/config/initializers/inflections.rb +10 -0
  74. data/config/initializers/mime_types.rb +5 -0
  75. data/config/initializers/omniauth.rb +3 -0
  76. data/config/initializers/secret_token.rb +7 -0
  77. data/config/initializers/session_store.rb +8 -0
  78. data/config/initializers/wrap_parameters.rb +14 -0
  79. data/config/locales/devise.en.yml +58 -0
  80. data/config/locales/en.yml +13 -0
  81. data/config/routes.rb +64 -0
  82. data/db/migrate/20111121201415_create_users.rb +8 -0
  83. data/db/migrate/20111121201511_add_devise_to_users.rb +31 -0
  84. data/db/migrate/20111127100158_create_authentications.rb +14 -0
  85. data/db/schema.rb +42 -0
  86. data/db/seeds.rb +7 -0
  87. data/doc/README_FOR_APP +2 -0
  88. data/features/manage_sign_ups.feature +28 -0
  89. data/features/step_definitions/sign_up_steps.rb +27 -0
  90. data/features/step_definitions/web_steps.rb +254 -0
  91. data/features/support/env.rb +56 -0
  92. data/features/support/paths.rb +39 -0
  93. data/features/support/selectors.rb +39 -0
  94. data/init.rb +1 -0
  95. data/lib/.svn/all-wcprops +11 -0
  96. data/lib/.svn/entries +65 -0
  97. data/lib/.svn/text-base/assets_offline.rb.svn-base +6 -0
  98. data/lib/assets/.gitkeep +0 -0
  99. data/lib/bootstap_devise_base.rb~ +6 -0
  100. data/lib/bootstrap_devise_base.rb +6 -0
  101. data/lib/bootstrap_devise_base/.svn/all-wcprops +11 -0
  102. data/lib/bootstrap_devise_base/.svn/entries +62 -0
  103. data/lib/bootstrap_devise_base/.svn/text-base/version.rb.svn-base +3 -0
  104. data/lib/bootstrap_devise_base/version.rb +3 -0
  105. data/lib/tasks/.gitkeep +0 -0
  106. data/lib/tasks/cucumber.rake +65 -0
  107. data/log/.gitkeep +0 -0
  108. data/log/development.log +977 -0
  109. data/log/production.log +44 -0
  110. data/log/test.log +799 -0
  111. data/public/404.html +26 -0
  112. data/public/422.html +26 -0
  113. data/public/500.html +26 -0
  114. data/public/assets/application-902e25928a309d43246c45cd2facd7d3.js +19 -0
  115. data/public/assets/application-902e25928a309d43246c45cd2facd7d3.js.gz +0 -0
  116. data/public/assets/application-a5e3fc47c863d5a64c7380ed33b187b6.css +1 -0
  117. data/public/assets/application-a5e3fc47c863d5a64c7380ed33b187b6.css.gz +0 -0
  118. data/public/assets/application.css +1 -0
  119. data/public/assets/application.css.gz +0 -0
  120. data/public/assets/application.js +19 -0
  121. data/public/assets/application.js.gz +0 -0
  122. data/public/assets/manifest.yml +4 -0
  123. data/public/assets/rails-e4b51606cd77fda2615e7439907bfc92.png +0 -0
  124. data/public/assets/rails.png +0 -0
  125. data/public/favicon.ico +0 -0
  126. data/public/robots.txt +5 -0
  127. data/script/cucumber +10 -0
  128. data/script/rails +6 -0
  129. data/test/fixtures/.gitkeep +0 -0
  130. data/test/functional/.gitkeep +0 -0
  131. data/test/integration/.gitkeep +0 -0
  132. data/test/performance/browsing_test.rb +12 -0
  133. data/test/test_helper.rb +13 -0
  134. data/test/unit/.gitkeep +0 -0
  135. data/vendor/assets/stylesheets/.gitkeep +0 -0
  136. data/vendor/plugins/.gitkeep +0 -0
  137. metadata +181 -0
@@ -0,0 +1,83 @@
1
+ class HomeController < ApplicationController
2
+ # GET /home
3
+ # GET /home.json
4
+ def index
5
+ #@home = Welcome.all
6
+
7
+ respond_to do |format|
8
+ format.html # index.html.erb
9
+ format.json { render json: @welcomes }
10
+ end
11
+ end
12
+
13
+ # GET /home/1
14
+ # GET /home/1.json
15
+ def show
16
+ @welcome = Welcome.find(params[:id])
17
+
18
+ respond_to do |format|
19
+ format.html # show.html.erb
20
+ format.json { render json: @welcome }
21
+ end
22
+ end
23
+
24
+ # GET /home/new
25
+ # GET /home/new.json
26
+ def new
27
+ @welcome = Welcome.new
28
+
29
+ respond_to do |format|
30
+ format.html # new.html.erb
31
+ format.json { render json: @welcome }
32
+ end
33
+ end
34
+
35
+ # GET /home/1/edit
36
+ def edit
37
+ @welcome = Welcome.find(params[:id])
38
+ end
39
+
40
+ # POST /home
41
+ # POST /home.json
42
+ def create
43
+ @welcome = Welcome.new(params[:welcome])
44
+
45
+ respond_to do |format|
46
+ if @welcome.save
47
+ format.html { redirect_to @welcome, notice: 'Welcome was successfully created.' }
48
+ format.json { render json: @welcome, status: :created, location: @welcome }
49
+ else
50
+ format.html { render action: "new" }
51
+ format.json { render json: @welcome.errors, status: :unprocessable_entity }
52
+ end
53
+ end
54
+ end
55
+
56
+ # PUT /home/1
57
+ # PUT /home/1.json
58
+ def update
59
+ @welcome = Welcome.find(params[:id])
60
+
61
+ respond_to do |format|
62
+ if @welcome.update_attributes(params[:welcome])
63
+ format.html { redirect_to @welcome, notice: 'Welcome was successfully updated.' }
64
+ format.json { head :ok }
65
+ else
66
+ format.html { render action: "edit" }
67
+ format.json { render json: @welcome.errors, status: :unprocessable_entity }
68
+ end
69
+ end
70
+ end
71
+
72
+ # DELETE /home/1
73
+ # DELETE /home/1.json
74
+ def destroy
75
+ @welcome = Welcome.find(params[:id])
76
+ @welcome.destroy
77
+
78
+ respond_to do |format|
79
+ format.html { redirect_to welcomes_url }
80
+ format.json { head :ok }
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,18 @@
1
+ class RegistrationsController < Devise::RegistrationsController
2
+
3
+ def create
4
+ super
5
+ session[:omniauth] = nil unless @user.new_record?
6
+ end
7
+
8
+ private
9
+
10
+ def build_resource(*args)
11
+ super
12
+ if session[:omniauth]
13
+ @user.apply_omniauth(session[:omniauth])
14
+ @user.valid?
15
+ end
16
+ end
17
+
18
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module AuthenticationsHelper
2
+ end
@@ -0,0 +1,29 @@
1
+ module DeviseHelper
2
+ # A simple way to show error messages for the current devise resource. If you need
3
+ # to customize this method, you can either overwrite it in your application helpers or
4
+ # copy the views to your application.
5
+ #
6
+ # This method is intended to stay simple and it is unlikely that we are going to change
7
+ # it to add more behavior or options.
8
+ def devise_error_messages!
9
+ return "" if resource.errors.empty?
10
+
11
+ messages = resource.errors.full_messages.map { |msg| content_tag(:p, msg) }.join
12
+ sentence = I18n.t("errors.messages.not_saved",
13
+ :count => resource.errors.count,
14
+ :resource => resource.class.model_name.human.downcase)
15
+
16
+ html = <<-HTML
17
+ <div class="alert-message error fade in" data-alert="alert">
18
+ <a class="close" href="#">x</a>
19
+ <p><strong>#{sentence}</strong></p><br/>
20
+ <ul>#{messages}</ul>
21
+ </div>
22
+ HTML
23
+
24
+ html.html_safe
25
+ end
26
+
27
+
28
+
29
+ end
@@ -0,0 +1,2 @@
1
+ module HomeHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module RegistrationsHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ class Authentication < ActiveRecord::Base
2
+ belongs_to :user
3
+ end
@@ -0,0 +1,20 @@
1
+ class User < ActiveRecord::Base
2
+ has_many :authentications
3
+
4
+ # Include default devise modules. Others available are:
5
+ # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
6
+ devise :database_authenticatable, :registerable,
7
+ :recoverable, :rememberable, :trackable, :validatable
8
+
9
+ # Setup accessible (or protected) attributes for your model
10
+ attr_accessible :email, :password, :password_confirmation, :remember_me
11
+
12
+ def apply_omniauth(omniauth)
13
+ authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])
14
+ end
15
+
16
+ def password_required?
17
+ (authentications.empty? || !password.blank?) && super
18
+ end
19
+
20
+ end
@@ -0,0 +1,16 @@
1
+ <%= form_for @authentication do |f| %>
2
+ <%= f.error_messages %>
3
+ <p>
4
+ <%= f.label :user_id %><br />
5
+ <%= f.number_field :user_id %>
6
+ </p>
7
+ <p>
8
+ <%= f.label :provider %><br />
9
+ <%= f.text_field :provider %>
10
+ </p>
11
+ <p>
12
+ <%= f.label :uid %><br />
13
+ <%= f.text_field :uid %>
14
+ </p>
15
+ <p><%= f.submit %></p>
16
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <% title "Edit Authentication" %>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <p>
6
+ <%= link_to "Show", @authentication %> |
7
+ <%= link_to "View All", authentications_path %>
8
+ </p>
@@ -0,0 +1,22 @@
1
+ <!--% title "Authentications" %-->
2
+ <h1>Authentications</h1>
3
+
4
+ <table>
5
+ <tr>
6
+ <th>User</th>
7
+ <th>Provider</th>
8
+ <th>Uid</th>
9
+ </tr>
10
+ <% for authentication in @authentications %>
11
+ <tr>
12
+ <td><%= authentication.user_id %></td>
13
+ <td><%= authentication.provider %></td>
14
+ <td><%= authentication.uid %></td>
15
+ <td><%= link_to "Show", authentication %></td>
16
+ <td><%= link_to "Edit", edit_authentication_path(authentication) %></td>
17
+ <td><%= link_to "Destroy", authentication, :confirm => 'Are you sure?', :method => :delete %></td>
18
+ </tr>
19
+ <% end %>
20
+ </table>
21
+
22
+ <p><%= link_to "New Authentication", new_authentication_path %></p>
@@ -0,0 +1,5 @@
1
+ <% title "New Authentication" %>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <p><%= link_to "Back to List", authentications_path %></p>
@@ -0,0 +1,20 @@
1
+ <% title "Authentication" %>
2
+
3
+ <p>
4
+ <strong>User:</strong>
5
+ <%= @authentication.user_id %>
6
+ </p>
7
+ <p>
8
+ <strong>Provider:</strong>
9
+ <%= @authentication.provider %>
10
+ </p>
11
+ <p>
12
+ <strong>Uid:</strong>
13
+ <%= @authentication.uid %>
14
+ </p>
15
+
16
+ <p>
17
+ <%= link_to "Edit", edit_authentication_path(@authentication) %> |
18
+ <%= link_to "Destroy", @authentication, :confirm => 'Are you sure?', :method => :delete %> |
19
+ <%= link_to "View All", authentications_path %>
20
+ </p>
@@ -0,0 +1,12 @@
1
+ <h2>Resend confirmation instructions</h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div><%= f.label :email %><br />
7
+ <%= f.email_field :email %></div>
8
+
9
+ <div><%= f.submit "Resend confirmation instructions" %></div>
10
+ <% end %>
11
+
12
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,5 @@
1
+ <p>Welcome <%= @resource.email %>!</p>
2
+
3
+ <p>You can confirm your account through the link below:</p>
4
+
5
+ <p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -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,16 @@
1
+ <h2>Change your password</h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+ <%= f.hidden_field :reset_password_token %>
6
+
7
+ <div><%= f.label :password, "New password" %><br />
8
+ <%= f.password_field :password %></div>
9
+
10
+ <div><%= f.label :password_confirmation, "Confirm new password" %><br />
11
+ <%= f.password_field :password_confirmation %></div>
12
+
13
+ <div><%= f.submit "Change my password" %></div>
14
+ <% end %>
15
+
16
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,12 @@
1
+ <h2>Forgot your password?</h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div><%= f.label :email %><br />
7
+ <%= f.email_field :email %></div>
8
+
9
+ <div><%= f.submit "Send me reset password instructions" %></div>
10
+ <% end %>
11
+
12
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,58 @@
1
+ <div class="facebook-signin">
2
+ <p><a href="/auth/twitter" class="btn primary large">Sign in with your Twitter account</a></p>
3
+ <h3>OR</h3>
4
+ </div>
5
+ <br/>
6
+
7
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
8
+
9
+
10
+ <% if flash.count > 0 %>
11
+ <div class="alert-message warning fade in" data-alert="alert">
12
+ <a class="close" href="#">x</a>
13
+ <% flash.each do |key, value| %>
14
+ <%= content_tag :div, value, :class => "flash #{key}" unless value.blank? %>
15
+ <% end %>
16
+ </div>
17
+ <% end %>
18
+
19
+ <%= devise_error_messages! %>
20
+
21
+ <fieldset class="span9 offset-one-sixth">
22
+
23
+ <legend>Sign in</legend> <br/>
24
+ <div class="clearfix">
25
+ <%= f.label :email %>
26
+ <div class="input">
27
+ <%= f.email_field :email, :class => 'xlarge', :size => '30' %>
28
+ </div>
29
+ </div>
30
+
31
+ <div class="clearfix">
32
+ <%= f.label :password %>
33
+ <div class="input">
34
+ <%= f.password_field :password, :class => 'xlarge', :size => '30' %>
35
+ </div>
36
+ </div>
37
+
38
+ <% if devise_mapping.rememberable? -%>
39
+ <div class="clearfix">
40
+ <label></label>
41
+ <div class="input">
42
+ <ul class="inputs-list">
43
+ <li>
44
+ <label></label>
45
+ <%= f.check_box :remember_me %>
46
+ <span>Remember me</span>
47
+ </li>
48
+ </ul>
49
+ </div>
50
+ </div>
51
+ <% end -%>
52
+
53
+ <div class="actions">
54
+ <%= f.submit "Sign in", :class=> 'btn primary' %>
55
+ </div>
56
+ </fieldset>
57
+ <% end %>
58
+
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to "Sign in", new_session_path(resource_name) %><br />
3
+ <% end -%>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
+ <% end -%>
8
+
9
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
10
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
+ <% end -%>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
+ <% end -%>
16
+
17
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
+ <% end -%>
20
+
21
+ <%- if devise_mapping.omniauthable? %>
22
+ <%- resource_class.omniauth_providers.each do |provider| %>
23
+ <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
24
+ <% end -%>
25
+ <% end -%>
@@ -0,0 +1,12 @@
1
+ <h2>Resend unlock instructions</h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div><%= f.label :email %><br />
7
+ <%= f.email_field :email %></div>
8
+
9
+ <div><%= f.submit "Resend unlock instructions" %></div>
10
+ <% end %>
11
+
12
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,17 @@
1
+ <%= form_for(@welcome) do |f| %>
2
+ <% if @welcome.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@welcome.errors.count, "error") %> prohibited this welcome from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @welcome.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="actions">
15
+ <%= f.submit %>
16
+ </div>
17
+ <% end %>