Skip to content

Commit

Permalink
Fake company blog!
Browse files Browse the repository at this point in the history
  • Loading branch information
duien committed Oct 17, 2010
1 parent 5ae0c33 commit 9af35da
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gems
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sinatra --version=0.9.4
haml --version=2.2.20
faker --version=0.3.1
active_support
50 changes: 50 additions & 0 deletions views/corp_blog.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
!!!
- require 'active_support'
- require 'faker'
- date = Time.now
- months = [nil] + %w(jan feb mar apr may jun jul aug sep oct nov dec)
%html
%head
%link{ :rel => 'stylesheet', :type => 'text/css', :href => '/corp_blog.css' }
%body
.header= Faker::Company.name
.wrapper
.sidebar
%h3 Popular Posts
%ul
- 5.times do
%li
%a{ :href => '' }= Faker::Company.catch_phrase
%h3 Popular Categories
%ul
- 5.times do
%li
%a{ :href => '' }= Faker::Company.bs_noun.capitalize
.main_column
- 20.times do
.line
.block
- date = date - rand(60)*60*60*24
.year= date.year
.month= months[date.month]
.day #{ActiveSupport::Inflector.ordinalize(date.day)}
.content
%h1= Faker::Company.catch_phrase
.metadata
Posted by #{Faker::Name.name} to
%a{ :href => '' }= Faker::Company.bs_noun.capitalize
- Faker::Lorem.paragraphs(rand(2)+1).each do |p|
%p= p
- (rand(4)+1).times do
%h2= Faker::Company.catch_phrase
- Faker::Lorem.paragraphs(rand(4)+1).each do |p|
%p= p
.metadata.right
- num = rand(10)
- if num > 0
%a{ :href => '' } Read #{num} #{num == 1 ? 'comment' : 'comments'}
\|
%a{ :href => '' } Join the discussion
- else
%a{ :href => '' } Start a discussion

112 changes: 112 additions & 0 deletions views/sass/corp_blog.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
@import round
$white: #e6e3b2
$red: #bd481d
$black: #202a2c

body
// background: $green_white
background: $white
margin: 0
padding: 0
.wrapper
width: 1200px
margin: 0 auto
.header
font-family: 'League Gothic'
font-size: 550%
text-shadow: $white 0 1px 2px
color: $red
text-align: center
padding: 20px
background: $white * 0.9
.main_column
float: right
width: 820px
background: white
.line
padding: 10px
margin: 10px auto
+round(10px)
overflow: hidden
width: 800px
.block
// background: $black
// +round(10px)
float: left
position: relative
// padding: 10px
text-align: center
font-size: 450%
width: 1.5em
.year
font-family: 'Museo'
font-size: 33%
// +round(1em)
+round_top(10px)
background: mix($white, $black)
padding: .25em .5em
// width: 100%
.month
font-family: 'League Gothic'
text-transform: uppercase
color: $red
background: $black
// +round_bottom(10px)
.day
font-family: 'Museo'
font-size: 33%
// +round(1em)
+round_bottom(10px)
// background: mix($white, $black)
background: $black
color: $white
margin-top: -0.5em
padding: 0 .5em .25em
// width: 100%
.content
width: 650px
font-family: 'Museo'
padding: 0 10px 0 30px
float: left
h1
padding: 0
margin: 0
font-family: 'League Gothic'
text-transform: capitalize
font-size: 350%
color: $black
h2
padding: 0
margin: 0
color: $red
.metadata
color: mix($black, white)
font-family: 'Museo Sans'
&.right
text-align: right
a
color: $red
p
font-size: 120%
margin: 10px 0
.sidebar
width: 300px
float: right
margin: 10px
h3
margin: 10px 0
border-bottom: 2px solid mix($black, $white)
padding: 0
font-family: 'Museo'
color: $black
ul
margin: 0
padding: 0
list-style: none
li
font-family: 'Museo Sans'
padding: 5px 0
text-transform: capitalize
a
color: $red

0 comments on commit 9af35da

Please sign in to comment.