aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/track
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/track')
-rw-r--r--app/views/track/atom_feed.atom.builder24
-rw-r--r--app/views/track/track_set.rhtml6
2 files changed, 26 insertions, 4 deletions
diff --git a/app/views/track/atom_feed.atom.builder b/app/views/track/atom_feed.atom.builder
new file mode 100644
index 000000000..627c53d11
--- /dev/null
+++ b/app/views/track/atom_feed.atom.builder
@@ -0,0 +1,24 @@
+atom_feed do |feed|
+ feed.title(@track_thing.params[:title_in_rss])
+
+ for search_result in @search_results
+ feed.entry(search_result) do |entry|
+ # Get the HTML content from the same partial template as website search does
+ content = ''
+ if search_result.class.to_s == 'InfoRequestEvent'
+ content += render :partial => 'request/request_listing_via_event', :locals => { :event => search_result, :info_request => search_result.info_request }
+ else
+ content = "<p><strong>Unknown search result type " + search_result.class.to_s + "</strong></p>"
+ end
+ # Pull out the heading as separate item, from the partial template
+ content.match(/(<a href="[^>]*">(.*)<\/a>\s+<br>)/)
+ heading = $1
+ heading_text = $2
+ content.sub!(heading, "")
+ # Render the atom
+ entry.title(heading_text, :type => 'html')
+ entry.content(content, :type => 'html')
+ end
+ end
+end
+
diff --git a/app/views/track/track_set.rhtml b/app/views/track/track_set.rhtml
index 47e4f59a1..90b767219 100644
--- a/app/views/track/track_set.rhtml
+++ b/app/views/track/track_set.rhtml
@@ -13,11 +13,9 @@
<br> -->
<%= radio_button "track_thing", "track_medium", "email_daily" %>
<label for="track_thing_track_medium_email_daily">Send me emails at most once a day</label>
- <!--
<br>
- <%= radio_button "track_thing", "track_medium", "rss" %>
- <label for="track__thingtrack_medium_rss">Give me a feed to use in my news reader (RSS)</label>
- -->
+ <%= radio_button "track_thing", "track_medium", "feed" %>
+ <label for="track_thing_track_medium_feed">Give me a feed to use in my news reader (RSS)</label>
</div>
<p class="form_note">