[Bast-commits] r9853 - in ironman/IronMan-Web/branches/dev: .
lib/IronMan lib/IronMan/Web/Controller root
idn at dev.catalyst.perl.org
idn at dev.catalyst.perl.org
Sun Apr 10 08:31:03 GMT 2011
Author: idn
Date: 2011-04-10 08:31:03 +0000 (Sun, 10 Apr 2011)
New Revision: 9853
Added:
ironman/IronMan-Web/branches/dev/root/update_feed.tt
Modified:
ironman/IronMan-Web/branches/dev/
ironman/IronMan-Web/branches/dev/Makefile.PL
ironman/IronMan-Web/branches/dev/lib/IronMan/Web.pm
ironman/IronMan-Web/branches/dev/lib/IronMan/Web/Controller/Root.pm
Log:
Merge from trunk
Property changes on: ironman/IronMan-Web/branches/dev
___________________________________________________________________
Added: svn:mergeinfo
+ /ironman/IronMan-Web/trunk:9620-9851
Modified: ironman/IronMan-Web/branches/dev/Makefile.PL
===================================================================
--- ironman/IronMan-Web/branches/dev/Makefile.PL 2011-04-10 08:30:30 UTC (rev 9852)
+++ ironman/IronMan-Web/branches/dev/Makefile.PL 2011-04-10 08:31:03 UTC (rev 9853)
@@ -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/dev/lib/IronMan/Web/Controller/Root.pm
===================================================================
--- ironman/IronMan-Web/branches/dev/lib/IronMan/Web/Controller/Root.pm 2011-04-10 08:30:30 UTC (rev 9852)
+++ ironman/IronMan-Web/branches/dev/lib/IronMan/Web/Controller/Root.pm 2011-04-10 08:31:03 UTC (rev 9853)
@@ -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.
Modified: ironman/IronMan-Web/branches/dev/lib/IronMan/Web.pm
===================================================================
--- ironman/IronMan-Web/branches/dev/lib/IronMan/Web.pm 2011-04-10 08:30:30 UTC (rev 9852)
+++ ironman/IronMan-Web/branches/dev/lib/IronMan/Web.pm 2011-04-10 08:31:03 UTC (rev 9853)
@@ -14,7 +14,7 @@
# Static::Simple: will serve static files from the application's root
# directory
-use Catalyst qw/-Debug ConfigLoader Static::Simple StackTrace/;
+use Catalyst qw/ConfigLoader Static::Simple StackTrace/;
our $VERSION = '0.01';
Copied: ironman/IronMan-Web/branches/dev/root/update_feed.tt (from rev 9851, ironman/IronMan-Web/trunk/root/update_feed.tt)
===================================================================
--- ironman/IronMan-Web/branches/dev/root/update_feed.tt (rev 0)
+++ ironman/IronMan-Web/branches/dev/root/update_feed.tt 2011-04-10 08:31:03 UTC (rev 9853)
@@ -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