Skip to content

Commit b20e776

Browse files
committed
adopt twitter bootstap basics
1 parent f304510 commit b20e776

9 files changed

Lines changed: 52 additions & 22 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gem 'mm-devise', '>= 1.2'
2323
gem 'cancan'
2424

2525
gem 'inherited_resources'
26-
gem 'simple_form'
26+
gem 'simple_form', :git => "https://github.com/bitzesty/bootstrap_form.git"
2727
gem "semantic_menu", :git => "git://github.com/michaek/semantic_menu.git"
2828

2929
group :development do

Gemfile.lock

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ GIT
44
specs:
55
semantic_menu (0.1.0)
66

7+
GIT
8+
remote: https://github.com/bitzesty/bootstrap_form.git
9+
revision: 1b33bf01c7daf56bb42e3f944d745ee25d620cca
10+
specs:
11+
simple_form (1.5.0.dev)
12+
actionpack (~> 3.0)
13+
activemodel (~> 3.0)
14+
715
GEM
816
remote: http://rubygems.org/
917
specs:
@@ -176,9 +184,6 @@ GEM
176184
ffi (>= 1.0.7)
177185
json_pure
178186
rubyzip
179-
simple_form (1.4.2)
180-
actionpack (~> 3.0)
181-
activemodel (~> 3.0)
182187
sprockets (2.0.0.beta.15)
183188
hike (~> 1.2)
184189
rack (~> 1.0)
@@ -227,7 +232,7 @@ DEPENDENCIES
227232
rspec-rails
228233
sass-rails (~> 3.1.0.rc)
229234
semantic_menu!
230-
simple_form
235+
simple_form!
231236
sqlite3
232237
uglifier
233238
unicorn

app/assets/stylesheets/layout.css.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
body {
2+
padding-top: 50px;
3+
}
4+
15
.flash{
26
color: red;
37
padding: 2px;

app/views/layouts/application.html.haml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,28 @@
22
%html
33
%head
44
%title Hackety Hack!
5-
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-1.1.1.min.css">
5+
6+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7+
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-1.2.0.min.css">
8+
69
= stylesheet_link_tag "application"
710
= javascript_include_tag "application"
811
= csrf_meta_tags
912
%body
10-
= render "shared/menu/user"
11-
= render "shared/menu/main"
13+
%header.topbar
14+
.topbar-inner
15+
.container
16+
%h3
17+
= link_to "Hackety Hack", root_path
18+
= render "shared/menu/main"
19+
= render "shared/menu/user"
1220

13-
- if flash[:notice]
14-
.flash #{flash[:notice]}
21+
.container
22+
- if flash[:notice]
23+
.flash #{flash[:notice]}
1524

16-
%h1.title
17-
= yield :title
25+
%h1.title
26+
= yield :title
1827

19-
= yield :links
20-
= yield
28+
= yield :links
29+
= yield

app/views/questions/_form.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
.inputs
55
= f.input :title
6-
= f.input :description
6+
= f.input :description, :as => :text
77

88
.actions
99
= f.button :submit , 'Ask Everyone'
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
= semantic_menu do |root|
2-
- root.add "Home", root_path
1+
= semantic_menu :class => "nav" do |root|
32
- root.add "Questions", questions_path
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
= semantic_menu do |root|
1+
= semantic_menu :class => "nav secondary-nav" do |root|
22
- if current_user
3-
= current_user.username
3+
- root.add current_user.username, root_path
44
- root.add "Log Out", logout_path
55
- else
66
- root.add "Log In", login_path

app/views/static/root.html.haml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
%h1 Home!
1+
- content_for :title do
2+
Home!
3+
4+
Home!

config/initializers/simple_form.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
# Components used by the form builder to generate a complete input. You can remove
44
# any of them, change the order, or even add your own components to the stack.
55
# config.components = [ :placeholder, :label_input, :hint, :error ]
6+
config.components = [ :placeholder, :label_input, :hint ]
67

78
# Default tag used on hints.
89
# config.hint_tag = :span
910

1011
# CSS class to add to all hint tags.
1112
# config.hint_class = :hint
12-
13+
config.hint_class = "help-inline"
14+
1315
# CSS class used on errors.
1416
# config.error_class = :error
17+
config.error_class = "help-inline"
1518

1619
# Default tag used on errors.
1720
# config.error_tag = :span
@@ -30,12 +33,18 @@
3033

3134
# You can wrap all inputs in a pre-defined tag.
3235
# config.wrapper_tag = :div
36+
config.wrapper_tag = :div
37+
38+
config.input_wrapper_tag = :div
39+
config.input_wrapper_class = 'input'
3340

3441
# CSS class to add to all wrapper tags.
3542
# config.wrapper_class = :input
36-
43+
config.wrapper_class = :clearfix
44+
3745
# CSS class to add to the wrapper if the field has errors.
3846
# config.wrapper_error_class = :field_with_errors
47+
config.wrapper_error_class = :error
3948

4049
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
4150
# config.collection_wrapper_tag = nil
@@ -51,6 +60,7 @@
5160

5261
# How the label text should be generated altogether with the required text.
5362
# config.label_text = lambda { |label, required| "#{required} #{label}" }
63+
config.label_text = lambda { |label, required| "#{label} #{required}" }
5464

5565
# You can define the class to use on all labels. Default is nil.
5666
# config.label_class = nil

0 commit comments

Comments
 (0)