Permalink
Browse files

Added and styled forms.

  • Loading branch information...
1 parent 0f5dbf9 commit d0baf2890c229d05363a7fc2ff6786b93bc4e99e Rian Rainey committed Jan 12, 2013
View
8 app/assets/stylesheets/custom.css.scss
@@ -31,6 +31,10 @@ textarea {
resize: vertical;
}
+.clear {
+ clear:both;
+}
+
.center {
text-align: center;
h1 {
@@ -195,5 +199,9 @@ input, textarea, select, .uneditable-input {
background-color: $btn-primary-color;
}
+.checkbox.inline {
+ padding-top: 1em;
+ margin-bottom: 1em;
+}
View
31 app/views/devise/registrations/new.html.erb
@@ -1,18 +1,27 @@
<h2>Sign up</h2>
-<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
- <%= devise_error_messages! %>
+<%= devise_error_messages! %>
- <div><%= f.label :email %><br />
- <%= f.email_field :email %></div>
+<div class="offset4 span6">
+ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
- <div><%= f.label :password %><br />
- <%= f.password_field :password %></div>
+ <div><%= f.label :email %>
+ <%= f.email_field :email, :class => "input-xlarge" %>
+ </div>
- <div><%= f.label :password_confirmation %><br />
- <%= f.password_field :password_confirmation %></div>
+ <div><%= f.label :password %>
+ <%= f.password_field :password, :class => "input-xlarge" %>
+ </div>
- <div><%= f.submit "Sign up" %></div>
-<% end %>
+ <div><%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, :class => "input-xlarge" %>
+ </div>
-<%= render "devise/shared/links" %>
+ <div><%= f.submit "Sign up", :class => "btn btn-primary" %></div>
+
+ <% end %>
+
+ <%= render "devise/shared/links" %>
+</div>
+
+<div class="clear"></div>
View
31 app/views/devise/sessions/new.html.erb
@@ -1,17 +1,26 @@
<h2>Sign in</h2>
-<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
- <div><%= f.label :email %><br />
- <%= f.email_field :email %></div>
+<div class="offset4 span6">
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
+ <div><%= f.label :email %>
+ <%= f.email_field :email, :class => "input-xlarge" %></div>
- <div><%= f.label :password %><br />
- <%= f.password_field :password %></div>
+ <div><%= f.label :password %>
+ <%= f.password_field :password, :class => "input-xlarge" %></div>
- <% if devise_mapping.rememberable? -%>
- <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
- <% end -%>
+ <% if devise_mapping.rememberable? -%>
+ <div class="bottom">
+ <%= f.check_box :remember_me %> <%= f.label :remember_me, :class=> "checkbox inline" %>
+ </div>
+ <% end -%>
- <div><%= f.submit "Sign in" %></div>
-<% end %>
+ <div>
+ <%= f.submit "Sign in", :class => "btn btn-primary" %>
+ </div>
+ <% end %>
-<%= render "devise/shared/links" %>
+ <%= render "devise/shared/links" %>
+
+</div>
+
+<div class="clear"></div>
View
31 app/views/users/_form.html.erb
@@ -0,0 +1,31 @@
+<%= form_for @user do |f| %>
+ <% if @user.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
+
+ <ul>
+ <% @user.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div class="field">
+ <%= f.label :firstName %>
+ <%= f.text_field :firstName %>
+ </div>
+ <div class="field">
+ <%= f.label :lastName %>
+ <%= f.text_field :lastName %>
+ </div>
+ <div class="field">
+ <%= f.label :email %>
+ <%= f.text_field :email %>
+ </div>
+
+
+ <div class="actions">
+ <%= f.submit :class => "btn btn-primary"%>
+ </div>
+<% end %>
View
6 app/views/users/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing user</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', edit_admin_user_path %> |
+<%= link_to 'Back', user_path %>

0 comments on commit d0baf28

Please sign in to comment.