Permalink
Browse files

Converted to HAML and SCSS + Compass

  • Loading branch information...
1 parent 06c3200 commit e165eb314c71605a2f38b41eedcb2712aa0e27b4 @arunsark committed May 20, 2011
Showing with 1,547 additions and 17 deletions.
  1. +3 −0 Gemfile
  2. +11 −0 Gemfile.lock
  3. +31 −0 app/stylesheets/blog.sass
  4. +16 −0 app/stylesheets/ie.sass
  5. +21 −0 app/stylesheets/partials/_base.sass
  6. +9 −0 app/stylesheets/partials/_blog.sass
  7. +8 −0 app/stylesheets/print.sass
  8. +46 −0 app/stylesheets/screen.sass
  9. +11 −0 app/views/comments/_comment.html.haml
  10. +30 −0 app/views/comments/_new.html.haml
  11. +1 −0 app/views/comments/edit.html.haml
  12. +9 −0 app/views/devise/confirmations/new.html.haml
  13. +4 −0 app/views/devise/mailer/confirmation_instructions.html.haml
  14. +6 −0 app/views/devise/mailer/reset_password_instructions.html.haml
  15. +5 −0 app/views/devise/mailer/unlock_instructions.html.haml
  16. +14 −0 app/views/devise/passwords/edit.html.haml
  17. +9 −0 app/views/devise/passwords/new.html.haml
  18. +27 −0 app/views/devise/registrations/edit.html.haml
  19. +29 −0 app/views/devise/registrations/new.html.haml
  20. +16 −0 app/views/devise/sessions/new.html.haml
  21. +19 −0 app/views/devise/shared/_links.haml
  22. +9 −0 app/views/devise/unlocks/new.html.haml
  23. +26 −0 app/views/layouts/application.html.haml
  24. +35 −0 app/views/posts/_form.html.haml
  25. +5 −0 app/views/posts/edit.html.haml
  26. +20 −0 app/views/posts/index.html.haml
  27. +2 −0 app/views/posts/new.html.haml
  28. +18 −0 app/views/posts/show.html.haml
  29. +9 −0 app/views/users/confirmations/new.html.haml
  30. +4 −0 app/views/users/mailer/confirmation_instructions.html.haml
  31. +6 −0 app/views/users/mailer/reset_password_instructions.html.haml
  32. +5 −0 app/views/users/mailer/unlock_instructions.html.haml
  33. +14 −0 app/views/users/passwords/edit.html.haml
  34. +9 −0 app/views/users/passwords/new.html.haml
  35. +27 −0 app/views/users/registrations/edit.html.haml
  36. +17 −0 app/views/users/registrations/new.html.haml
  37. +16 −0 app/views/users/sessions/new.html.haml
  38. +19 −0 app/views/users/shared/_links.haml
  39. +9 −0 app/views/users/unlocks/new.html.haml
  40. +10 −0 config/compass.rb
  41. BIN public/images/grid.png
  42. BIN public/images/middle_bknd.png
  43. +163 −0 public/stylesheets/blog.css
  44. +109 −0 public/stylesheets/ie.css
  45. +73 −0 public/stylesheets/print.css
  46. +600 −0 public/stylesheets/screen.css
  47. +17 −17 spec/models/post_spec.rb
