<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/views/digg/index.atom.builder</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,33 +1,27 @@
 class DiggController &lt; ApplicationController
-  
-  def popular
-    respond_to do |format|
-      format.atom { @stories = Digg.new.stories('stories/popular', :count =&gt; 100) }
-    end
-  end
-  
-  def topics 
+
+  def index
     respond_to do |format|
       format.html { @topics = Digg.new.topics }
+      format.atom { @stories = Digg.new.stories(&quot;stories/#{upcoming_or_popular}&quot;, :count =&gt; 100) }
     end
   end
   
   def topic
     respond_to do |format|
-      format.atom { @stories = Digg.new.stories(&quot;stories/topic/#{params[:topic]}/popular&quot;, :count =&gt; 100) }
+      format.atom { @stories = Digg.new.stories(&quot;stories/topic/#{params[:topic]}/#{upcoming_or_popular}&quot;, :count =&gt; 100) }
     end
   end
+    
+  private
   
-  def upcoming
-    respond_to do |format|
-      format.atom { @stories = Digg.new.stories('stories/upcoming', :count =&gt; 100) }
-    end
+  helper_method :upcoming?
+  def upcoming?
+    params[:upcoming]
   end
   
-  def upcoming_topic 
-    respond_to do |format|
-      format.atom { @stories = Digg.new.stories(&quot;stories/topic/#{params[:topic]}/upcoming&quot;, :count =&gt; 100) }
-    end
+  def upcoming_or_popular
+    upcoming? ? 'upcoming' : 'popular'
   end
   
 end
\ No newline at end of file</diff>
      <filename>app/controllers/digg_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,22 @@
-&lt;%= link_to &quot;popular&quot;, digg_popular_path %&gt;
+&lt;div class='switch'&gt;
+    &lt;%= link_to &quot;Upcoming&quot;, digg_upcoming_path, :class =&gt; &quot;upcoming #{'active' if upcoming?}&quot; %&gt; 
+    &lt;%= link_to &quot;Popular&quot;, digg_path, :class =&gt; &quot;popular #{'active' unless upcoming?}&quot; %&gt; 
+&lt;/div&gt;
 
-&lt;%= link_to &quot;upcoming&quot;, digg_upcoming_path %&gt;
-
-&lt;h2&gt;Popular by topic&lt;/h2&gt;
+&lt;p&gt;&lt;%= link_to &quot;All #{upcoming? ? 'Upcoming' : 'Popular'} Feed&quot;, (upcoming? ? digg_upcoming_feed_path : digg_popular_path ) %&gt;
+&lt;/p&gt;
+&lt;h2&gt;&lt;%= upcoming? ? 'Upcoming' : 'Popular' %&gt; stories by topic&lt;/h2&gt;
 
 &lt;ul id='topics-list'&gt;
 &lt;% for topic in @topics %&gt;
-    &lt;li&gt;&lt;%= link_to topic.name, digg_topic_path(:topic =&gt; topic.short_name) %&gt;&lt;/li&gt; 
+    &lt;li&gt;
+        &lt;% if upcoming? %&gt;
+            &lt;%= link_to &quot;&lt;span&gt;#{topic.name}&lt;/span&gt;&quot;, digg_upcoming_topic_path(:topic =&gt; topic.short_name) %&gt;
+        &lt;% else %&gt;
+            &lt;%= link_to topic.name, digg_topic_path(:topic =&gt; topic.short_name) %&gt;
+        &lt;% end %&gt;
+    &lt;/li&gt; 
 &lt;% end %&gt;
 &lt;/ul&gt;
 
-&lt;h2&gt;Upcoming by topic&lt;/h2&gt;
-
-&lt;ul id='topics-list'&gt;
-&lt;% for topic in @topics %&gt;
-    &lt;li&gt;&lt;%= link_to topic.name, digg_upcoming_topic(:topic =&gt; topic.short_name) %&gt;&lt;/li&gt; 
-&lt;% end %&gt;
-&lt;/ul&gt;
\ No newline at end of file
+&lt;!-- :diggbar =&gt; params[:diggbar] --&gt;
\ No newline at end of file</diff>
      <filename>app/views/digg/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
-atom_feed(:schema_date =&gt; 2008, :root_url =&gt; root_url, :url =&gt; digg_topic_url(:topic =&gt; params[:topic])) do |feed|
-  feed.title &quot;Feeddit Topic: '#{params[:topic].titleize}'&quot;
+atom_feed(:schema_date =&gt; 2008, :root_url =&gt; root_url, :url =&gt; (upcoming? ? digg_upcoming_topic_url(:topic =&gt; params[:topic]) : digg_topic_url(:topic =&gt; params[:topic]))) do |feed|
+  feed.title &quot;#{'Upcoming in ' if upcoming?}Feeddit Topic: '#{params[:topic].titleize}'&quot;
   feed.updated Time.at(@stories.timestamp.to_i)
 
   for story in @stories</diff>
      <filename>app/views/digg/topic.atom.builder</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@
     	
     	&lt;%= link_to image_tag('subscribe.png', :id =&gt; 'subscribe'), &quot;http://feeds.feedburner.com/Diggfeedr&quot; %&gt;
     	
-    	&lt;br /&gt;&lt;%= link_to &quot;or get individual topics here&quot;, digg_topics_path %&gt;
+    	&lt;br /&gt;&lt;%= link_to &quot;or get individual topics here&quot;, digg_path %&gt;
     &lt;/div&gt;
     &lt;div id=&quot;blurb&quot;&gt;
     	&lt;div class=&quot;item&quot;&gt;</diff>
      <filename>app/views/index/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,19 @@
 ActionController::Routing::Routes.draw do |map|
   
   map.with_options :controller =&gt; 'digg' do |route|
-    route.digg                '/digg/', :action =&gt; 'index'
-    route.digg_popular        '/digg/popular.atom', :action =&gt; 'popular', :format =&gt; 'atom'
-    route.digg_topic          '/digg/topics/:topic.atom', :action =&gt; 'topic', :format =&gt; 'atom'
-    route.digg_topics         '/digg/topics', :action =&gt; 'topics'
-    route.digg_upcoming       '/digg/upcoming', :action =&gt; 'popular', :format =&gt; 'atom'
-    route.digg_upcoming_topic '/digg/upcoming/topics/:topic.atom', :action =&gt; 'topic', :format =&gt; 'atom'
+    route.digg                '/digg',                             :action =&gt; 'index'
+    route.digg_upcoming       '/digg/upcoming',                    :action =&gt; 'index',                    :upcoming =&gt; true
+    route.digg_popular        '/digg/popular.atom',                :action =&gt; 'index', :format =&gt; 'atom'
+    route.digg_upcoming_feed  '/digg/upcoming.atom',               :action =&gt; 'index', :format =&gt; 'atom', :upcoming =&gt; true
+    route.digg_topic          '/digg/topics/:topic.atom',          :action =&gt; 'topic', :format =&gt; 'atom'
+    route.digg_upcoming_topic '/digg/topics/upcoming/:topic.atom', :action =&gt; 'topic', :format =&gt; 'atom', :upcoming =&gt; true
   end
   
   # legacy routes
-  map.rss '/feed.rss', :controller =&gt; 'digg', :action =&gt; 'popular', :format =&gt; 'atom' 
-  map.atom '/feed.atom', :controller =&gt; 'digg', :action =&gt; 'popular', :format =&gt; 'atom'
-  map.topics '/topics', :controller =&gt; 'digg', :action =&gt; 'topics'
-  map.topic '/topics/:topic.atom', :controller =&gt; 'digg', :action =&gt; 'topic', :format =&gt; 'atom'
+  map.rss     '/feed.rss',           :controller =&gt; 'digg', :action =&gt; 'index', :format =&gt; 'atom' 
+  map.atom    '/feed.atom',          :controller =&gt; 'digg', :action =&gt; 'index', :format =&gt; 'atom'
+  map.topics  '/topics',             :controller =&gt; 'digg', :action =&gt; 'index'
+  map.topic   '/topics/:topic.atom', :controller =&gt; 'digg', :action =&gt; 'topic', :format =&gt; 'atom'
 
   map.with_options :controller =&gt; 'index' do |index|
     index.root </diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -117,6 +117,7 @@ h1 a
 #topics-list
   :margin 20px 0 0 0
   :padding 0
+  :clear both
 
   li
     :list-style none
@@ -176,3 +177,43 @@ h1 a
 #middle
   :clear both
   :font-size 0.8em
+
+.switch
+  :height 40px
+  :margin 0 0 20px
+  :float right
+  a
+    :font-size 1.5em
+    :display block
+    :width 110px
+    :height 20px
+    :float right
+    :text-align center
+    :text-decoration none
+    :color #888
+    :text-shadow 1px 1px 1px #fff
+    :padding 10px 0
+    :-webkit-box-shadow 1px 1px 1px #aaa
+    :background #eee
+    
+    &amp;:hover
+      :color #555
+    
+    &amp;.active
+      :background #4578B1
+      :text-shadow none
+      :color #CFE1FF
+      
+      &amp;:hover
+        :color #BBCCEA
+    
+    &amp;.popular
+      :width 99px
+
+      :-webkit-border-bottom-left-radius 10px
+      :-webkit-border-top-left-radius 10px
+    
+    &amp;.upcoming
+      :width 110px
+      :-webkit-border-bottom-right-radius 10px
+      :-webkit-border-top-right-radius 10px
\ No newline at end of file</diff>
      <filename>public/stylesheets/sass/application.sass</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/views/digg/popular.atom.builder</filename>
    </removed>
    <removed>
      <filename>app/views/digg/topics.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/digg/upcoming.atom.builder</filename>
    </removed>
    <removed>
      <filename>app/views/digg/upcoming_topic.atom.builder</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>d6b267a19167a2eb06fb7d210f588bb20f77c309</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Nesbitt</name>
    <email>andrewnez@gmail.com</email>
  </author>
  <url>http://github.com/andrew/feeddit/commit/f99b18dc75ff5da11333244bcec629742a982fd0</url>
  <id>f99b18dc75ff5da11333244bcec629742a982fd0</id>
  <committed-date>2009-04-11T05:41:05-07:00</committed-date>
  <authored-date>2009-04-11T05:41:05-07:00</authored-date>
  <message>Simplified and improved digg namespace feeds and views</message>
  <tree>f05d05ce29498fe35a8135f91d28aff1fbf6d2d7</tree>
  <committer>
    <name>Andrew Nesbitt</name>
    <email>andrewnez@gmail.com</email>
  </committer>
</commit>
