Skip to content

Commit a465fec

Browse files
committed
Second Commit
1 parent ce58774 commit a465fec

File tree

11 files changed

+194
-25
lines changed

11 files changed

+194
-25
lines changed

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
source 'https://rubygems.org'
22

3-
3+
gem 'therubyracer'
4+
gem 'less-rails'
5+
gem 'twitter-bootstrap-rails'
46
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
57
gem 'rails', '4.1.0'
68
# Use sqlite3 as the database for Active Record

Gemfile.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ GEM
3636
coffee-script-source
3737
execjs
3838
coffee-script-source (1.7.0)
39+
commonjs (0.2.7)
3940
erubis (2.7.0)
4041
execjs (2.2.1)
4142
hike (1.2.3)
@@ -47,6 +48,12 @@ GEM
4748
railties (>= 3.0, < 5.0)
4849
thor (>= 0.14, < 2.0)
4950
json (1.8.1)
51+
less (2.5.1)
52+
commonjs (~> 0.2.7)
53+
less-rails (2.5.0)
54+
actionpack (>= 3.1)
55+
less (~> 2.5.0)
56+
libv8 (3.16.14.3)
5057
mail (2.5.4)
5158
mime-types (~> 1.16)
5259
treetop (~> 1.4.8)
@@ -75,6 +82,7 @@ GEM
7582
rake (10.3.2)
7683
rdoc (4.1.1)
7784
json (~> 1.4)
85+
ref (1.0.5)
7886
sass (3.2.19)
7987
sass-rails (4.0.3)
8088
railties (>= 4.0.0, < 5.0)
@@ -95,6 +103,9 @@ GEM
95103
activesupport (>= 3.0)
96104
sprockets (~> 2.8)
97105
sqlite3 (1.3.9)
106+
therubyracer (0.12.1)
107+
libv8 (~> 3.16.14.0)
108+
ref
98109
thor (0.19.1)
99110
thread_safe (0.3.4)
100111
tilt (1.4.1)
@@ -103,6 +114,11 @@ GEM
103114
polyglot (>= 0.3.1)
104115
turbolinks (2.2.2)
105116
coffee-rails
117+
twitter-bootstrap-rails (2.2.8)
118+
actionpack (>= 3.1)
119+
execjs
120+
rails (>= 3.1)
121+
railties (>= 3.1)
106122
tzinfo (1.2.1)
107123
thread_safe (~> 0.1)
108124
uglifier (2.5.1)
@@ -116,10 +132,13 @@ DEPENDENCIES
116132
coffee-rails (~> 4.0.0)
117133
jbuilder (~> 2.0)
118134
jquery-rails
135+
less-rails
119136
rails (= 4.1.0)
120137
sass-rails (~> 4.0.3)
121138
sdoc (~> 0.4.0)
122139
spring
123140
sqlite3
141+
therubyracer
124142
turbolinks
143+
twitter-bootstrap-rails
125144
uglifier (>= 1.3.0)

