From b329fa489603761a724a5d28c6a9a22c2d35acef Mon Sep 17 00:00:00 2001
From: Andreas Stephanides
Date: Thu, 8 Aug 2013 09:09:34 +0200
Subject: [PATCH] simple_calendar, calender_show_view
Kalender in Tabellenansicht
---
Gemfile | 2 ++
app/controllers/calentries_controller.rb | 2 +-
app/views/calendars/show.html.erb | 9 +++++++++
app/views/calentries/_form.html.erb | 1 +
app/views/layouts/menu.html.erb | 4 ++--
5 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/Gemfile b/Gemfile
index 7fce64e..d81643d 100755
--- a/Gemfile
+++ b/Gemfile
@@ -75,3 +75,5 @@ group :development, :test do
gem 'factory_girl_rails'
gem 'rspec-rails'
end
+
+gem "simple_calendar", "~> 0.1.9"
diff --git a/app/controllers/calentries_controller.rb b/app/controllers/calentries_controller.rb
index 89990cd..3452d72 100644
--- a/app/controllers/calentries_controller.rb
+++ b/app/controllers/calentries_controller.rb
@@ -18,7 +18,7 @@ class CalentriesController < ApplicationController
respond_to do |format|
format.html # show.html.erb
format.json { render json: @calentry }
- format.ics { render 'show.ics.erb',}
+ format.ics { render 'show.ics.erb'}
end
end
diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb
index efadc5a..8778ca8 100644
--- a/app/views/calendars/show.html.erb
+++ b/app/views/calendars/show.html.erb
@@ -9,7 +9,16 @@
Public:
<%= @calendar.public %>
+
+
+<% @calendar.calentries.each do |entry| %>
+<%= entry.summary+ "- " + entry.start.to_s %>
+<% end %>
+<%= calendar @calendar.calentries do |entry| %>
+ <%= link_to entry.name, entry %>
+<% end %>
+<%= link_to 'New Entry', new_calentry_path %>
<%= link_to 'Edit', edit_calendar_path(@calendar) %> |
<%= link_to 'Back', calendars_path %>
diff --git a/app/views/calentries/_form.html.erb b/app/views/calentries/_form.html.erb
index bd74e58..6dd64ad 100644
--- a/app/views/calentries/_form.html.erb
+++ b/app/views/calentries/_form.html.erb
@@ -3,6 +3,7 @@
<%= f.input :start %>
<%= f.input :ende %>
<%= f.input :summary %>
+ <%= f.input :calendar, :as=> :radio %>
<%= f.input :typ %>
<% end %>
diff --git a/app/views/layouts/menu.html.erb b/app/views/layouts/menu.html.erb
index bc71698..cd73c74 100755
--- a/app/views/layouts/menu.html.erb
+++ b/app/views/layouts/menu.html.erb
@@ -4,8 +4,8 @@
- <%= link_to I18n.t(:news,:scope=>'home' ),rubriken_path %>
- <%= link_to I18n.t(:info,:scope=>'home' ) %>
-- <%= link_to I18n.t(:studien,:scope=>'home' ), studien_path %>
-
+- <%= link_to I18n.t(:studien,:scope=>'home' ), studien_path %>
+- <%= link_to "Kalender", calendars_path %>
- <%= link_to "wiki intern", page_path(1) %>