[Bast-commits] r9851 - in ironman/IronMan-Web/branches/ironboy: . lib/IronMan/Web/Controller root

idn at dev.catalyst.perl.org idn at dev.catalyst.perl.org
Sun Apr 10 08:25:56 GMT 2011


Author: idn
Date: 2011-04-10 08:25:56 +0000 (Sun, 10 Apr 2011)
New Revision: 9851

Added:
   ironman/IronMan-Web/branches/ironboy/root/update_feed.tt
Modified:
   ironman/IronMan-Web/branches/ironboy/
   ironman/IronMan-Web/branches/ironboy/Makefile.PL
   ironman/IronMan-Web/branches/ironboy/lib/IronMan/Web/Controller/Root.pm
Log:
Merge from trunk


Property changes on: ironman/IronMan-Web/branches/ironboy
___________________________________________________________________
Added: svn:mergeinfo
   + /ironman/IronMan-Web/trunk:9621-9850

Modified: ironman/IronMan-Web/branches/ironboy/Makefile.PL
===================================================================
--- ironman/IronMan-Web/branches/ironboy/Makefile.PL	2011-03-30 16:23:03 UTC (rev 9850)
+++ ironman/IronMan-Web/branches/ironboy/Makefile.PL	2011-04-10 08:25:56 UTC (rev 9851)
@@ -23,6 +23,7 @@
 requires 'DateTime::Format::HTTP';
 requires 'YAML::XS';
 requires 'IronMan::Schema';
+requires 'Term::Prompt';
 
 # We need DateTime::Format::SQLite for script/import_csv.pl if using SQLite
 recommends 'DateTime::Format::SQLite';

Modified: ironman/IronMan-Web/branches/ironboy/lib/IronMan/Web/Controller/Root.pm
===================================================================
--- ironman/IronMan-Web/branches/ironboy/lib/IronMan/Web/Controller/Root.pm	2011-03-30 16:23:03 UTC (rev 9850)
+++ ironman/IronMan-Web/branches/ironboy/lib/IronMan/Web/Controller/Root.pm	2011-04-10 08:25:56 UTC (rev 9851)
@@ -131,6 +131,31 @@
     $c->res->body($opml->as_string);
 }
 
+
+=head2 update_feed
+
+Update a feed give a user's unique key
+
+=cut
+
+sub update_feed : Local Args(1) {
+  my ($self, $c, $id) = @_;
+  my $feed = $c->model('FeedDB::Feed')->find({ id => $id });
+  if ( defined $feed ) {
+    $c->stash( 
+      owner => $feed->owner,
+      feed  => $feed->url,
+    );
+    if ( $c->req->param('url') ) {
+      $feed->update({ url => $c->req->param('url') })
+        or die "Error: $!";
+      $c->stash( updated => 1 );
+    }
+  } else {
+    $c->stash( error => "No such user" );
+  }
+}
+
 =head2 end
 
 Attempt to render a view, if needed.

Copied: ironman/IronMan-Web/branches/ironboy/root/update_feed.tt (from rev 9850, ironman/IronMan-Web/trunk/root/update_feed.tt)
===================================================================
--- ironman/IronMan-Web/branches/ironboy/root/update_feed.tt	                        (rev 0)
+++ ironman/IronMan-Web/branches/ironboy/root/update_feed.tt	2011-04-10 08:25:56 UTC (rev 9851)
@@ -0,0 +1,12 @@
+[% UNLESS error %]
+[% IF updated %]
+<p>Feed url successfully updated</p>
+[% END %]
+<p>Welcome, [% owner %]</p>
+<form method="post" action="">
+<p>New url for feed (current is: [% feed %]): <input type="text" name="url" /></p>
+<p><input type="submit" value="Update feed url" /></p>
+</form>
+[% ELSE %]
+[% error %]
+[% END %]




More information about the Bast-commits mailing list