Skip to content

Commit

Permalink
rails_apps_composer: navigation links
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Mitchell committed Mar 11, 2014
1 parent 92e96d1 commit b3db4a6
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 0 deletions.
44 changes: 44 additions & 0 deletions app/assets/stylesheets/framework_and_overrides.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,47 @@ section {
@extend .row;
margin-top: 20px;
}

// Styles for Devise views
// using Foundation
// generated by the rails_layout gem
.authform {
padding-top: 30px;
max-width: 320px;
margin: 0 auto;
}
.authform form {
@include panel();
padding-bottom: 60px;
}
.authform form a {
font-size: rem-calc(13);
}
.authform form p {
font-size: rem-calc(13);
}
.authform .form-group {
// for Bootstrap, not used for Foundation
}
.authform .form-control {
// for Bootstrap, not used for Foundation
}
.authform .checkbox {
// for Bootstrap, not used for Foundation
}
.authform fieldset {
@include panel();
}
.authform #error_explanation {
@extend .alert-box;
@extend .alert;
}
.authform #error_explanation h2 {
font-size: rem-calc(16);
color: white;
}
.button-xs {
@extend .button;
@extend .radius;
@extend .tiny;
}
12 changes: 12 additions & 0 deletions app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="authform">
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :role => 'form'}) do |f| %>
<h3>Forgot your password?</h3>
<p>We'll send password reset instructions.</p>
<%= devise_error_messages! %>
<div class="form-group">
<%= f.label :email %>
<%= f.email_field :email, :autofocus => true, class: 'form-control' %>
</div>
<%= f.submit 'Reset Password', :class => 'button right' %>
<% end %>
</div>
41 changes: 41 additions & 0 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<div class="authform">
<h3>Edit <%= resource_name.to_s.humanize %></h3>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :role => 'form'}) do |f| %>
<%= devise_error_messages! %>
<div class="form-group">
<%= f.label :name %>
<%= f.text_field :name, :autofocus => true, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :email %>
<%= f.email_field :email, class: 'form-control' %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>
</div>
<fieldset>
<p>Leave these fields blank if you don't want to change your password.</p>
<div class="form-group">
<%= f.label :password %>
<%= f.password_field :password, :autocomplete => 'off', class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, class: 'form-control' %>
</div>
</fieldset>
<fieldset>
<p>You must enter your current password to make changes.</p>
<div class="form-group">
<%= f.label :current_password %>
<%= f.password_field :current_password, class: 'form-control' %>
</div>
</fieldset>
<%= f.submit 'Update', :class => 'button right' %>
<% end %>
</div>
<div class="authform">
<h3>Cancel Account</h3>
<p>Unhappy? We'll be sad to see you go.</p>
<%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete, :class => 'button right' %>
</div>
23 changes: 23 additions & 0 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="authform">
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :role => 'form'}) do |f| %>
<h3>Sign up</h3>
<%= devise_error_messages! %>
<div class="form-group">
<%= f.label :name %>
<%= f.text_field :name, :autofocus => true, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :email %>
<%= f.email_field :email, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :password %>
<%= f.password_field :password, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, class: 'form-control' %>
</div>
<%= f.submit 'Sign up', :class => 'button right' %>
<% end %>
</div>
26 changes: 26 additions & 0 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div class="authform">
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :role => 'form'}) do |f| %>
<h3>Log in</h3>
<%= devise_error_messages! %>
<div class="form-group">
<%- if devise_mapping.registerable? %>
<%= link_to 'Sign up', new_registration_path(resource_name), class: 'right' %>
<% end -%>
<%= f.label :email %>
<%= f.email_field :email, :autofocus => true, class: 'form-control' %>
</div>
<div class="form-group">
<%- if devise_mapping.recoverable? %>
<%= link_to "Forgot password?", new_password_path(resource_name), class: 'right' %>
<% end -%>
<%= f.label :password %>
<%= f.password_field :password, class: 'form-control' %>
</div>
<%= f.submit 'Log in', :class => 'button right' %>
<% if devise_mapping.rememberable? -%>
<div class="checkbox">
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
</div>
<% end -%>
<% end %>
</div>
13 changes: 13 additions & 0 deletions app/views/layouts/_navigation_links.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
<%# add navigation links to this file %>
<% if user_signed_in? %>
<li><%= link_to 'Logout', destroy_user_session_path, :method=>'delete' %></li>
<% else %>
<li><%= link_to 'Login', new_user_session_path %></li>
<% end %>
<% if user_signed_in? %>
<li><%= link_to 'Edit account', edit_user_registration_path %></li>
<% else %>
<li><%= link_to 'Sign up', new_user_registration_path %></li>
<% end %>
<% if user_signed_in? %>
<li><%= link_to 'Users', users_path %></li>
<% end %>

0 comments on commit b3db4a6

Please sign in to comment.