[Bast-commits] r9848 - in ironman/IronMan-Web/trunk:
lib/IronMan/Web/Controller root
dhoss at dev.catalyst.perl.org
dhoss at dev.catalyst.perl.org
Tue Mar 29 22:34:54 GMT 2011
Author: dhoss
Date: 2011-03-29 22:34:54 +0000 (Tue, 29 Mar 2011)
New Revision: 9848
Modified:
ironman/IronMan-Web/trunk/lib/IronMan/Web/Controller/Root.pm
ironman/IronMan-Web/trunk/root/update_feed.tt
Log:
added update feature
Modified: ironman/IronMan-Web/trunk/lib/IronMan/Web/Controller/Root.pm
===================================================================
--- ironman/IronMan-Web/trunk/lib/IronMan/Web/Controller/Root.pm 2011-03-29 22:29:16 UTC (rev 9847)
+++ ironman/IronMan-Web/trunk/lib/IronMan/Web/Controller/Root.pm 2011-03-29 22:34:54 UTC (rev 9848)
@@ -142,7 +142,15 @@
my ($self, $c, $id) = @_;
my $feed = $c->model('FeedDB::Feed')->find({ id => $id });
if ( defined $feed ) {
- $c->stash( owner => $feed->owner );
+ $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" );
}
Modified: ironman/IronMan-Web/trunk/root/update_feed.tt
===================================================================
--- ironman/IronMan-Web/trunk/root/update_feed.tt 2011-03-29 22:29:16 UTC (rev 9847)
+++ ironman/IronMan-Web/trunk/root/update_feed.tt 2011-03-29 22:34:54 UTC (rev 9848)
@@ -1,5 +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