1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Revert "Move devise/shared/_links.erb to devise/_links.erb"

This reverts commit aa2d15aa33.

Conflicts:

	CHANGELOG.rdoc
This commit is contained in:
Rodrigo Flores 2012-03-03 10:40:59 -03:00
parent 643d5600b2
commit 9bf718dd82
16 changed files with 52 additions and 47 deletions

View file

@ -1,25 +0,0 @@
<%- if controller_name != 'sessions' %>
<%= link_to "Sign in", new_session_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
<% end -%>

View file

@ -9,4 +9,4 @@
<div><%= f.submit "Resend confirmation instructions" %></div> <div><%= f.submit "Resend confirmation instructions" %></div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -13,4 +13,4 @@
<div><%= f.submit "Change my password" %></div> <div><%= f.submit "Change my password" %></div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -9,4 +9,4 @@
<div><%= f.submit "Send me reset password instructions" %></div> <div><%= f.submit "Send me reset password instructions" %></div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -15,4 +15,4 @@
<div><%= f.submit "Sign up" %></div> <div><%= f.submit "Sign up" %></div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -14,4 +14,4 @@
<div><%= f.submit "Sign in" %></div> <div><%= f.submit "Sign in" %></div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -1,3 +1,25 @@
<% ActiveSupport::Deprecation.warn "Rendering partials devise/shared/_links.erb is deprecated" \ <%- if controller_name != 'sessions' %>
"please use devise/_links.erb instead." %> <%= link_to "Sign in", new_session_path(resource_name) %><br />
<%= render "links" %> <% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
<% end -%>

View file

@ -9,4 +9,4 @@
<div><%= f.submit "Resend unlock instructions" %></div> <div><%= f.submit "Resend unlock instructions" %></div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -39,6 +39,17 @@ module Devise
end end
end end
class SharedViewsGenerator < Rails::Generators::Base #:nodoc:
include ViewPathTemplates
source_root File.expand_path("../../../../app/views/devise", __FILE__)
desc "Copies shared Devise views to your application."
# Override copy_views to just copy mailer and shared.
def copy_views
view_directory :shared
end
end
class FormForGenerator < Rails::Generators::Base #:nodoc: class FormForGenerator < Rails::Generators::Base #:nodoc:
include ViewPathTemplates include ViewPathTemplates
source_root File.expand_path("../../../../app/views/devise", __FILE__) source_root File.expand_path("../../../../app/views/devise", __FILE__)
@ -80,15 +91,12 @@ module Devise
end end
class ViewsGenerator < Rails::Generators::Base class ViewsGenerator < Rails::Generators::Base
include ViewPathTemplates
source_root File.expand_path("../../../../app/views/devise", __FILE__)
desc "Copies Devise views to your application." desc "Copies Devise views to your application."
def copy_views argument :scope, :required => false, :default => nil,
copy_file "_links.erb", "#{target_path}/_links.erb" :desc => "The scope to copy views to"
end
invoke SharedViewsGenerator
hook_for :form_builder, :aliases => "-b", hook_for :form_builder, :aliases => "-b",
:desc => "Form builder to be used", :desc => "Form builder to be used",
:default => defined?(SimpleForm) ? "simple_form_for" : "form_for" :default => defined?(SimpleForm) ? "simple_form_for" : "form_for"

View file

@ -12,4 +12,4 @@
</div> </div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -16,4 +16,4 @@
</div> </div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -12,4 +12,4 @@
</div> </div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -14,4 +14,4 @@
</div> </div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -12,4 +12,4 @@
</div> </div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -12,4 +12,4 @@
</div> </div>
<% end %> <% end %>
<%= render "links" %> <%= render :partial => "devise/shared/links" %>

View file

@ -46,7 +46,7 @@ class ViewsGeneratorTest < Rails::Generators::TestCase
assert_file "app/views/#{scope}/registrations/new.html.erb" assert_file "app/views/#{scope}/registrations/new.html.erb"
assert_file "app/views/#{scope}/registrations/edit.html.erb" assert_file "app/views/#{scope}/registrations/edit.html.erb"
assert_file "app/views/#{scope}/sessions/new.html.erb" assert_file "app/views/#{scope}/sessions/new.html.erb"
assert_file "app/views/#{scope}/shared/_links.erb"
assert_file "app/views/#{scope}/unlocks/new.html.erb" assert_file "app/views/#{scope}/unlocks/new.html.erb"
assert_file "app/views/#{scope}/_links.erb"
end end
end end