Browse Source

update sign in page with bootstrap 3

menu-feature
Brigitte Warner 10 years ago
parent
commit
d9ed9feec1
  1. BIN
      app/assets/images/velo_logo.png
  2. 27
      app/assets/stylesheets/application.css
  3. 4
      app/views/devise/_links.erb
  4. 86
      app/views/devise/sessions/new.html.erb

BIN
app/assets/images/velo_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

27
app/assets/stylesheets/application.css

@ -11,8 +11,31 @@
*= require_self
*= require datepicker
*= require bootstrap
*= require bootstrap-responsive
*= require bootstrap-timepicker
*= require bootstrap_and_overrides
*= require bootstrap-fontawesome
*/
.container {
max-width: 940px;
margin: 0 auto;
}
.container img {
display: block;
margin: 0 auto;
}
p {
text-align: center;
padding: 20px 0;
}
.check_box {
width: 30px;
height: 30px;
background-color: white;
}
label {
font-size: x-large;
}

4
app/views/devise/_links.erb

@ -6,13 +6,13 @@
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<p>
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn btn-block btn-default" %><br />
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn btn-block btn-default btn-lg" %><br />
</p>
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<p>
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn btn-block btn-default" %><br />
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn btn-block btn-default btn-lg" %><br />
</p>
<% end -%>

86
app/views/devise/sessions/new.html.erb

@ -1,48 +1,52 @@
<%= stylesheet_link_tag "bootstrap_and_overrides", :media => "all" %>
<%= stylesheet_link_tag "bootstrap", :media => "all" %>
<%= stylesheet_link_tag "application", :media => "all" %>
<div class="container">
<%= image_tag 'velo_logo.png' %>
<p><a href="http://madewithloveinbaltimore.org" class="made">Made with &hearts; in Baltimore</a></p>
<br>
<br>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="form-group">
<%= f.text_field :username, placeholder: "Username", class: "form-control input-lg", autofocus: true %>
</div>
<h2>Velocipede</h2>
<a href="http://madewithloveinbaltimore.org">Made with &hearts; in Baltimore</a>
<br>
<br>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div class="form-group">
<%= f.text_field :username, placeholder: "Username", class: "form-control input-lg"%>
</div>
<div class="form-group">
<%= f.password_field :password, placeholder: "Password", class: "form-control input-lg" %>
</div>
<div class="form-group">
<%= f.password_field :password, placeholder: "Password", class: "form-control input-lg" %>
</div>
<div class="form-group remember">
<% if devise_mapping.rememberable? -%>
<label>
<%= f.check_box :remember_me, class: 'check_box' %> Remember Me
</label>
<% end -%>
</div>
</div> <!-- end column -->
</div> <!-- end row -->
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="form-group">
<p>
<%= f.submit "Sign in", class:"btn btn-lg btn-primary col-xs-12 col-sm-12 col-md-12" %>
</p>
</div>
</div> <!-- end column -->
</div> <!-- end row -->
<% end %>
<div class="form-group">
<% if devise_mapping.rememberable? -%>
<label>
<%= f.check_box :remember_me %> Remember Me
</label>
<% end -%>
</div>
<%= render "links" %>
<div class="form-group">
<% if Rails.env.development? %>
<p>
<%= f.submit "Sign in", class:"btn btn-lg btn-primary" %>
</p>
<p> Or quickly... </p>
<div class="btn-group">
<input id="checkin" name="checkin" type="button" value="CHECK IN" class="btn btn-lg btn-success">
<input id="checkout" name="checkout" type="button" value="CHECK OUT" class="btn btn-lg btn-danger">
</div>
</div>
<% end %>
<%= render "links" %>
<% if Rails.env.development? %>
<p>
<% User.all.each do |user| %>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<%= f.hidden_field :username, :value => user.username%>
<%= f.hidden_field :password, :value => 'password' %>
<%= f.submit "Sign in as #{user.username}", class:"btn btn-info" %>
<% User.all.each do |user| %>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<%= f.hidden_field :username, :value => user.username%>
<%= f.hidden_field :password, :value => 'password' %>
<%= f.submit "Sign in as #{user.username}", class:"btn btn-info" %>
<% end %>
<% end %>
</p>
<% end %>
</p>
<% end %>
</div>
Loading…
Cancel
Save