Skip to content

Commit db869b0

Browse files
committed
Fourth Commit
1 parent d267881 commit db869b0

14 files changed

Lines changed: 283 additions & 41 deletions

File tree

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ gem 'devise'
55
gem 'therubyracer'
66
gem 'less-rails'
77
gem 'twitter-bootstrap-rails'
8+
gem 'simple_form'
89
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
910
gem 'rails', '4.1.0'
1011
# Use sqlite3 as the database for Active Record

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ GEM
100100
sdoc (0.4.0)
101101
json (~> 1.8)
102102
rdoc (~> 4.0, < 5.0)
103+
simple_form (3.0.2)
104+
actionpack (~> 4.0)
105+
activemodel (~> 4.0)
103106
spring (1.1.3)
104107
sprockets (2.11.0)
105108
hike (~> 1.2)
@@ -147,6 +150,7 @@ DEPENDENCIES
147150
rails (= 4.1.0)
148151
sass-rails (~> 4.0.3)
149152
sdoc (~> 0.4.0)
153+
simple_form
150154
spring
151155
sqlite3
152156
therubyracer

app/assets/stylesheets/bootstrap_and_overrides.css.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@import "twitter/bootstrap/bootstrap";
2-
body{padding-top: 25px};
2+
body{padding-top: 40px};
33
@import "twitter/bootstrap/responsive";
44

55
// Set the correct sprite paths

app/assets/stylesheets/scaffolds.css.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ body {
22
background-color: #fff;
33
color: #333;
44
font-family: verdana, arial, helvetica, sans-serif;
5-
font-size: 13px;
5+
font-size: 14px;
66
line-height: 18px;
77
}
88

99
p, ol, ul, td {
1010
font-family: verdana, arial, helvetica, sans-serif;
11-
font-size: 13px;
11+
font-size: 14px;
1212
line-height: 18px;
1313
}
1414

app/models/status.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
class Status < ActiveRecord::Base
2+
belongs_to :user
23
end

app/views/devise/registrations/new.html.erb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
<h2>Sign up</h2>
21

3-
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
2+
<div class="row">
3+
<div class="span4">
4+
5+
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: {class: "well"}) do |f| %>
6+
7+
<fieldset>
8+
<legend>Sign up</legend>
49
<%= devise_error_messages! %>
510

611
<div><%= f.label :email %><br />
@@ -12,7 +17,10 @@
1217
<div><%= f.label :password_confirmation %><br />
1318
<%= f.password_field :password_confirmation, autocomplete: "off" %></div>
1419

15-
<div><%= f.submit "Sign up" %></div>
20+
<div><%= f.button :submit, "Sign up" %></div>
21+
</fieldset>
1622
<% end %>
1723

1824
<%= render "devise/shared/links" %>
25+
</div>
26+
</div>
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
<h2>Sign in</h2>
21

3-
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
4-
<div><%= f.label :email %><br />
5-
<%= f.email_field :email, autofocus: true %></div>
62

7-
<div><%= f.label :password %><br />
8-
<%= f.password_field :password, autocomplete: "off" %></div>
3+
<div class="row">
4+
<div class="span4">
95

6+
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: "well"}) do |f| %>
7+
8+
<fieldset>
9+
<legend>Sign In</legend>
10+
<%= f.input :email %>
11+
<%= f.input :password %>
12+
1013
<% if devise_mapping.rememberable? -%>
11-
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
14+
<div><%= f.input :remember_me, as: :boolean %> </div>
1215
<% end -%>
1316

14-
<div><%= f.submit "Sign in" %></div>
17+
<div><%= f.button :submit, "Sign in" %></div>
18+
</fieldset>
1519
<% end %>
1620

1721
<%= render "devise/shared/links" %>
22+
</div>
23+
</div>

app/views/devise/shared/_links.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<%- if controller_name != 'sessions' %>
2-
<%= link_to "Sign in", new_session_path(resource_name) %><br />
2+
<%= link_to "Already a Member? Sign In", new_session_path(resource_name) %><br />
33
<% end -%>
44

55
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6-
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
6+
<%= link_to "Not a Member yet? Sign up", new_registration_path(resource_name) %><br />
77
<% end -%>
88

99
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>

app/views/layouts/application.html.erb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<body>
4040

4141

42-
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
42+
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
4343
<div class="navbar-inner">
4444
<div class="container">
4545
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
@@ -54,6 +54,17 @@
5454
<li><%= link_to "Link2", "/path2" %></li>
5555
<li><%= link_to "Link3", "/path3" %></li>
5656
</ul>
57+
<ul class="nav pull-right">
58+
<% if user_signed_in? %>
59+
<li><%= link_to current_user.email, edit_user_registration_path %></li>
60+
<li><%= link_to "Log Out", destroy_user_session_path, method: :delete %></li>
61+
<% else %>
62+
<li><%= link_to "Register", new_user_registration_path %></li>
63+
<li><%= link_to "Log In", new_user_session_path %></li>
64+
<% end %>
65+
66+
67+
</ul>
5768
</div><!--/.nav-collapse -->
5869
</div>
5970
</div>
@@ -66,17 +77,6 @@
6677
<%= bootstrap_flash %>
6778
<%= yield %>
6879
</div>
69-
<div class="span3">
70-
<div class="well sidebar-nav">
71-
<h3>Sidebar</h3>
72-
<ul class="nav nav-list">
73-
<li class="nav-header">Sidebar</li>
74-
<li><%= link_to "Link1", "/path1" %></li>
75-
<li><%= link_to "Link2", "/path2" %></li>
76-
<li><%= link_to "Link3", "/path3" %></li>
77-
</ul>
78-
</div><!--/.well -->
79-
</div><!--/span-->
8080
</div><!--/row-->
8181

8282
<footer>

app/views/statuses/_form.html.erb

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= form_for(@status) do |f| %>
1+
<%= simple_form_for(@status, html: {class: "form-horizontal"}) do |f| %>
22
<% if @status.errors.any? %>
33
<div id="error_explanation">
44
<h2><%= pluralize(@status.errors.count, "error") %> prohibited this status from being saved:</h2>
@@ -10,16 +10,9 @@
1010
</ul>
1111
</div>
1212
<% end %>
13-
14-
<div class="field">
15-
<%= f.label :name %><br>
16-
<%= f.text_field :name %>
17-
</div>
18-
<div class="field">
19-
<%= f.label :content %><br>
20-
<%= f.text_area :content %>
21-
</div>
22-
<div class="actions">
23-
<%= f.submit %>
24-
</div>
13+
<%= f. input :name %>
14+
<%= f. input :content %>
15+
<div class="form-actions">
16+
<%= f.button :submit %>
17+
</div>
2518
<% end %>

0 commit comments

Comments
 (0)