Skip to content

Commit

Permalink
hacking on firsts
Browse files Browse the repository at this point in the history
  • Loading branch information
peat committed Feb 12, 2012
1 parent 35309a4 commit 770c824
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions extension/banner.css
Expand Up @@ -4,6 +4,7 @@
color: #000;
box-shadow: 0px 0px 10px #888;
text-align:center;
border-radius: 10px;
}

#audibleHarvest a { text-decoration: none; font-weight: bold; color: inherit }
Expand Down
5 changes: 5 additions & 0 deletions server/lib/treasure.rb
@@ -1,5 +1,10 @@
class Treasure < ActiveRecord::Base

def first_person?
people = Treasure.where('person=?', person).order('id')
(people.count > 1 and people.first == self)
end

def first_track?
tracks = Treasure.where('artist=? AND track=?', artist, track).order('id')
(tracks.count > 1 and tracks.first == self)
Expand Down
4 changes: 2 additions & 2 deletions server/views/index.erb
Expand Up @@ -47,7 +47,7 @@
height: 40px;
}

td.first { background-color: #faa; }
td.first { background-color: #ada; }
</style>

<script type="text/javascript">
Expand Down Expand Up @@ -132,7 +132,7 @@
end
%></td>
<td <%= 'class="first"' if t.first_artist? %>><%= t.artist %></td>
<td style="text-align: center"><%= t.person %></td>
<td <%= 'class="first"' if t.first_person? %> style="text-align: center"><%= t.person %></td>
<td style="text-align: center"><%= t.origin %></td>
<td style="text-align: center"><%= t.provider %></td>
</tr>
Expand Down

0 comments on commit 770c824

Please sign in to comment.