View
@@ -8,6 +8,9 @@ gem 'formtastic'
gem 'jquery-rails'
gem 'devise'
gem 'cancan'
+gem 'compass', '0.11.1'
+gem 'haml'
+gem 'sass'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
View
@@ -46,6 +46,11 @@ GEM
celerity (0.8.9)
childprocess (0.1.8)
ffi (~> 1.0.6)
+ chunky_png (1.2.0)
+ compass (0.11.1)
+ chunky_png (~> 1.1)
+ fssm (>= 0.2.7)
+ sass (~> 3.1)
configuration (1.2.0)
cucumber (0.10.2)
builder (>= 2.1.2)
@@ -76,8 +81,10 @@ GEM
actionpack (>= 2.3.7)
activesupport (>= 2.3.7)
i18n (~> 0.4)
+ fssm (0.2.7)
gherkin (2.3.7)
json (>= 1.4.6)
+ haml (3.1.0.alpha.147)
i18n (0.5.0)
jquery-rails (0.2.7)
rails (~> 3.0)
@@ -142,6 +149,7 @@ GEM
railties (~> 3.0)
rspec (~> 2.5.0)
rubyzip (0.9.4)
+ sass (3.1.1)
selenium-webdriver (0.2.0)
childprocess (>= 0.1.7)
ffi (>= 1.0.7)
@@ -166,15 +174,18 @@ DEPENDENCIES
bson_ext
cancan
capybara
+ compass (= 0.11.1)
cucumber-rails
database_cleaner
devise
factory_girl_rails
formtastic
+ haml
jquery-rails
launchy
mongoid
mongoid-rspec
mongoid_slug
rails (= 3.0.7)
rspec-rails
+ sass
View
@@ -0,0 +1,31 @@
+@import "partials/_base"
+
+=content_box($width, $last:false)
+ +column($width,$last)
+ @include background(image-url('middle_bknd.png'))
+ +border-radius(25px)
+ padding: 1em 1em 1em 2em
+
+.blog
+ +container
+ background-color: #8AC5E9
+ font-family: 'Helvetica Neue','Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif
+ a
+ text-decoration: none
+ #header, #footer
+ +column(24,true)
+ h3
+ font-family: 'Syncopate'
+ font-size: 2em
+ color: D4061E
+ #content
+ color: #F5F5F0
+ a
+ +link-colors(#9FCCF0,#C74451,#C74451,#9FFCF0,#C74451)
+ +hover-link
+ #left
+ +content_box(12)
+ #right
+ +content_box(4)
+
+
View
@@ -0,0 +1,16 @@
+@import blueprint
+
+// To generate css equivalent to the blueprint css but with your configuration applied, uncomment:
+// @include blueprint-ie
+
+//Recommended Blueprint configuration with scoping and semantic layout:
+body.bp
+ +blueprint-ie(true)
+ // Note: Blueprint centers text to fix IE6 container centering.
+ // This means all your texts will be centered under all version of IE by default.
+ // If your container does not have the .container class, don't forget to restore
+ // the correct behavior to your main container (but not the body tag!)
+ // Example:
+ // .my-container
+ // text-align: left
+
@@ -0,0 +1,21 @@
+// Here is where you can define your constants for your application and to configure the blueprint framework.
+// Feel free to delete these if you want keep the defaults:
+
+$blueprint-grid-columns : 24
+$blueprint-container-size : 950px
+$blueprint-grid-margin : 10px
+$font-color : #333333
+$header-color : darken($font-color,6.67%)
+
+// Use this to calculate the width based on the total width.
+// Or you can set $blueprint-grid-width to a fixed value and unset $blueprint-container-size -- it will be calculated for you.
+$blueprint-grid-width: ($blueprint-container-size + $blueprint-grid-margin) / $blueprint-grid-columns - $blueprint-grid-margin
+
+@import "compass/reset"
+@import "compass/css3"
+@import "blueprint"
+@import "compass/utilities"
+@import "blueprint/grid"
+@import "blueprint/colors"
+@import "compass/typography/links"
+@import "compass/typography/links/link-colors"
@@ -0,0 +1,9 @@
+
+.blog
+ +container
+ background-color: #666
+ #header, #footer
+ +column(8)
+ #content
+ +column(5,true)
+
@@ -0,0 +1,8 @@
+@import blueprint
+
+// To generate css equivalent to the blueprint css but with your configuration applied, uncomment:
+// @include blueprint-print
+
+//Recommended Blueprint configuration with scoping and semantic layout:
+body.bp
+ +blueprint-print(true)
@@ -0,0 +1,46 @@
+// This import applies a global reset to any page that imports this stylesheet.
+@import blueprint/reset
+// To configure blueprint, edit the partials/base.sass file.
+@import partials/base
+// Import all the default blueprint modules so that we can access their mixins.
+@import blueprint
+// Import the non-default scaffolding module.
+@import blueprint/scaffolding
+
+// To generate css equivalent to the blueprint css but with your
+// configuration applied, uncomment:
+// @include blueprint
+
+// If you are doing a lot of stylesheet concatenation, it is suggested
+// that you scope your blueprint styles, so that you can better control
+// what pages use blueprint when stylesheets are concatenated together.
+body.bp
+ +blueprint-typography(true)
+ +blueprint-utilities
+ +blueprint-debug
+ +blueprint-interaction
+ // Remove the scaffolding when you're ready to start doing visual design.
+ // Or leave it in if you're happy with how blueprint looks out-of-the-box
+form.bp
+ +blueprint-form
+ // You'll probably want to remove the scaffolding once you start styling your site.
+ +blueprint-scaffolding
+
+// Page layout can be done using mixins applied to your semantic classes and IDs:
+body.two-col
+ #container
+ +container
+ #header, #footer
+ +column($blueprint-grid-columns)
+ #sidebar
+ // One third of the grid columns, rounding down. With 24 cols, this is 8.
+ $sidebar-columns: floor($blueprint-grid-columns / 3)
+ +column($sidebar-columns)
+ #content
+ // Two thirds of the grid columns, rounding up.
+ // With 24 cols, this is 16.
+ $content-columns: ceil(2 * $blueprint-grid-columns / 3)
+ // true means it's the last column in the row
+ +column($content-columns, true)
+
+
@@ -0,0 +1,11 @@
+%h3
+ = comment.author
+%p
+ = comment.published_on
+%p
+ = comment.content
+- if comment.author && can?(:update,comment)
+ %p
+ = link_to "Edit Comment", edit_post_comment_path(@post,comment)
+- if comment.author && can?(:destroy,comment)
+ = link_to "Delete Comment", [@post,comment],:confirm => "Are you sure?" , :method => :delete
@@ -0,0 +1,30 @@
+= form_for [@post,@comment] do |f|
+ - if @comment.errors.any?
+ #error_explanation
+ %h2
+ = pluralize(@comment.errors.count, "error")
+ prohibited this post from being saved:
+ %ul
+ - @comment.errors.full_messages.each do |msg|
+ %li= msg
+ - if flash[:alert]
+ %p#notice
+ = flash[:alert]
+ .field
+ = f.label :author
+ %br/
+ = f.text_field :author
+ .field
+ = f.label :email
+ %br/
+ = f.text_field :email
+ .field
+ = f.label :url
+ %br/
+ = f.text_field :url
+ .field
+ = f.label :content
+ %br/
+ = f.text_area :content, :rows => 6
+ .actions
+ = f.submit
@@ -0,0 +1 @@
+= render 'new'
@@ -0,0 +1,9 @@
+%h2 Resend confirmation instructions
+= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f|
+ = devise_error_messages!
+ %p
+ = f.label :email
+ %br/
+ = f.email_field :email
+ %p= f.submit "Resend confirmation instructions"
+= render :partial => "devise/shared/links"
@@ -0,0 +1,4 @@
+%p
+ Welcome #{@resource.email}!
+%p You can confirm your account through the link below:
+%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)
@@ -0,0 +1,6 @@
+%p
+ Hello #{@resource.email}!
+%p Someone has requested a link to change your password, and you can do this through the link below.
+%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
+%p If you didn't request this, please ignore this email.
+%p Your password won't change until you access the link above and create a new one.
@@ -0,0 +1,5 @@
+%p
+ Hello #{@resource.email}!
+%p Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
+%p Click the link below to unlock your account:
+%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token)
@@ -0,0 +1,14 @@
+%h2 Change your password
+= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f|
+ = devise_error_messages!
+ = f.hidden_field :reset_password_token
+ %p
+ = f.label :password, "New password"
+ %br/
+ = f.password_field :password
+ %p
+ = f.label :password_confirmation, "Confirm new password"
+ %br/
+ = f.password_field :password_confirmation
+ %p= f.submit "Change my password"
+= render :partial => "devise/shared/links"
@@ -0,0 +1,9 @@
+%h2 Forgot your password?
+= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f|
+ = devise_error_messages!
+ %p
+ = f.label :email
+ %br/
+ = f.email_field :email
+ %p= f.submit "Send me reset password instructions"
+= render :partial => "devise/shared/links"
@@ -0,0 +1,27 @@
+%h2
+ Edit #{resource_name.to_s.humanize}
+= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
+ = devise_error_messages!
+ %p
+ = f.label :email
+ %br/
+ = f.email_field :email
+ %p
+ = f.label :password
+ %i (leave blank if you don't want to change it)
+ %br/
+ = f.password_field :password
+ %p
+ = f.label :password_confirmation
+ %br/
+ = f.password_field :password_confirmation
+ %p
+ = f.label :current_password
+ %i (we need your current password to confirm your changes)
+ %br/
+ = f.password_field :current_password
+ %p= f.submit "Update"
+%h3 Cancel my account
+%p
+ Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete}.
+= link_to "Back", :back
@@ -0,0 +1,29 @@
+%h2 Sign up
+= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
+ = devise_error_messages!
+ %p
+ = f.label :first_name
+ %br/
+ = f.text_field :first_name
+ %p
+ = f.label :last_name
+ %br/
+ = f.text_field :last_name
+ %p
+ = f.label :nick_name
+ %br/
+ = f.text_field :nick_name
+ %p
+ = f.label :email
+ %br/
+ = f.email_field :email
+ %p
+ = f.label :password
+ %br/
+ = f.password_field :password
+ %p
+ = f.label :password_confirmation
+ %br/
+ = f.password_field :password_confirmation
+ %p= f.submit "Sign up"
+= render :partial => "devise/shared/links"
@@ -0,0 +1,16 @@
+%h2 Sign in
+= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
+ %p
+ = f.label :email
+ %br/
+ = f.email_field :email
+ %p
+ = f.label :password
+ %br/
+ = f.password_field :password
+ - if devise_mapping.rememberable?
+ %p
+ = f.check_box :remember_me
+ = f.label :remember_me
+ %p= f.submit "Sign in"
+= render :partial => "devise/shared/links"
@@ -0,0 +1,19 @@
+- if controller_name != 'sessions'
+ = link_to "Sign in", new_session_path(resource_name)
+ %br/
+- if devise_mapping.registerable? && controller_name != 'registrations'
+ = link_to "Sign up", new_registration_path(resource_name)
+ %br/
+- if devise_mapping.recoverable? && controller_name != 'passwords'
+ = link_to "Forgot your password?", new_password_path(resource_name)
+ %br/
+- if devise_mapping.confirmable? && controller_name != 'confirmations'
+ = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
+ %br/
+- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
+ = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
+ %br/
+- if devise_mapping.omniauthable?
+ - resource_class.omniauth_providers.each do |provider|
+ = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)
+ %br/
Oops, something went wrong.

0 comments on commit e165eb3

Please sign in to comment.