diff --git a/Gemfile b/Gemfile
index c74efed0..f1f35c77 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,6 +4,7 @@ gem 'rails', '3.0.5'
gem 'gravatar_image_tag', '1.0.0.pre2'
gem 'will_paginate', '3.0.pre2'
gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'
+gem 'haml', '~>3.0.25'
group :development do
gem 'rspec-rails', '2.5.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 86f7a739..5b7bec61 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -40,6 +40,7 @@ GEM
rails (>= 3.0.0.beta4)
faker (0.3.1)
gravatar_image_tag (1.0.0.pre2)
+ haml (3.0.25)
i18n (0.5.0)
mail (2.2.15)
activesupport (>= 2.3.6)
@@ -101,6 +102,7 @@ DEPENDENCIES
factory_girl_rails (= 1.0)
faker (= 0.3.1)
gravatar_image_tag (= 1.0.0.pre2)
+ haml (~> 3.0.25)
rails (= 3.0.5)
rspec (= 2.5.0)
rspec-rails (= 2.5.0)
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
deleted file mode 100644
index 72028c9a..00000000
--- a/app/views/sessions/new.html.erb
+++ /dev/null
@@ -1,17 +0,0 @@
-
Sign in
-
-<%= form_for(:session, :url => sessions_path) do |f| %>
-
- <%= f.label :email %>
- <%= f.text_field :email %>
-
-
- <%= f.label :password %>
- <%= f.password_field :password %>
-
-
- <%= f.submit "Sign in" %>
-
-<% end %>
-
-New user? <%= link_to "Sign up now!", signup_path %>
\ No newline at end of file
diff --git a/app/views/sessions/new.html.haml b/app/views/sessions/new.html.haml
new file mode 100644
index 00000000..4b8fa88d
--- /dev/null
+++ b/app/views/sessions/new.html.haml
@@ -0,0 +1,16 @@
+%h1 Sign in
+
+= form_for(:session, :url => sessions_path) do |f|
+ .field
+ = f.label :email
+ %br
+ = f.text_field :email
+ .field
+ = f.label :password
+ %br
+ = f.password_field :password
+ .actions
+ = f.submit "Sign in"
+%p
+ New user?
+ = link_to "Sign up now!", signup_path
\ No newline at end of file
diff --git a/app/views/users/_fields.html.erb b/app/views/users/_fields.html.erb
deleted file mode 100644
index 0b04d327..00000000
--- a/app/views/users/_fields.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-
- <%= f.label :name %>
- <%= f.text_field :name %>
-
-
- <%= f.label :email %>
- <%= f.text_field :email %>
-
-
- <%= f.label :password %>
- <%= f.password_field :password %>
-
-
- <%= f.label :password_confirmation, "Confirmation" %>
- <%= f.password_field :password_confirmation %>
-
\ No newline at end of file
diff --git a/app/views/users/_fields.html.haml b/app/views/users/_fields.html.haml
new file mode 100644
index 00000000..f87aa34a
--- /dev/null
+++ b/app/views/users/_fields.html.haml
@@ -0,0 +1,16 @@
+.field
+ = f.label :name
+ %br
+ = f.text_field :name
+.field
+ = f.label :email
+ %br
+ = f.text_field :email
+.field
+ = f.label :password
+ %br
+ = f.password_field :password
+.field
+ = f.label :password_confirmation, "Confirmation"
+ %br
+ = f.password_field :password_confirmation
diff --git a/app/views/users/_follow.html.erb b/app/views/users/_follow.html.erb
deleted file mode 100644
index 8fd790d7..00000000
--- a/app/views/users/_follow.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<%= form_for(current_user.relationships.
- build(:followed_id => @user.id),
- :remote => true) do |f| %>
- <%= f.hidden_field :followed_id %>
- <%= f.submit "Follow" %>
-<% end %>
\ No newline at end of file
diff --git a/app/views/users/_follow.html.haml b/app/views/users/_follow.html.haml
new file mode 100644
index 00000000..34807089
--- /dev/null
+++ b/app/views/users/_follow.html.haml
@@ -0,0 +1,4 @@
+- relationship = current_user.relationships.build(:followed_id => @user.id)
+= form_for(relationship, :remote => true) do |f|
+ = f.hidden_field :followed_id
+ .actions= f.submit "Follow"
diff --git a/app/views/users/_follow_form.html.erb b/app/views/users/_follow_form.html.erb
deleted file mode 100644
index e3c5bee3..00000000
--- a/app/views/users/_follow_form.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<% unless current_user?(@user) %>
-
- <% if current_user.following?(@user) %>
- <%= render 'unfollow' %>
- <% else %>
- <%= render 'follow' %>
- <% end %>
-
-<% end %>
\ No newline at end of file
diff --git a/app/views/users/_follow_form.html.haml b/app/views/users/_follow_form.html.haml
new file mode 100644
index 00000000..90e666d0
--- /dev/null
+++ b/app/views/users/_follow_form.html.haml
@@ -0,0 +1,6 @@
+- unless current_user?(@user)
+ #follow_form
+ - if current_user.following?(@user)
+ = render 'unfollow'
+ - else
+ = render 'follow'
diff --git a/app/views/users/_unfollow.html.erb b/app/views/users/_unfollow.html.erb
deleted file mode 100644
index e34c12e1..00000000
--- a/app/views/users/_unfollow.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<%= form_for(current_user.relationships.find_by_followed_id(@user),
- :html => { :method => :delete },
- :remote => true) do |f| %>
- <%= f.submit "Unfollow" %>
-<% end %>
\ No newline at end of file
diff --git a/app/views/users/_unfollow.html.haml b/app/views/users/_unfollow.html.haml
new file mode 100644
index 00000000..3a5666bc
--- /dev/null
+++ b/app/views/users/_unfollow.html.haml
@@ -0,0 +1,4 @@
+- relationship = current_user.relationships.find_by_followed_id(@user)
+- delete = { :method => :delete }
+= form_for(relationship, :html => delete, :remote => true) do |f|
+ .actions= f.submit "Unfollow"
\ No newline at end of file
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb
deleted file mode 100644
index 532ae15c..00000000
--- a/app/views/users/_user.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-
- <%= gravatar_for user, :size => 30 %>
- <%= link_to user.name, user %>
- <% if current_user.admin? %>
- |
- <%= link_to "delete", user, :method => :delete, :confirm => "You sure?",
- :title => "Delete #{user.name}" %>
- <% end %>
-
\ No newline at end of file
diff --git a/app/views/users/_user.html.haml b/app/views/users/_user.html.haml
new file mode 100644
index 00000000..ab441761
--- /dev/null
+++ b/app/views/users/_user.html.haml
@@ -0,0 +1,8 @@
+%li
+ = gravatar_for user, :size => 30
+ = link_to user.name, user
+ - if current_user.admin?
+ |
+ - title = "Delete #{user.name}"
+ - opts = { :method => :delete, :confirm => "You sure?", :title => title }
+ = link_to "delete", user, opts
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb
deleted file mode 100644
index 3a572b82..00000000
--- a/app/views/users/edit.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-Edit user
-
-<%= form_for(@user) do |f| %>
- <%= render 'shared/error_messages', :object => f.object %>
- <%= render 'fields', :f => f %>
-
- <%= f.submit "Update" %>
-
-<% end %>
-
-
- <%= gravatar_for @user %>
-
change
-
diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml
new file mode 100644
index 00000000..f84fe4c9
--- /dev/null
+++ b/app/views/users/edit.html.haml
@@ -0,0 +1,11 @@
+%h1 Edit user
+
+= form_for(@user) do |f|
+ = render 'shared/error_messages', :object => f.object
+ = render 'fields', :f => f
+ .actions
+ = f.submit "Update"
+
+%div
+ = gravatar_for @user
+ %a{ :href => "http://gravatar.com/emails" } change
\ No newline at end of file
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
deleted file mode 100644
index d96cda33..00000000
--- a/app/views/users/index.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-All users
-
-<%= will_paginate %>
-
-
-
-<%= will_paginate %>
diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml
new file mode 100644
index 00000000..2e75d926
--- /dev/null
+++ b/app/views/users/index.html.haml
@@ -0,0 +1,4 @@
+%h1 All users
+= will_paginate
+%ul.users= render @users
+= will_paginate
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb.old
similarity index 100%
rename from app/views/users/new.html.erb
rename to app/views/users/new.html.erb.old
diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml
new file mode 100644
index 00000000..96ecd379
--- /dev/null
+++ b/app/views/users/new.html.haml
@@ -0,0 +1,7 @@
+%h1 Sign up
+
+= form_for(@user) do |f|
+ = render 'shared/error_messages', :object => f.object
+ = render 'fields', :f => f
+ .actions
+ = f.submit "Sign up"
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
deleted file mode 100644
index 711a45e0..00000000
--- a/app/views/users/show.html.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
- <%= gravatar_for @user %>
- <%= @user.name %>
-
- <%= render 'follow_form' if signed_in? %>
- <% if @user.microposts.any? %>
-
- <%= render @microposts %>
-
- <%= will_paginate @microposts %>
- <% end %>
- |
-
-
-
-
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
new file mode 100644
index 00000000..c8c349b6
--- /dev/null
+++ b/app/views/users/show.html.haml
@@ -0,0 +1,21 @@
+%table.profile{ :summary => "Profile information" }
+ %tr
+ %td.main
+ %h1
+ = gravatar_for @user
+ = @user.name
+ = render 'follow_form' if signed_in?
+ - if @user.microposts.any?
+ %table.microposts{ :summary => "User microposts" }
+ = render @microposts
+ = will_paginate @microposts
+ %td.sidebar.round
+ %strong Name
+ = @user.name
+ %br
+ %strong URL
+ = link_to user_path(@user), @user
+ %br
+ %strong Microposts
+ = @user.microposts.count
+ = render 'shared/stats'
diff --git a/app/views/users/show_follow.html.erb b/app/views/users/show_follow.html.erb
deleted file mode 100644
index dbc92dbf..00000000
--- a/app/views/users/show_follow.html.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- <%= @title %>
-
- <% if @users.any? %>
-
- <% end %>
- |
-
-
-
\ No newline at end of file
diff --git a/app/views/users/show_follow.html.haml b/app/views/users/show_follow.html.haml
new file mode 100644
index 00000000..24f12ed3
--- /dev/null
+++ b/app/views/users/show_follow.html.haml
@@ -0,0 +1,20 @@
+%table{ :summary => "Information about following/followers" }
+ %tr
+ %td.mail
+ %h1= @title
+ - if @users.any?
+ %ul.users
+ = render @users
+ %td.sidebar.round
+ %strong Name
+ = @user.name
+ %br
+ %strong URL
+ = link_to user_path(@user), @user
+ %br
+ %strong Microposts
+ = @user.microposts.count
+ = render 'shared/stats'
+ - if @users.any?
+ - @users.each do |user|
+ = link_to gravatar_for(user, :size => 30), user