app/assets/javascripts/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
//
1313
//= require jquery
1414
//= require jquery_ujs
15+
//= require twitter/bootstrap
1516
//= require turbolinks
1617
//= require_tree .
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
jQuery ->
2+
$("a[rel~=popover], .has-popover").popover()
3+
$("a[rel~=tooltip], .has-tooltip").tooltip()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# Place all the behaviors and hooks related to the matching controller here.
22
# All this logic will automatically be available in application.js.
33
# You can use CoffeeScript in this file: http://coffeescript.org/
4+
$ ->
5+
$('.status').hover (event) ->
6+
$(this).toggleClass("hover")
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@import "twitter/bootstrap/bootstrap";
2+
body{padding-top: 25px};
3+
@import "twitter/bootstrap/responsive";
4+
5+
// Set the correct sprite paths
6+
@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
7+
@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");
8+
9+
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
10+
@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
11+
@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot?#iefix");
12+
@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
13+
@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
14+
@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
15+
16+
// Font Awesome
17+
@import "fontawesome/font-awesome";
18+
19+
// Glyphicons
20+
//@import "twitter/bootstrap/sprites.less";
21+
22+
// Your custom LESS stylesheets goes here
23+
//
24+
// Since bootstrap was imported above you have access to its mixins which
25+
// you may use and inherit here
26+
//
27+
// If you'd like to override bootstrap's own variables, you can do so here as well
28+
// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
29+
//
30+
// Example:
31+
// @linkColor: #ff0000;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
// Place all the styles related to the statuses controller here.
22
// They will automatically be included in application.css.
33
// You can use Sass (SCSS) here: http://sass-lang.com/
4+
5+
.status.hover {
6+
background: #FAFAFA;
7+
}
8+
9+
.status .admin {
10+
display: none;
11+
}
12+
13+
.status.hover .admin {
14+
display: inline;
15+
}
Lines changed: 87 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,89 @@
11
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Treebook</title>
5-
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6-
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7-
<%= csrf_meta_tags %>
8-
</head>
9-
<body>
10-
11-
<%= yield %>
12-
13-
</body>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title><%= content_for?(:title) ? yield(:title) : "Treebook" %></title>
8+
<%= csrf_meta_tags %>
9+
10+
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
11+
<!--[if lt IE 9]>
12+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js" type="text/javascript"></script>
13+
<![endif]-->
14+
15+
<%= stylesheet_link_tag "application", :media => "all" %>
16+
17+
<!-- For third-generation iPad with high-resolution Retina display: -->
18+
<!-- Size should be 144 x 144 pixels -->
19+
<%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %>
20+
21+
<!-- For iPhone with high-resolution Retina display: -->
22+
<!-- Size should be 114 x 114 pixels -->
23+
<%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %>
24+
25+
<!-- For first- and second-generation iPad: -->
26+
<!-- Size should be 72 x 72 pixels -->
27+
<%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %>
28+
29+
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
30+
<!-- Size should be 57 x 57 pixels -->
31+
<%= favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %>
32+
33+
<!-- For all other devices -->
34+
<!-- Size should be 32 x 32 pixels -->
35+
<%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %>
36+
37+
<%= javascript_include_tag "application" %>
38+
</head>
39+
<body>
40+
41+
42+
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
43+
<div class="navbar-inner">
44+
<div class="container">
45+
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
46+
<span class="icon-bar"></span>
47+
<span class="icon-bar"></span>
48+
<span class="icon-bar"></span>
49+
</a>
50+
<a class="brand" href="#">Treebook</a>
51+
<div class="container nav-collapse">
52+
<ul class="nav">
53+
<li><%= link_to "All Statuses", statuses_path %></li>
54+
<li><%= link_to "Link2", "/path2" %></li>
55+
<li><%= link_to "Link3", "/path3" %></li>
56+
</ul>
57+
</div><!--/.nav-collapse -->
58+
</div>
59+
</div>
60+
</div>
61+
62+
63+
<div class="container">
64+
<div class="row">
65+
<div class="span9">
66+
<%= bootstrap_flash %>
67+
<%= yield %>
68+
</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-->
80+
</div><!--/row-->
81+
82+
<footer>
83+
<p>&copy; Company 2014</p>
84+
</footer>
85+
86+
</div> <!-- /container -->
87+
88+
</body>
1489
</html>

app/views/statuses/index.html.erb

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
<h1>Listing statuses</h1>
2-
3-
<table>
1+
<div class="page-header">
2+
<h1>All of the Statuses</h1>
3+
</div>
4+
<button type="button" class="btn btn-success"><%= link_to 'Post a New Status', new_status_path %></button>
5+
<table class="table">
46
<thead>
57
<tr>
6-
<th>Name</th>
7-
<th>Content</th>
8+
<th><h2>Name</h2></th>
9+
<th><h2>Content</h2></th>
810
<th colspan="3"></th>
911
</tr>
1012
</thead>
1113

1214
<tbody>
1315
<% @statuses.each do |status| %>
1416
<tr>
15-
<td><%= status.name %></td>
16-
<td><%= status.content %></td>
17-
<td><%= link_to 'Show', status %></td>
18-
<td><%= link_to 'Edit', edit_status_path(status) %></td>
19-
<td><%= link_to 'Destroy', status, method: :delete, data: { confirm: 'Are you sure?' } %></td>
17+
<td><strong><%= status.name %></strong></td>
18+
<td><p><%=link_to status.content , status %></p></td>
19+
<div class="btn-group">
20+
<td><%= link_to time_ago_in_words(status.created_at) + " ago" , status %></td>
21+
<span class="admin">
22+
<td><button type="button" class="btn btn-info"><%= link_to 'Edit', edit_status_path(status) %></button></td>
23+
<td><button type="button" class="btn btn-danger"><%= link_to 'Delete', status, method: :delete, data: { confirm: 'Are you sure?' } %></button></td>
24+
</span>
2025
</tr>
2126
<% end %>
2227
</tbody>
2328
</table>
2429

2530
<br>
2631

27-
<%= link_to 'New Status', new_status_path %>
32+

config/locales/en.bootstrap.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Sample localization file for English. Add more files in this directory for other locales.
2+
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3+
4+
en:
5+
helpers:
6+
actions: "Actions"
7+
links:
8+
back: "Back"
9+
cancel: "Cancel"
10+
confirm: "Are you sure?"
11+
destroy: "Delete"
12+
new: "New"
13+
edit: "Edit"
14+
titles:
15+
edit: "Edit %{model}"
16+
save: "Save %{model}"
17+
new: "New %{model}"
18+
delete: "Delete %{model}"

0 commit comments

Comments
 (0)