From d2bfbfd2810fbee673e43b2515db8bac527b3441 Mon Sep 17 00:00:00 2001 From: hukl Date: Mon, 16 Mar 2009 20:58:49 +0100 Subject: Refactored Chaos Calendar by wrapping libical and introducing event and occurrence model. More improvements to come. Enables us to create events with reoccurrence and intervals etc. --- app/views/occurrences/edit.html.erb | 32 ++++++++++++++++++++++++++++++++ app/views/occurrences/index.html.erb | 28 ++++++++++++++++++++++++++++ app/views/occurrences/new.html.erb | 31 +++++++++++++++++++++++++++++++ app/views/occurrences/show.html.erb | 28 ++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+) create mode 100644 app/views/occurrences/edit.html.erb create mode 100644 app/views/occurrences/index.html.erb create mode 100644 app/views/occurrences/new.html.erb create mode 100644 app/views/occurrences/show.html.erb (limited to 'app/views/occurrences') diff --git a/app/views/occurrences/edit.html.erb b/app/views/occurrences/edit.html.erb new file mode 100644 index 00000000..6a81188c --- /dev/null +++ b/app/views/occurrences/edit.html.erb @@ -0,0 +1,32 @@ +

Editing occurrence

+ +<% form_for(@occurrence) do |f| %> + <%= f.error_messages %> + +

+ <%= f.label :summary %>
+ <%= f.text_field :summary %> +

+

+ <%= f.label :start_time %>
+ <%= f.datetime_select :start_time %> +

+

+ <%= f.label :end_time %>
+ <%= f.datetime_select :end_time %> +

+

+ <%= f.label :node_id %>
+ <%= f.text_field :node_id %> +

+

+ <%= f.label :event_id %>
+ <%= f.text_field :event_id %> +

+

+ <%= f.submit 'Update' %> +

+<% end %> + +<%= link_to 'Show', @occurrence %> | +<%= link_to 'Back', occurrences_path %> \ No newline at end of file diff --git a/app/views/occurrences/index.html.erb b/app/views/occurrences/index.html.erb new file mode 100644 index 00000000..06dbf074 --- /dev/null +++ b/app/views/occurrences/index.html.erb @@ -0,0 +1,28 @@ +

Listing occurrences

+ + + + + + + + + + +<% @occurrences.each do |occurrence| %> + + + + + + + + + + +<% end %> +
SummaryStart timeEnd timeNodeEvent
<%=h occurrence.summary %><%=h occurrence.start_time %><%=h occurrence.end_time %><%=h occurrence.node_id %><%=h occurrence.event_id %><%= link_to 'Show', occurrence %><%= link_to 'Edit', edit_occurrence_path(occurrence) %><%= link_to 'Destroy', occurrence, :confirm => 'Are you sure?', :method => :delete %>
+ +
+ +<%= link_to 'New occurrence', new_occurrence_path %> \ No newline at end of file diff --git a/app/views/occurrences/new.html.erb b/app/views/occurrences/new.html.erb new file mode 100644 index 00000000..0a77af15 --- /dev/null +++ b/app/views/occurrences/new.html.erb @@ -0,0 +1,31 @@ +

New occurrence

+ +<% form_for(@occurrence) do |f| %> + <%= f.error_messages %> + +

+ <%= f.label :summary %>
+ <%= f.text_field :summary %> +

+

+ <%= f.label :start_time %>
+ <%= f.datetime_select :start_time %> +

+

+ <%= f.label :end_time %>
+ <%= f.datetime_select :end_time %> +

+

+ <%= f.label :node_id %>
+ <%= f.text_field :node_id %> +

+

+ <%= f.label :event_id %>
+ <%= f.text_field :event_id %> +

+

+ <%= f.submit 'Create' %> +

+<% end %> + +<%= link_to 'Back', occurrences_path %> \ No newline at end of file diff --git a/app/views/occurrences/show.html.erb b/app/views/occurrences/show.html.erb new file mode 100644 index 00000000..9e831cf3 --- /dev/null +++ b/app/views/occurrences/show.html.erb @@ -0,0 +1,28 @@ +

+ Summary: + <%=h @occurrence.summary %> +

+ +

+ Start time: + <%=h @occurrence.start_time %> +

+ +

+ End time: + <%=h @occurrence.end_time %> +

+ +

+ Node: + <%=h @occurrence.node_id %> +

+ +

+ Event: + <%=h @occurrence.event_id %> +

+ + +<%= link_to 'Edit', edit_occurrence_path(@occurrence) %> | +<%= link_to 'Back', occurrences_path %> \ No newline at end of file -- cgit v1.3