Skip to content

Commit

Permalink
Moving login form in login action view to a partial so it can be mani…
Browse files Browse the repository at this point in the history
…pulated in add-ons.
  • Loading branch information
walter committed Jun 13, 2012
1 parent 1d9b228 commit 26f18c5
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 37 deletions.
37 changes: 37 additions & 0 deletions app/views/account/_login_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<fieldset>
<!--[form:login]-->
<% if Kete.is_configured? -%>
<p><%=t '.register',
:register_link => link_to(t('.register_link'),
{ :controller => 'account',
:action => 'signup',
:urlified_name => @site_basket.urlified_name},
:tabindex => '1') %></p>
<% else -%>
<p><%=t '.admin_details' %></p>
<% end -%>

<div class="form-element">
<label for="login"><%=t '.login' %></label>
<%= text_field_tag 'login', nil, :tabindex => '1' %>
</div>

<div class="form-element">
<label for="password"><%=t '.password' %></label>
<%= password_field_tag 'password', nil, :tabindex => '1' %>
</div>

<% if Kete.is_configured? -%>
<div class="form-element">
<label for="remember_me"><%=t '.remember_me' -%></label>
<%= check_box_tag 'remember_me', "1", false, :tabindex => '1' %>
</div>

<p><%=t '.forgot_password',
:forgot_password_link => link_to(t('.forgot_password_link'),
{ :controller => 'account',
:action => 'forgot_password',
:urlified_name => @site_basket.urlified_name},
:tabindex => '1') -%></p>
<% end -%>
</fieldset>
38 changes: 1 addition & 37 deletions app/views/account/login.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,7 @@
<h2><%= h(@title) -%></h2>
<% end -%>
<fieldset>
<!--[form:login]-->
<% if Kete.is_configured? -%>
<p><%=t 'account.login.register',
:register_link => link_to(t('account.login.register_link'),
{ :controller => 'account',
:action => 'signup',
:urlified_name => @site_basket.urlified_name},
:tabindex => '1') %></p>
<% else -%>
<p><%=t 'account.login.admin_details' %></p>
<% end -%>

<div class="form-element">
<label for="login"><%=t 'account.login.login' %></label>
<%= text_field_tag 'login', nil, :tabindex => '1' %>
</div>

<div class="form-element">
<label for="password"><%=t 'account.login.password' %></label>
<%= password_field_tag 'password', nil, :tabindex => '1' %>
</div>

<% if Kete.is_configured? -%>
<div class="form-element">
<label for="remember_me"><%=t 'account.login.remember_me' -%></label>
<%= check_box_tag 'remember_me', "1", false, :tabindex => '1' %>
</div>

<p><%=t 'account.login.forgot_password',
:forgot_password_link => link_to(t('account.login.forgot_password_link'),
{ :controller => 'account',
:action => 'forgot_password',
:urlified_name => @site_basket.urlified_name},
:tabindex => '1') -%></p>
<% end -%>
</fieldset>
<%= render :partial => "login_form" -%>

</div>

Expand Down
9 changes: 9 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ en:
register_link: "{{t.base.register}}"
remember_me: "Remember me:"
title: "{{t.base.login.capitalize}} to {{site_name}}"
login_form:
admin_details: "{{t.account.login.admin_details}}"
forgot_password: "{{t.account.login.forgot_password}}"
forgot_password_link: "{{t.account.login.forgot_password_link}}"
login: "{{t.account.login.login}}"
password: "{{t.account.loging.password}}"
register: "{{t.account.login.register}}"
register_link: "{{t.account.login.register_link}}"
remember_me: "{{t.account.login.remember_me}}"
portrait:
title: "Drag and Drop {{t.base.portrait.pluralize}} within the 'Other {{t.base.portrait.pluralize.capitalize}}' section to reorder them or place on top of the current {{t.base.portrait}} to {{t.base.change}} it."
portrait_controls:
Expand Down

0 comments on commit 26f18c5

Please sign in to comment.