<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,4 @@
 = TODO
 
-* Add feed 'update now' capability to admin page
-* Auto-Reindex search after admin changes (ex: delete a feed) -- is this necessary?
 * Allow users to suggest feeds?
-  
+* Overhaul theme / design  </diff>
      <filename>TODO.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,7 @@ helpers do
   end
 end
 
-# root page
+# main page, index of recent entries
 ['/', '/page/:page'].each do |action|
   get action do 
     @pages, @entries = Entry.paginated(:order =&gt; [:published_at.desc], 
@@ -35,6 +35,7 @@ end
   end
 end
 
+# atom feed
 get '/feed' do
   content_type 'application/atom+xml', :charset =&gt; 'utf-8'
   @entries = Entry.all(:order =&gt; [:published_at.desc],
@@ -42,12 +43,14 @@ get '/feed' do
   builder :feed
 end
 
+# search
 post '/search' do
   @entries = Entry.search(:conditions =&gt; [params[:q].to_s], 
                           :limit =&gt; SiteConfig.per_page)
   haml :search
 end
 
+# admin page, feed management
 ['/admin', '/admin/feeds'].each do |action|
   get action do
     login_required
@@ -56,6 +59,7 @@ end
   end
 end
 
+# admin feed create
 post '/admin/feeds' do
   login_required
   @feed = Feed.new(:url =&gt; params[:url])
@@ -63,9 +67,18 @@ post '/admin/feeds' do
   redirect '/admin'
 end
 
+# admin feed delete
 delete '/admin/feeds/:id' do
   login_required
   @feed = Feed.get(params[:id])
   @feed.destroy
   redirect '/admin'
 end
+
+# admin feed update (from remote)
+post '/admin/feeds/:id/update' do
+  login_required
+  @feed = Feed.get(params[:id])
+  @feed.update_from_remote
+  redirect '/admin'
+end</diff>
      <filename>application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -126,7 +126,8 @@ ul.feeds li.feed {
 .clear {
   clear: both;
 }
-form.delete {
+form.action {
   margin: 0;
   padding: 0;
+  display: inline;
 }</diff>
      <filename>public/stylesheets/application.css</filename>
    </modified>
    <modified>
      <diff>@@ -126,5 +126,26 @@ describe 'Application' do
         last_response.status.should == 401
       end
     end
+
+    context 'updating feeds' do
+      specify 'should run update for the specified feed' do
+        authorize SiteConfig.admin_login, SiteConfig.admin_password
+        Feed.should_receive(:get).with('1').and_return(@feed)
+        @feed.should_receive(:update_from_remote).and_return(true)
+        post &quot;/admin/feeds/#{@feed.id}/update&quot;
+      end
+
+      specify 'should redirect to the main admin page' do
+        authorize SiteConfig.admin_login, SiteConfig.admin_password
+        post &quot;/admin/feeds/#{@feed.id}/update&quot;
+        follow_redirect!
+        last_request.url.should match(/.*\/admin$/)
+      end
+
+      specify 'should require login' do
+        post '/admin/feeds/1/update'
+        last_response.status.should == 401
+      end
+    end
   end
 end</diff>
      <filename>spec/application_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,13 @@
 %ul.feeds
   - @feeds.each do |feed|
     %li{:id =&gt; &quot;feed-#{feed.id}&quot;, :class =&gt; 'feed'}
-      %form{:action =&gt; &quot;/admin/feeds/#{feed.id}&quot;, :method =&gt; 'post', :class =&gt; 'delete'}
+      %form{:action =&gt; &quot;/admin/feeds/#{feed.id}&quot;, :method =&gt; 'post', :class =&gt; 'action'}
         %input{:type =&gt; 'hidden', :name =&gt; '_method', :value =&gt; 'delete'}
         %input{:type =&gt; 'submit', :value =&gt; 'X', :onclick =&gt; &quot;return confirm('Are you sure? This will delete the feed and all its entries')&quot;}
-        %a{:href =&gt; feed.url, :target =&gt; '_blank'}= feed.title
-        = &quot;- #{feed.entries.length} entries&quot;
+      %form{:action =&gt; &quot;/admin/feeds/#{feed.id}/update&quot;, :method =&gt; 'post', :class =&gt; 'action'}
+        %input{:type =&gt; 'submit', :value =&gt; 'Update'}
+      %a{:href =&gt; feed.url, :target =&gt; '_blank'}= feed.title
+      = &quot;- #{feed.entries.length} entries&quot;
 %form{:action =&gt; '/admin/feeds', :method =&gt; 'post'}
   %input{:type =&gt; 'text', :name =&gt; 'url'}
   %input{:type =&gt; 'submit', :value =&gt; 'Add New Feed'}</diff>
      <filename>views/admin.haml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d21eb5239b6a3ddd24e12ec5fe399eee2e687dfc</id>
    </parent>
  </parents>
  <author>
    <name>Nick Plante</name>
    <email>nap@zerosum.org</email>
  </author>
  <url>http://github.com/zapnap/mogo/commit/65bcb3ce7bf409cfbe99547e5ac3915a40f1ead5</url>
  <id>65bcb3ce7bf409cfbe99547e5ac3915a40f1ead5</id>
  <committed-date>2009-04-01T10:30:40-07:00</committed-date>
  <authored-date>2009-04-01T10:30:40-07:00</authored-date>
  <message>add feed update buttons to admin interface</message>
  <tree>6ba4ac8593357d45a6c94b7bef521e5d60248227</tree>
  <committer>
    <name>Nick Plante</name>
    <email>nap@zerosum.org</email>
  </committer>
</commit>
