Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Untitled #11

Closed
wants to merge 6 commits into from

3 participants

@derailed

TenderLoved! - Here is my contraption http://zomgrc.heroku.com - No love buck required, just happy to
contribute to this awesome crew and project.

@kitesurfer

@drbrain

+1

@tenderlove tenderlove closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 6, 2011
  1. @derailed

    tender loved

    derailed authored
  2. @derailed

    more tender loving

    derailed authored
  3. @derailed

    zomg

    derailed authored
  4. @derailed

    tuning up

    derailed authored
Commits on Jan 7, 2011
  1. @derailed

    tweak image sizing

    derailed authored
Commits on Jan 9, 2011
  1. @derailed

    fix image scaling issue

    derailed authored
This page is out of date. Refresh to see the latest.
View
2  app/controllers/accounts_controller.rb
@@ -1,5 +1,5 @@
class AccountsController < ApplicationController
def index
- @accounts = Account.find :all
+ @accounts = Account.find :all, :include => [:portraits, :books, :nicks, :sites, :services]
end
end
View
52 app/helpers/accounts_helper.rb
@@ -1,22 +1,40 @@
module AccountsHelper
- def link_to_service name, service
+
+ # computes user avatar
+ def avatar( account )
+ return image_tag( 'missing_person.png' ) if account.portraits.empty?
+
+ buff = []
+ css_class = account.portraits.count > 1 ? :multi : ''
+ account.portraits.each do |p|
+ buff << image_tag( p.url, :class => css_class )
+ end
+ raw( buff.join( "\n" ) )
+ end
+
+ # Clean up user name
+ def display_name( name )
+ name.downcase
+ end
+
+ def url_to_service( service )
case service.name
- when 'twitter'
- link_to name, 'http://twitter.com/' + service.key
- when 'friendfeed'
- link_to name, 'http://friendfeed.com/' + service.key
- when 'mixi'
- link_to name, 'http://mixi.jp/show_friend.pl?id=' + service.key
- when 'github'
- link_to name, 'http://github.com/' + service.key
- when 'facebook'
- if service.key =~ /^\s*\d+$/
- link_to name, 'http://www.facebook.com/profile.php?id=' + service.key
- else
- link_to name, 'http://www.facebook.com/' + service.key
- end
- when 'iddy'
- link_to name, 'http://iddy.jp/profile/' + service.key
+ when 'twitter'
+ 'http://twitter.com/' + service.key
+ when 'friendfeed'
+ 'http://friendfeed.com/' + service.key
+ when 'mixi'
+ 'http://mixi.jp/show_friend.pl?id=' + service.key
+ when 'github'
+ 'http://github.com/' + service.key
+ when 'facebook'
+ if service.key =~ /^\s*\d+$/
+ 'http://www.facebook.com/profile.php?id=' + service.key
+ else
+ 'http://www.facebook.com/' + service.key
+ end
+ when 'iddy'
+ 'http://iddy.jp/profile/' + service.key
end
end
end
View
97 app/views/accounts/_account.html.erb
@@ -1,79 +1,18 @@
-<li>
- <table>
- <tr>
- <td>Account:</td>
- <td><%= account.username %></td>
- </tr>
-
- <% unless account.names.empty? %>
- <tr>
- <td>Names:</td>
- <td>
- <ul>
- <%= render :partial => 'name', :collection => account.names %>
- </ul>
- </td>
- </tr>
- <% end %>
-
- <% unless account.nicks.empty? %>
- <tr>
- <td>Nicknames:</td>
- <td>
- <ul>
- <%= render :partial => 'name', :collection => account.nicks %>
- </ul>
- </td>
- </tr>
- <% end %>
-
- <% unless account.sites.empty? %>
- <tr>
- <td>Sites:</td>
- <td>
- <ul>
- <%= render :partial => 'site', :collection => account.sites %>
- </ul>
- </td>
- </tr>
- <% end %>
-
- <% unless account.services.empty? %>
- <tr>
- <td>Services:</td>
- <td>
- <ul>
- <%= render :partial => 'service', :collection => account.services %>
- </ul>
- </td>
- </tr>
- <% end %>
-
- <% unless account.portraits.empty? %>
- <tr>
- <td>Portraits:</td>
- <td>
- <ul>
- <%= render :partial => 'portrait', :collection => account.portraits %>
- </ul>
- </td>
- </tr>
- <% end %>
-
- <!-- FIXME: unsure how to link to ISBN. :-( -->
- <!--
- <% unless account.books.empty? %>
- <tr>
- <td>Books:</td>
- <td>
- <ul>
- <% account.books.each do |book| %>
- <li><%= book.key %></li>
- <% end %>
- </ul>
- </td>
- </tr>
- <% end %>
- -->
- </table>
-</li>
+<div class="member">
+ <div class="sidebar">
+ <span class="handle"><%= display_name( account.username ) %></span>
+ </div>
+ <div class="title">
+ <%= render :partial => 'names', :locals => { :account => account } -%>
+ <%= render :partial => 'socials', :object => account.services -%>
+ </div>
+ <div class="content">
+ <div class="avatars">
+ <%= avatar( account ) -%>
+ </div>
+ <div class="description">
+ <%= render :partial => 'nicks', :object => account.nicks -%>
+ <%= render :partial => 'sites', :object => account.sites -%>
+ </div>
+ </div>
+</div>
View
1  app/views/accounts/_name.html.erb
@@ -1 +0,0 @@
-<li><%= name.value %></li>
View
9 app/views/accounts/_names.html.erb
@@ -0,0 +1,9 @@
+<p class="names">
+ <% unless account.names.empty? -%>
+ <% account.names.each do |n| -%>
+ <%= content_tag :span, n.value.gsub( /\s/, ' '), :class => 'name' -%>
+ <% end -%>
+ <% else -%>
+ <%= content_tag :span, account.username, :class => 'name' -%>
+ <% end -%>
+</p>
View
10 app/views/accounts/_nicks.html.erb
@@ -0,0 +1,10 @@
+<% unless nicks.empty? -%>
+ <fieldset>
+ <legend><%= pluralize( nicks.count, 'alias' )%></legend>
+ <ul>
+ <% nicks.each do |n| -%>
+ <li><%=n.value%></li>
+ <% end -%>
+ </ul>
+ </fieldset>
+<% end -%>
View
3  app/views/accounts/_portrait.html.erb
@@ -1,3 +0,0 @@
-<div class='image-wrapper'>
- <%= image_tag portrait.url %>
-</div>
View
3  app/views/accounts/_service.html.erb
@@ -1,3 +0,0 @@
-<li>
- <%= link_to_service service.name, service %>
-</li>
View
1  app/views/accounts/_site.html.erb
@@ -1 +0,0 @@
-<li><%= link_to site.title, site.url %></li>
View
15 app/views/accounts/_sites.html.erb
@@ -0,0 +1,15 @@
+<% unless sites.empty? -%>
+ <fieldset>
+ <legend><%= pluralize( sites.count, 'site' )%></legend>
+ <ul>
+ <% sites.each do |n| -%>
+ <li>
+ <%= link_to n.title, n.url, :title => "web site", :target => '#' -%>
+ <% unless n.feed.blank? -%>
+ <%= link_to image_tag( 'rss.png', :border => 0 ), n.feed, :title => "rss feed", :target => '#' -%>
+ <% end -%>
+ </li>
+ <% end -%>
+ </ul>
+ </fieldset>
+<% end -%>
View
7 app/views/accounts/_socials.html.erb
@@ -0,0 +1,7 @@
+<ul class="socials">
+ <% socials.sort{ |a,b| b.name <=> a.name }.each do |s| -%>
+ <li>
+ <%=link_to content_tag(:div, nil, :class => "source #{s.name}"), url_to_service( s ), :title => s.key, :target => '#' -%>
+ </li>
+ <% end -%>
+</ul>
View
31 app/views/accounts/index.html.erb
@@ -1,5 +1,26 @@
-<h1>Ruby Committers</h1>
-<%= link_to 'fork me on github', 'http://github.com/tenderlove/rubycommitters.org' %>
-<ul>
-<%= render :partial => 'account', :collection => @accounts %>
-</ul>
+<div id="layout">
+ <div id="committers">
+ <div id="title"></div>
+ <div id="members">
+ <%= render :partial => 'account', :collection => @accounts -%>
+ </div>
+ </div>
+</div>
+
+<div id="forkit">
+ <%=link_to image_tag( 'fork_it.png', :border => 0 ), 'http://github.com/tenderlove/rubycommitters.org', :title => "Fork it?", :target => '#' -%>
+</div>
+
+<script>
+ $('.avatars').cycle( { fx: 'zoom' } );
+ $('.names').cycle( { fx: 'fade' } );
+
+ $('.member').hover( function() {
+ $( this ).find( '.sidebar span' ).addClass( "selected" );
+ $( this ).addClass( "selected" );
+ },
+ function() {
+ $(this).find( '.sidebar > span' ).removeClass( "selected" );
+ $( this ).removeClass( "selected" );
+ });
+</script>
View
9 app/views/layouts/application.html.erb
@@ -3,13 +3,14 @@
<head>
<title>Ruby Committers</title>
<%= stylesheet_link_tag :all %>
- <%= javascript_include_tag :defaults %>
+ <link rel="icon" href="./images/blossom.png" type="image/x-png"/>
+ <link rel="shortcut icon" href="./images/blossom.png" type="image/x-png"/>
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
+ <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
<%= csrf_meta_tag %>
<%= analytics_tag %>
</head>
<body>
-
-<%= yield %>
-
+ <%= yield -%>
</body>
</html>
View
BIN  public/images/bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/blossom.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/fork_it.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/missing_person.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/rss.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/sources.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/title.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
188 public/stylesheets/site.css
@@ -1,3 +1,28 @@
+body {
+ background: #fff url(../images/bg.png) no-repeat top left;
+ margin: 0;
+ padding: 0;
+ line-height: normal;
+ font-size: .9em;
+}
+
+div#forkit {
+ position: absolute;
+ top: 10px;
+ right: 5px;
+}
+div#forkit img {
+ width: 200px;
+ height: 330px;
+}
+
+div#committers {
+ width: 900px;
+ margin: 0px auto;
+ padding: 250px 0 50px 0;
+ overflow: hidden;
+}
+
.image-wrapper {
height: 100px;
}
@@ -5,3 +30,166 @@
.image-wrapper img {
height: 100%;
}
+
+div#title {
+ float: right;
+ width: 450px;
+ height: 100px;
+ background: transparent url(../images/title.png) no-repeat top center;
+}
+
+ul {
+ list-style: none;
+ text-indent: 0em;
+ margin: 0;
+ padding: 0;
+}
+
+fieldset {
+ border: none;
+}
+fieldset legend {
+ font-size: 1em;
+ font-weight: bold;
+ color: #c3c3c3;
+ margin-left: -3px;
+}
+
+a {
+ text-decoration: none;
+ color: #a43280;
+}
+
+a img {
+ vertical-align: middle;
+ width: 10px;
+ height: 10px;
+}
+
+div.sidebar {
+ background: #000;
+ height: 230px;
+ width: 35px;
+ float: left;
+ -moz-border-radius: 8px 0px 0 8px;
+ -webkit-border-radius: 8px 0px 0px 8px;
+}
+span.handle {
+ -webkit-transform: rotate(-90deg);
+ -moz-transform: rotate(-90deg);
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
+ font-size: 2em;
+ font-weight: bold;
+ color: #d7007c;
+ position: relative;
+ left: 0px;
+ bottom: -192px;
+ display: block;
+ max-width: 30px;
+}
+span.selected {
+ color: #fff;
+}
+
+div.title {
+ border-bottom: 1px #000 solid;
+ height: 45px;
+ overflow: hidden;
+}
+p.names {
+ margin-left: 10px;
+ font-size: 1.2em;
+ font-weight: bold;
+ float: left;
+}
+span.name {
+ width: 200px;
+}
+
+div#members {
+ clear: both;
+ margin-left: 50px;
+}
+div.member {
+ float: left;
+ border: 1px #000 solid;
+ -moz-border-radius: 10px 0px 10px 10px;
+ -webkit-border-radius: 10px;
+ overflow: hidden;
+ width: 400px;
+ min-height: 230px;
+ margin: 5px;
+}
+div.selected {
+ -moz-box-shadow: 0 10px 20px 1px #000;
+ -webkit-box-shadow: 0 10px 20px 1px #000;
+}
+
+label {
+ border: 1px green solid;
+}
+
+div.content {
+ clear: right;
+ margin: 10px 5px 0 40px;
+ font-size: 0.9em;
+ height: 114px;
+}
+
+div.avatars {
+ margin-right: 10px;
+ float: right;
+}
+
+div.avatars img {
+ border: 2px #ccc solid;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ height: 100px;
+ width: auto;
+ padding: 5px;
+}
+div.avatars img.multi {
+ min-width: 100px;
+ min-height: 100px;
+}
+
+p.aliases {
+ color: gray;
+}
+span.alias {
+ font-style: italic;
+}
+
+ul.socials {
+ margin: 10px 10px 0 0;
+}
+ul.socials li {
+ display: inline;
+}
+
+div.source {
+ float: right;
+ margin: 0 0 0 5px;
+ width: 24px;
+ height: 24px;
+ background: transparent url("../images/sources.png" ) no-repeat top left;
+}
+div.facebook {
+ background-position: 0 0;
+}
+div.twitter {
+ background-position: -24px 0;
+}
+div.github {
+ background-position: -48px 0;
+}
+div.friendfeed {
+ background-position: -72px 0;
+}
+div.iddy {
+ background-position: -96px 0;
+}
+div.mixi {
+ background-position: -120px 0;
+}
Something went wrong with that request. Please try again.