[Rt-commit] rtir branch 5.0/add-feed-callbacks-2 created. 5.0.1-2-gb1718554
BPS Git Server
git at git.bestpractical.com
Wed Oct 6 19:41:12 UTC 2021
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rtir".
The branch, 5.0/add-feed-callbacks-2 has been created
at b1718554e4c7b248086f7e67b7a11045d1eb2e48 (commit)
- Log -----------------------------------------------------------------
commit b1718554e4c7b248086f7e67b7a11045d1eb2e48
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Fri Jul 23 14:28:28 2021 -0400
Add callbacks to the feed listing and display pages
This makes it possible for an extension to add a new
feed to the existing page.
diff --git a/html/RTIR/Tools/ExternalFeeds.html b/html/RTIR/Tools/ExternalFeeds.html
index a99a30a8..1e9b7c8c 100644
--- a/html/RTIR/Tools/ExternalFeeds.html
+++ b/html/RTIR/Tools/ExternalFeeds.html
@@ -51,8 +51,9 @@
<div class="form-row">
<div class="col-12">
% my $i = 0;
-% if ($FeedName) {
+% if ( $FeedName and $ExternalFeeds->{rss_feeds}{$FeedName} ) {
% my $feed = $ExternalFeeds->fetch_rss_feed($FeedName);
+
<&|/Widgets/TitleBox,
title => $feed->{Title},
class => "external-feeds fullwidth",
@@ -111,13 +112,19 @@
</div>
% }
</&>
+% }
+% elsif ( $FeedName ) {
+% # Allow non-RSS feeds from extensions to run
+% $m->callback( CallbackName => 'DisplayFeedContent', %ARGS, FeedsObj => $ExternalFeeds, FeedName => $FeedName, Lifecycle => $Lifecycle );
% } else {
+% my $found_feed;
<&|/Widgets/TitleBox,
title => loc("RSS"),
class => "fullwidth",
bodyclass => ""
&>
% if ( $ExternalFeeds->have_rss_feeds) {
+% $found_feed = 1;
<div class="table-responsive">
<table cellspacing="0" class="table collection collection-as-table">
<tr class="collection-as-table">
@@ -134,12 +141,14 @@
</table>
</div>
% }
-% else {
+ </&>
+% $m->callback( CallbackName => 'AfterFeedsList', %ARGS, FeedsObj => $ExternalFeeds, FoundFeedRef => \$found_feed );
+
+% unless ( $found_feed ) {
<p class="mt-3 mt-1 ml-3">
- <&|/l&>No RSS feeds currently configured, you can configure feeds in the %ExternalFeeds option, a default set of security feeds is included in the inital RTIR configuration.</&>
+ <&|/l&>No feeds currently configured. You can configure feeds in the %ExternalFeeds option. A default set of security feeds is included in the inital RTIR configuration.</&>
</p>
% }
- </&>
% }
</div>
diff --git a/lib/RT/IR/ExternalFeeds.pm b/lib/RT/IR/ExternalFeeds.pm
index bf93895d..66112f9b 100644
--- a/lib/RT/IR/ExternalFeeds.pm
+++ b/lib/RT/IR/ExternalFeeds.pm
@@ -150,4 +150,6 @@ sub _scrub_html {
return $scrubbed_html;
}
+RT::IR->ImportOverlays;
+
1;
-----------------------------------------------------------------------
hooks/post-receive
--
rtir
More information about the rt-commit
mailing list