Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
added twitter census data to twitter#index
Browse files Browse the repository at this point in the history
  • Loading branch information
rockymeza committed Apr 22, 2011
1 parent 180bb57 commit cb999ed
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/models/twitter_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class TwitterSummary < ActiveRecord::Base
belongs_to :twitter_stat

# twitter stuff
@@sortable_columns = ['screen_name', 'org_name', 'followers_count', 'following_count', 'statuses_count'].freeze
@@sortable_columns = ['screen_name', 'org_name', 'followers_count', 'following_count', 'statuses_count', 'interesting', 'sway', 'outflux', 'feedness', 'chattiness'].freeze
@@sortable_directions = ['asc', 'desc'].freeze

def self.sortable(column, direction)
Expand Down
6 changes: 6 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
</div>
<a href="/" title="Home" rel="nofollow">Home</a>
</div>
<% if params[:controller] == 'twitter' -%>
<div id="wide_col">
<%= yield %>
</div>
<% else -%>
<div id="col1">
<%= yield :column1%>
</div>
Expand All @@ -45,5 +50,6 @@
<%= yield :column3%>
<%= render :partial => 'layouts/types' if current_user.try(:admin?) %>
</div>
<% end -%>
</body>
</html>
49 changes: 29 additions & 20 deletions app/views/twitter/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
<%= content_for :column2 do %>
<h1 class="title">Wassup</h1>
<table>
<tr>
<th><%= sortable 'screen_name', 'Twitter Handle' %></th>
<th><%= sortable 'org_name', 'Organization Name' %></th>
<th><%= sortable 'followers_count', 'Followers Count' %></th>
<th><%= sortable 'following_count', 'Following Count' %></th>
<th><%= sortable 'statuses_count', 'Number of Posts' %></th>
</tr>
<% @stats.each do |stat| %>
<tr>
<td><%= twitter_link stat.twitter_stat.screen_name %></td>
<td><%= link_to stat.organization.name, stat.organization %></td>
<td><%= stat.followers_count %></td>
<td><%= stat.following_count %></td>
<td><%= stat.statuses_count %></td>
</tr>
<% end %>
</table>
<h1 class="title">Twitter Summary</h1>
<table>
<tr>
<th><%= sortable 'screen_name', 'Twitter Handle' %></th>
<th><%= sortable 'org_name', 'Organization Name' %></th>
<th><%= sortable 'followers_count', 'Followers Count' %></th>
<th><%= sortable 'following_count', 'Following Count' %></th>
<th><%= sortable 'statuses_count', 'Number of Posts' %></th>
<th><%= sortable 'interesting', 'Interestingness' %></th>
<th><%= sortable 'sway', 'Sway' %></th>
<th><%= sortable 'outflux', 'Outflux' %></th>
<th><%= sortable 'feedness', 'Feedness' %></th>
<th><%= sortable 'chattiness', 'Chattiness' %></th>
</tr>
<% @stats.each do |stat| %>
<tr>
<td><%= twitter_link stat.twitter_stat.screen_name %></td>
<td><%= link_to stat.organization.name, stat.organization %></td>
<td><%= stat.followers_count %></td>
<td><%= stat.following_count %></td>
<td><%= stat.statuses_count %></td>
<td><%= stat.interesting %></td>
<td><%= stat.sway %></td>
<td><%= stat.outflux %></td>
<td><%= stat.feedness %></td>
<td><%= stat.chattiness %></td>
</tr>
<% end %>
</table>
<%= will_paginate @stats %>
14 changes: 12 additions & 2 deletions public/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,16 @@ table#full_top_contributors_table {
margin-right:auto;
}

#wide_col
{
float: left;
width: 89.6em;
text-align: left;
padding: 1em;
background-color:#ffffff;
border-bottom:#FFFFFF 3px solid;
}

#col2
{
float: left;
Expand Down Expand Up @@ -725,7 +735,7 @@ table#full_top_contributors_table {
border-bottom: 0px;
}

#col2_internal h1
#col2_internal h1, #wide_col h1
{
border-bottom: 3px solid #ecf3f2;
font-size: 1.8em;
Expand All @@ -746,7 +756,7 @@ table#full_top_contributors_table {
color: #777;
}

#col2_internal .h1_first
#col2_internal .h1_first, #wide_col .h1_first
{
margin-top: 0;
padding-right: 1.3em;
Expand Down

0 comments on commit cb999ed

Please sign in to comment.