Skip to content

Commit

Permalink
Added styling to the list of authors books
Browse files Browse the repository at this point in the history
  • Loading branch information
slabounty committed Dec 16, 2010
1 parent cfa6d28 commit 6c3d393
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions public/css/page.css
Expand Up @@ -17,12 +17,12 @@ dd, dt {
margin:0;
}

dl.book_block, ul.tuning_block, ul.author_block, ul.tune_block {
dl.author_book_block, dl.book_block, ul.tuning_block, ul.author_block, ul.tune_block {
padding: 0
margin-top: 1em;
}

.book_block dd.first, .tuning_block li.first, .author_block li.first, .tune_block li.first {
.author_book_block dt.first, .book_block dd.first, .tuning_block li.first, .author_block li.first, .tune_block li.first {
background-color: #9DA9EE;
padding-left: 2.0em;
padding-top: .50em;
Expand All @@ -33,14 +33,14 @@ dl.book_block, ul.tuning_block, ul.author_block, ul.tune_block {
border-radius: 1em 1em 0em 0em;
}

.book_block dd.even, .book_block dt.even, .tuning_block li.even, .author_block li.even, .tune_block li.even {
.author_book_block dt.even, .book_block dt.even, .tuning_block li.even, .author_block li.even, .tune_block li.even {
background-color: #9DA9EE;
padding-left: 2.0em;
padding-top: .50em;
padding-bottom: .50em;
}

.book_block dd.odd, .book_block dt.odd, .tuning_block li.odd, .author_block li.odd, .tune_block li.odd {
.author_book_block dt.odd, .book_block dd.odd, .book_block dt.odd, .tuning_block li.odd, .author_block li.odd, .tune_block li.odd {
background-color: #DDD;
padding-left: 2.0em;
padding-top: .50em;
Expand Down
12 changes: 7 additions & 5 deletions view/view_author.xhtml
@@ -1,9 +1,11 @@
<h2>Books by #{@author.first_name} #{@author.last_name}</h2>
<dl id='book_block'>
<?r @author.books.each do | book | ?>
<dt>
<a href="#{r(:view_book)}/#{book[:id]}">#{book.title}</a>
</dt>
<dl class='author_book_block'>
<?r @author.books.each_with_index do | book, i | ?>
<?r if i == 0 ?>
<dt class="first"> <a href="#{r(:view_book)}/#{book[:id]}">#{book.title}</a></dt>
<?r else ?>
<dt class=#{((i%2)==0) ? "\"even\"" : "\"odd\""}> <a href="#{r(:view_book)}/#{book[:id]}">#{book.title}</a></dt>
<?r end ?>
<?r end ?>
</dl>

0 comments on commit 6c3d393

Please sign in to comment.