[viewvc-dev] RSS Feeds built from queries
"Larry Shatzer, Jr." <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Message-ID | <[email protected]> |
I originally thought the RSS feeds where limited by the results of the query performed (since that is the first place I noticed the RSS feed icon(s). It took me a while to realize it really is just the last months of entries, built from the commit database. The wonderfulness of RSS (and other feeds such as Atom) is you can have multiple <link>'s in the header, and browsers (at least Firefox) will list them all so you can choose which RSS feed to subscribe to. Attached is a first draft patch to provide a second <link> from the query result page. The approch I took was using the [define rss_query_href] from the query_results.ezt file. This had a knock on effect that I had to [define rss_query_href] in most of the rest the templates. This of course is no ideal. I guess I can also edit viewvc.py and add it to the dictonary, to avoid having to declare it in each template that includes header.ezt and footer.ezt. I also did not notice a variable for the url from within the query result page, so I used the [limit_changes_href] and retacked on the [limit_query] value to the url, along with format=rss. Does anyone else think this would be a worthwile thing to add to ViewVC (RSS feeds based off the query results)? -- Larry --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
queryrss.patch
(text/x-patch, 6 KB)
Index: templates/file.ezt =================================================================== --- templates/file.ezt (revision 1962) +++ templates/file.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Annotate of /[where][end] [define help_href][docroot]/help_rootview.html[end] + [define rss_query_href][end] [# end] [include "include/header.ezt" "markup"] Index: templates/log.ezt =================================================================== --- templates/log.ezt (revision 1962) +++ templates/log.ezt (working copy) @@ -2,7 +2,7 @@ [define first_revision][end] [define last_revision][end] - +[define rss_query_href][end] [for entries] [if-index entries first][define first_revision][entries.rev][end][end] [if-index entries last][define last_revision][entries.rev][end][end] Index: templates/include/footer.ezt =================================================================== --- templates/include/footer.ezt (revision 1962) +++ templates/include/footer.ezt (working copy) @@ -9,7 +9,7 @@ </tr> <tr> <td>Powered by <a href="http://viewvc.tigris.org/">ViewVC [vsn]</a></td> - <td style="text-align: right;">[if-any rss_href]<a href="[rss_href]" title="RSS 2.0 feed"><img src="[docroot]/images/feed-icon-16x16.jpg" class="vc_icon" alt="RSS 2.0 feed" /></a>[else] [end]</td> + <td style="text-align: right;">[if-any rss_href]<a href="[rss_href]" title="RSS 2.0 feed">RSS 2.0 feed <img src="[docroot]/images/feed-icon-16x16.jpg" class="vc_icon" alt="RSS 2.0 feed" /></a>[if-any rss_query_href]<br/><a href="[rss_query_href]" title="Query RSS 2.0 feed">Query RSS 2.0 feed <img src="[docroot]/images/feed-icon-16x16.jpg" class="vc_icon" alt="Query RSS 2.0 feed"></a>[end][else] [end]</td> </tr> </table> Index: templates/include/dir_header.ezt =================================================================== --- templates/include/dir_header.ezt (revision 1962) +++ templates/include/dir_header.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Index of /[where][end] [define help_href][docroot]/help_[if-any where]dir[else]root[end]view.html[end] + [define rss_query_href][end] [# end] [include "header.ezt" "directory"] Index: templates/include/log_header.ezt =================================================================== --- templates/include/log_header.ezt (revision 1962) +++ templates/include/log_header.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Log of /[where][end] [define help_href][docroot]/help_log.html[end] + [define rss_query_href][end] [# end] [include "header.ezt" "log"] Index: templates/query_results.ezt =================================================================== --- templates/query_results.ezt (revision 1962) +++ templates/query_results.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Query results on /[where][end] [define help_href][docroot]/help_rootview.html[end] + [define rss_query_href][limit_changes_href]&limit_changes=[limit_changes]&format=rss[end] [# end] [include "include/header.ezt"] Index: templates/query_form.ezt =================================================================== --- templates/query_form.ezt (revision 1962) +++ templates/query_form.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Query on /[where][end] [define help_href][docroot]/help_rootview.html[end] + [define rss_query_href][end] [# end] [include "include/header.ezt" "query"] Index: templates/revision.ezt =================================================================== --- templates/revision.ezt (revision 1962) +++ templates/revision.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Revision [rev][end] [define help_href][docroot]/help_rootview.html[end] + [define rss_query_href][end] [# end] [include "include/header.ezt" "revision"] Index: templates/graph.ezt =================================================================== --- templates/graph.ezt (revision 1962) +++ templates/graph.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Graph of /[where][end] [define help_href][docroot]/help_rootview.html[end] + [define rss_query_href][end] [# end] [include "include/header.ezt" "graph"] Index: templates/roots.ezt =================================================================== --- templates/roots.ezt (revision 1962) +++ templates/roots.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Repository Listing[end] [define help_href][docroot]/help_rootview.html[end] + [define rss_query_href][end] [# end] [include "include/header.ezt" "directory"] Index: templates/diff.ezt =================================================================== --- templates/diff.ezt (revision 1962) +++ templates/diff.ezt (working copy) @@ -1,6 +1,7 @@ [# setup page definitions] [define page_title]Diff of /[where][end] [define help_href][docroot]/help_rootview.html[end] + [define rss_query_href][end] [# end] [include "include/header.ezt" "diff"] Index: templates/include/header.ezt =================================================================== --- templates/include/header.ezt (revision 1962) +++ templates/include/header.ezt (working copy) @@ -7,7 +7,12 @@ <meta name="generator" content="ViewVC [vsn]" /> <link rel="shortcut icon" href="[docroot]/images/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" href="[docroot]/styles.css" type="text/css" /> - [if-any rss_href]<link rel="alternate" type="application/rss+xml" title="RSS [[][rootname]][where]" href="[rss_href]" />[end] + [if-any rss_href] + <link rel="alternate" type="application/rss+xml" title="RSS [[][rootname]][where]" href="[rss_href]" /> + [if-any rss_query_href] + <link rel="alternate" type="application/rss+xml" title="Query RSS [[][rootname]][where] [english_query]" href="[rss_query_href]" /> + [end] + [end] </head> <body> <div class="vc_navheader">