Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Style it up baby!
  • Loading branch information
fredwu committed Jan 18, 2011
1 parent 8f7bce4 commit ecc0630
Show file tree
Hide file tree
Showing 41 changed files with 811 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ db/rubycommitters_development.db
db/rubycommitters_test.db
log/*.log
tmp/
.sass-cache/
4 changes: 3 additions & 1 deletion Gemfile
Expand Up @@ -7,11 +7,13 @@ gem 'thin', :group => :development

# Component requirements
gem 'slim', '>= 0.8.3'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'sqlite3'
gem 'activerecord', '~> 3.0.3', :require => 'active_record'
gem 'rack-cache', '~> 1.0', :require => 'rack/cache'
gem 'mini_magick'
gem 'carrierwave'
gem 'sass'
gem 'rdiscount'

# Test requirements
gem 'rack-test', :require => 'rack/test', :group => :test
Expand Down
10 changes: 7 additions & 3 deletions Gemfile.lock
Expand Up @@ -64,21 +64,23 @@ GEM
rack-test (0.5.7)
rack (>= 1.0)
rake (0.8.7)
rdiscount (1.6.5)
sass (3.1.0.alpha.217)
sinatra (1.1.0)
rack (~> 1.1)
tilt (~> 1.1)
slim (0.8.3)
temple (~> 0.1.6)
tilt (~> 1.1)
sqlite3-ruby (1.3.2)
sqlite3 (1.3.3)
subexec (0.0.4)
temple (0.1.6)
thin (1.2.7)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.2.1)
tilt (1.2.2)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.24)
Expand All @@ -97,7 +99,9 @@ DEPENDENCIES
rack-flash
rack-test
rake
rdiscount
sass
sinatra (= 1.1.0)
slim (>= 0.8.3)
sqlite3-ruby
sqlite3
thin
13 changes: 12 additions & 1 deletion app/app.rb
@@ -1,4 +1,5 @@
class RubyCommitters < Padrino::Application
register SassInitializer
register Padrino::Mailer
register Padrino::Helpers

Expand All @@ -7,7 +8,6 @@ class RubyCommitters < Padrino::Application
##
# Application configuration options
#
set :site_name, 'Ruby Committers'
# set :raise_errors, true # Show exceptions (default for development)
# set :public, "foo/bar" # Location for static assets (default root/public)
# set :reload, false # Reload application files (default in development)
Expand Down Expand Up @@ -36,4 +36,15 @@ class RubyCommitters < Padrino::Application
# render 'errors/404'
# end
#

##
# site settings
#
set :site_name, 'Ruby Committers'
set :bios, {
'matz' => {
:eng => %q{**Matz's English bio is coming soon!** Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.},
:jap => %q{Matz's Japanese bio is coming soon!},
}
}
end
9 changes: 7 additions & 2 deletions app/controllers/heroes.rb
@@ -1,8 +1,13 @@
RubyCommitters.controllers :heroes do
get :index, :map => '/' do
@heroes = Hero.all
@attrs = %w{names nicks sites services books portraits}

@attrs = {
'names' => 'names',
'nicks' => 'a.k.a.',
'sites' => 'sites',
'services' => 'social',
}

cache_control :public, :max_age => 300
render 'heroes/index'
end
Expand Down
6 changes: 5 additions & 1 deletion app/helpers/heroes_helper.rb
@@ -1,6 +1,6 @@
RubyCommitters.helpers do
def link_to_service(name, service)
_link_to = Proc.new { |url| link_to service.name, url + service.key }
_link_to = Proc.new { |url| link_to service.name, url + service.key, :alt => service.name, :title => service.name }

case service.name
when 'twitter' then _link_to.call('http://twitter.com/')
Expand All @@ -15,4 +15,8 @@ def link_to_service(name, service)
def link_to_book(isbn)
link_to isbn, 'http://books.google.com/books?as_isbn=' + isbn
end

def markdownsize(text)
RDiscount.new(text, :autolink).to_html
end
end
7 changes: 7 additions & 0 deletions app/models/hero.rb
Expand Up @@ -56,4 +56,11 @@ def self.import(io)
end
end
end

def bio(lang = :eng)
RubyCommitters.bios[username] && RubyCommitters.bios[username][lang] || case lang
when :eng then "#{username.capitalize}'s English bio is coming soon. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident."
when :jap then "#{username.capitalize}'s Japanese bio is coming soon."
end
end
end
244 changes: 244 additions & 0 deletions app/stylesheets/base.sass
@@ -0,0 +1,244 @@
@import "reset"

// --------------------
variables
// --------------------
$primary-colour = #b01000
$secondary-colour = #392a2a
$highlight-colour = #b01000
$shadow-colour = #ece0d0
$bg-header-colour = #ffeed4
$bg-main-colour = #fffdf8

// --------------------
elements
// --------------------
body, p
font-family: "Lucida Grande", Lucida, "Helvetica Neue", Helvetica, "Myriad Pro", Verdana, Tahoma
font-size: 14px
color: $secondary-colour

h2
font-weight: normal
font-size: 18px

a
color: $secondary-colour
text-decoration: none
&:hover
color: $highlight-colour
text-decoration: underline

// --------------------
supporting structures
// --------------------
#inner-wrapper
position: relative
margin: 0 auto
width: 1000px

#crowd-header-strip
width: 100%
height: 5px
background: $primary-colour

#crowd-footer-strip
width: 100%
height: 15px
background: $secondary-colour

// --------------------
main structures
// --------------------
body
background: $bg-main-colour

#header-wrapper
background: $bg-header-colour
#header
padding-top: 100px
h1#logo
position: absolute
top: 60px
text-indent: -9999px
width: 319px
height: 37px
background: url("/images/logo-header.png") no-repeat
p#ruby-link
position: absolute
top: 15px
right: 0
a
padding-left: 22px
background: url("/images/icon-browser.png") no-repeat
#crowd-header
margin: 0 auto
width: 1075px
height: 144px
background: url("/images/crowd-header.png") center no-repeat

#hero
h2
color: #fff
line-height: 22px
padding: 30px 10px
background: $secondary-colour

#container
padding: 80px 0
background: url("/images/bg-header-gradient.jpg") top repeat-x
table#list
margin: 0 auto
width: 960px
tr.person
position: relative
display: block
background: url("/images/person-container.png") no-repeat
td.list
padding: 20px 20px 50px 20px
td.portraits
width: 90px
.person-letter
position: absolute
top: 2px
left: -25px
color: $shadow-colour
font-family: "Helvetica Neue", Helvetica
font-size: 24px
.portraits-holder
position: absolute
top: -14px
left: 15px
width: 108px
height: 99px
text-align: center
background: url("/images/portrait-holder.png") no-repeat
.portraits-inner-holder
margin-top: 10px
padding-left: 14px
ul.portrait
width: 80px
height: 80px
li
img
width: 80px
td.meta
width: 230px
table
th
padding-right: 10px
color: $secondary-colour
font-size: 9px
font-weight: normal
text-transform: uppercase
text-align: right
h2
font-size: 24px
td.person-headline
padding-bottom: 6px
td
ul
width: 180px
white-space: nowrap
overflow: hidden
line-height: 14px
li
font-size: 13px
padding-top: 5px
ul.social
margin-bottom: -3px
li
float: left
margin-right: 5px
a
display: block
width: 16px
height: 16px
text-indent: -9999px
li.facebook a
background: url("/images/social-icons/facebook.png") no-repeat
li.friendfeed a
background: url("/images/social-icons/friendfeed.png") no-repeat
li.github a
background: url("/images/social-icons/github.png") no-repeat
li.iddy a
background: url("/images/social-icons/iddy.png") no-repeat
li.mixi a
background: url("/images/social-icons/mixi.png") no-repeat
li.twitter a
background: url("/images/social-icons/twitter.png") no-repeat
td.bios
width: 520px
font-size: 15px
ul.bio-langs
li
position: absolute
right: -5px
a
display: block
width: 26px
height: 12px
padding: 3px 0 0 4px
color: #fff
font-family: "Helvetica Neue", Helvetica
font-size: 9px
text-decoration: none
li.eng
top: 5px
a
background: url("/images/button-brown.png") no-repeat
li.jap
top: 22px
a
background: url("/images/button-red.png") no-repeat
ul.bio-text
li
line-height: 16px
margin-right: 20px
&.jap
display: none

#footer
text-align: center
background: url("/images/bg-footer-gradient.jpg") top repeat-x
#footer-logo
margin: 0 auto 15px auto
width: 20px
height: 20px
background: url("/images/logo-footer.png") no-repeat
p
font-size: 12px
padding-bottom: 5px
&#copyright
font-size: 14px
#crowd-footer
width: 1000px
height: 114px
margin-top: 20px
background: url("/images/crowd-footer.png") center no-repeat

// --------------------
portrait slider
// --------------------
.nivo-controlNav
position: absolute
top: 90px
left: 20px
a
display: block
float: left
width: 20px
height: 20px
text-indent: -9999px
margin-right: -5px
background: url("/images/bullet.png") no-repeat
cursor: pointer
&.active
background-position: 0 -20px


0 comments on commit ecc0630

Please sign in to comment.