<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>design/photo-comments.psd</filename>
    </added>
    <added>
      <filename>design/photo-prev-next.psd</filename>
    </added>
    <added>
      <filename>public/images/photo-comments.gif</filename>
    </added>
    <added>
      <filename>public/images/photo-next-prev.gif</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -28,15 +28,24 @@ class Date
 end
 
 class Flickr
-  def self.photos(method, params={})
-    call(method, params)/:photo
+  def self.recent
+    call(&quot;search&quot;, &quot;per_page&quot; =&gt; 9)/:photo
   end
-  def self.photo(*args)
-    photos(*args).first
+  def self.featured
+    call(&quot;search&quot;, &quot;tags&quot; =&gt; &quot;feature&quot;, &quot;per_page&quot; =&gt; 500)/:photo
+  end
+  def self.photo(id)
+    call(&quot;getInfo&quot;, &quot;photo_id&quot; =&gt; id).search(:photo).first
   end
   def self.sizes(photo)
     call(&quot;getSizes&quot;, &quot;photo_id&quot; =&gt; photo[:id])/:size
   end
+  def self.next_previous(photo)
+    featured = featured()
+    [photo, featured].flatten.each {|p| def p.==(other); self[:id] == other[:id]; end }
+    index = featured.index(photo)
+    [index != 0 &amp;&amp; featured[index-1], featured[index+1]]
+  end
   def self.call(method, params)
     res = Net::HTTP.get(URI.parse(&quot;http://api.flickr.com/services/rest/?method=flickr.photos.#{method}&amp;api_key=0e5de53043827665f99e9508ce5c40cf&amp;user_id=57794886@N00#{params.collect{|k,v|&quot;&amp;#{k}=#{v}&quot;}}&quot;))
     return Hpricot(res) if !res.include?('stat=&quot;fail&quot;')
@@ -87,6 +96,12 @@ helpers do
   def flickr_url(photo)
     &quot;http://www.flickr.com/photos/toolmantim/#{photo[:id]}/&quot;
   end
+  def flickr_square(photo)
+    %(&lt;img src=&quot;#{flickr_src(photo, &quot;s&quot;)}&quot; width=&quot;75&quot; height=&quot;75&quot; /&gt;)
+  end
+  def photo_path(photo)
+    &quot;/photos/#{photo[:id]}&quot;
+  end
 end
 
 before do
@@ -139,14 +154,15 @@ get '/projects' do
 end
 
 get '/photos' do
-  @recent_photos = Flickr.photos(&quot;search&quot;, &quot;per_page&quot; =&gt; 9)
-  @feature_photos = Flickr.photos(&quot;search&quot;, &quot;tags&quot; =&gt; &quot;feature&quot;, &quot;per_page&quot; =&gt; 500)
+  @recent_photos = Flickr.recent
+  @feature_photos = Flickr.featured
   haml :photos
 end
 
 get '/photos/:id' do
-  @photo = Flickr.photo(&quot;getInfo&quot;, &quot;photo_id&quot; =&gt; params[:id]) || raise(Sinatra::NotFound)
+  @photo = Flickr.photo(params[:id]) || raise(Sinatra::NotFound)
   @sizes = Flickr.sizes(@photo)
+  @prev_photo, @next_photo = Flickr.next_previous(@photo)
   haml :photo
 end
 
@@ -155,15 +171,15 @@ get '/sitemap.xml' do
   haml :sitemap, :layout =&gt; false
 end
 
-get '/sample-tumble' do
-  haml :sample_tumble
-end if Sinatra::Application.environment == :development
-
 not_found do
   content_type 'text/html'
   haml :not_found
 end
 
+get '/sample-tumble' do
+  haml :sample_tumble
+end if Sinatra::Application.environment == :development
+
 error do
   @error = request.env['sinatra.error'].to_s
   content_type 'text/html'</diff>
      <filename>toolmantim.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,32 +6,50 @@
 - @head_content = %(&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;#body-inner { width: #{large_size[:width].to_i + image_padding * 2}px }&lt;/style&gt;)
 
 .photo
-  %a{:href =&gt; flickr_url(@photo)}
+  %a.main{:href =&gt; flickr_url(@photo)}
     %img{:src =&gt; flickr_src(@photo, &quot;b&quot;), :width =&gt; large_size[:width], :height =&gt; large_size[:height], :alt =&gt; @photo[:title]}/
 
-  - if (title = (@photo/:title).text.strip).length != 0
-    - @page_title = &quot;'#{title}' by Tim Lucas&quot;
-    %h1
-      %a{:href =&gt; flickr_url(@photo)}= title
-  - else
-    - @page_title = &quot;Untitled by Tim Lucas&quot;
+  %h1
+    %a{:href =&gt; flickr_url(@photo)}
+      - if (title = (@photo/:title).text.strip).length != 0
+        - @page_title = &quot;'#{title}' by Tim Lucas&quot;
+        = title
+      - else
+        - @page_title = &quot;Untitled by Tim Lucas&quot;
+        Untitled
+
+  .description
 
-  - if (@photo/:description).text.strip.length != 0
-    .description
+    - if (@photo/:description).text.strip.length != 0
       = (@photo/:description).text.split(&quot;\n\n&quot;).map {|s| &quot;&lt;p&gt;#{s}&lt;/p&gt;&quot;}
 
-  %p.extra
-    %a.comments{:href =&gt; flickr_url(@photo) + &quot;#DiscussPhoto&quot;, :title =&gt; &quot;Read and leave comments on Flickr&quot; }
+  %p.comments
+    %a{:href =&gt; flickr_url(@photo) + &quot;#DiscussPhoto&quot;, :title =&gt; &quot;Read and leave comments on Flickr&quot; }
       - comments = (@photo/:comments).text.to_i
       - case comments
       - when 0
         No comments
       - when 1
-        1 comments
+        1 comment
       - else
         == #{comments} comments
-    \|
-    %a.more{:href =&gt; &quot;/photos#featured&quot;} More photos &amp;rarr;
 
   %p.license
-    License: Nothin.
+    %a{:rel =&gt; &quot;license&quot;, :href =&gt; &quot;http://creativecommons.org/licenses/by-sa/2.0/&quot;}
+      %img{:src =&gt; &quot;http://i.creativecommons.org/l/by-sa/2.0/80x15.png&quot;, :alt =&gt; &quot;Creative Commons License&quot;}/
+
+
+  .more-photos
+    %ul
+      - if @prev_photo
+        %li.prev
+          %a{:href =&gt; photo_path(@prev_photo), :title =&gt; @prev_photo[:title]}= flickr_square(@prev_photo)
+      %li.current
+        %span= flickr_square(@photo)
+      - if @next_photo
+        %li.next
+          %a{:href =&gt; photo_path(@next_photo), :title =&gt; @next_photo[:title]}= flickr_square(@next_photo)
+
+
+  %p.more
+    %a{:href =&gt; &quot;/photos#featured&quot;} and more&amp;hellip;
\ No newline at end of file</diff>
      <filename>views/photo.haml</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,6 @@
 - @body_class = &quot;photos&quot;
 - @page_title = &quot;Photos by Tim Lucas&quot;
 
-- def flickr_square(photo); %(&lt;img src=&quot;#{flickr_src(photo, &quot;s&quot;)}&quot; width=&quot;75&quot; height=&quot;75&quot; /&gt;); end
-- def photo_path(photo); &quot;/photos/#{photo[:id]}&quot;; end
 
 %h1.major Photos
 </diff>
      <filename>views/photos.haml</filename>
    </modified>
    <modified>
      <diff>@@ -604,48 +604,101 @@ body.photo
   :background #000
 
   #body-inner
-    :padding-top 20px
+    :padding-top 40px
     
-  .photo img
+  .main img
     :border 20px solid #fff
     :margin-bottom 20px
 
   h1
     :font-size 2.4em
 
-  h1 a, h1 a:active, .description p
-    :color #999
-
-  h1 a:hover
-    :color = #fff
-      
-    
+  h1 a, h1 a:active
+    :color #fff
+  
   .description p
+    :color #fff
+      
+  .description
     +standard_text_size
-    :width 40em
-    
-  .more-photos
-    :margin-top 20px
-    :font-size 1.4em
+    :max-width 40em
+    :margin-top 0.5em
 
-  p.extra
+    p
+      :margin-top 0.5em
+      
+  p.comments
     +standard_text_size
     :margin 10px 0
     :color #333
-    a
-      &amp;, &amp;:active
-        :color #666
 
+    a
+      :background transparent url(/images/photo-comments.gif) no-repeat top left
+      :padding-left 17px
+      :color #fff
+      :opacity 0.6
+      
       &amp;:hover
-        :color #bbb
-        
-  p.license
-    :float left
-    +standard_text_size
-    :color #444
+        :opacity 1
+  
+  p.license a
+    :opacity 0.6
     
     &amp;:hover
-      :color #999
+      :opacity 1
+      
+  .more-photos
+    :margin-top 50px
+    :margin-bottom 20px
+    :float left
+    :width 100%
+    :overflow hidden
+    :position relative
+
+    ul
+      :clear left
+      :float left
+      :position relative
+      :left 50%
+
+      li
+        :display block
+        :float left
+        :position relative
+        :right 50%
+
+        &amp;.current
+          :opacity 0.5
+
+        a
+          :display block
+          :opacity 0.5
+
+          &amp;:hover
+            :opacity 1
+
+        &amp;.current
+          :margin 0 10px
+
+        &amp;.prev
+          a
+            :background transparent url(/images/photo-next-prev.gif) no-repeat top left
+            :padding-left 12px
+
+        &amp;.next
+          a
+            :padding-right 12px
+            :background transparent url(/images/photo-next-prev.gif) no-repeat top right
+            
+  p.more
+    :text-align center
+    a
+      +standard_text_size
+      :opacity 0.4
+      :color #fff
+      
+      &amp;:hover
+        :opacity 0.7
 
 body.photos
   h2</diff>
      <filename>views/stylesheets/screen.sass</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2619d8dc83c76b2b003481b1beec72bdfe11c34b</id>
    </parent>
  </parents>
  <author>
    <name>Tim Lucas</name>
    <email>t.lucas@toolmantim.com</email>
  </author>
  <url>http://github.com/toolmantim/toolmantim/commit/e9e152129474c7ed40d257e63c15ae4ce2a4bd4a</url>
  <id>e9e152129474c7ed40d257e63c15ae4ce2a4bd4a</id>
  <committed-date>2009-04-12T05:02:00-07:00</committed-date>
  <authored-date>2009-04-12T05:02:00-07:00</authored-date>
  <message>Added photo to photo nav, other cleanups</message>
  <tree>ada5bd41a6b691c44ac6c74680af5087270bf601</tree>
  <committer>
    <name>Tim Lucas</name>
    <email>t.lucas@toolmantim.com</email>
  </committer>
</commit>
