From c0b0e14b9e4e3929733540600af74b22ec190a21 Mon Sep 17 00:00:00 2001 From: lukemelia Date: Fri, 25 Aug 2006 03:36:44 +0000 Subject: [PATCH] Applied a variation of the patch submitted with #367 by a nameless contrbutor (thanks, whoever you are!). This should bring our iCal feeds more in line with the spec (RFC 2445) and make them work better with Evolution and perhaps other iCal consumers. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@315 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/helpers/feed_helper.rb | 4 ++++ tracks/app/views/feed/ical.rhtml | 1 + 2 files changed, 5 insertions(+) diff --git a/tracks/app/helpers/feed_helper.rb b/tracks/app/helpers/feed_helper.rb index 6be2de4c..47c01b9b 100644 --- a/tracks/app/helpers/feed_helper.rb +++ b/tracks/app/helpers/feed_helper.rb @@ -62,6 +62,10 @@ module FeedHelper joined_notes = split_notes.join("\\n") end + def format_ical_uid(todo) + sprintf("%s%s%s%s", @request.protocol, @request.host, @request.port_string, url_for(:controller => 'todo', :action => 'show', :id => todo.id)) + end + def rss_feed_link(options = {}) image_tag = image_tag("feed-icon", :size => "16X16", :border => 0, :class => "rss-icon") linkoptions = {:controller => 'feed', :action => 'rss', :name => "#{@user.login}", :token => "#{@user.word}"} diff --git a/tracks/app/views/feed/ical.rhtml b/tracks/app/views/feed/ical.rhtml index f68001d2..1160e751 100644 --- a/tracks/app/views/feed/ical.rhtml +++ b/tracks/app/views/feed/ical.rhtml @@ -13,6 +13,7 @@ BEGIN:VTODO DTSTAMP:<%= @todo.created_at.strftime("%Y%m%dT%H%M%SZ") %> DTSTART;VALUE=DATE:<%= @todo.created_at.strftime("%Y%m%d") %> SUMMARY:<%= @todo.description %> +UID:<%= format_ical_uid(@todo) %> <% if @todo.notes? -%> DESCRIPTION:<%= format_ical_notes(@todo.notes) %> <% end -%>