From 9747f40b687d68c141ecf8cc0a2ff92d4f2fdc15 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Mon, 16 Dec 2013 10:27:46 +0100 Subject: [PATCH] calendar ics format summary fix --- app/controllers/calendars_controller.rb | 2 ++ app/views/calentries/_calentry.html.erb | 3 ++- app/views/calentries/_calentry.ics.erb | 6 +++--- app/views/calentries/show.ics.erb | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index 5a250b7..06f6b65 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -4,6 +4,8 @@ class CalendarsController < ApplicationController load_and_authorize_resource def index @calendars = Calendar.all + @calentries = Calentry.all + respond_to do |format| format.html # index.html.erb format.json { render json: @calendars } diff --git a/app/views/calentries/_calentry.html.erb b/app/views/calentries/_calentry.html.erb index fe2ae63..c0dff20 100644 --- a/app/views/calentries/_calentry.html.erb +++ b/app/views/calentries/_calentry.html.erb @@ -5,5 +5,6 @@ format=:timeonly else format =:default end%> -<%= link_to calentry.name, calentry_path(calentry) %> +<%= link_to calentry.text, calentry_path(calentry) %> + diff --git a/app/views/calentries/_calentry.ics.erb b/app/views/calentries/_calentry.ics.erb index 3625512..d3f61d7 100644 --- a/app/views/calentries/_calentry.ics.erb +++ b/app/views/calentries/_calentry.ics.erb @@ -1,9 +1,9 @@ BEGIN:VEVENT -UID:4610<%= calentry.id %>@fet.at +UID:4610<%= calentry.id.to_s %> ORGANIZER;CN="Peter Schlechter, Example Inc.":MAILTO:peter@fet.at LOCATION:Vienna -SUMMARY:<%= calentry.summary%> -DESCRIPTION:<%= calentry.summary%> +SUMMARY:<%= calentry.name %> +DESCRIPTION: <%= link_to calentry.name.to_s, polymorphic_path(calentry.object) %><%= calentry.summary %> CLASS:PUBLIC DTSTART:<%= calentry.start.strftime "%Y%m%dT%H%M%S" %> DTEND:<%= calentry.ende.strftime "%Y%m%dT%H%M%S" %> diff --git a/app/views/calentries/show.ics.erb b/app/views/calentries/show.ics.erb index ad4422d..e43c23b 100644 --- a/app/views/calentries/show.ics.erb +++ b/app/views/calentries/show.ics.erb @@ -2,7 +2,7 @@ BEGIN:VEVENT UID:4610<%= calentry.id $>@fet.at ORGANIZER;CN="Peter Schlechter, Example Inc.":MAILTO:peter@fet.at LOCATION:Vienna -SUMMARY:<%= calentry.summary%> +SUMMARY:<%= calentry.name %> DESCRIPTION:<%= calentry.summary%> CLASS:PUBLIC DTSTART:<%= calentry.start.strftime "%Y%m%dT%H%M%S" %>