summaryrefslogtreecommitdiff
path: root/app/views/events/edit.html.erb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-13 23:33:11 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-13 23:33:11 +0200
commit8eab68f2c5a3c126e2fec2ecdfa7ace87ce0937b (patch)
treef446ebc26a7707c7b64a937aa51a155df146c80a /app/views/events/edit.html.erb
parent42714c697273a7117c6b355fab26c8c35e336ad1 (diff)
parentcdf5d9941ca866d437612d2f863eac6eb0b3db12 (diff)
Merge branch 'erdgeist-revive-events'
Diffstat (limited to 'app/views/events/edit.html.erb')
-rw-r--r--app/views/events/edit.html.erb136
1 files changed, 90 insertions, 46 deletions
diff --git a/app/views/events/edit.html.erb b/app/views/events/edit.html.erb
index 17457df..b6564a4 100644
--- a/app/views/events/edit.html.erb
+++ b/app/views/events/edit.html.erb
@@ -1,53 +1,97 @@
1<% content_for :subnavigation do %>
2 <%= link_to 'back', safe_return_to(params[:return_to] || events_path) %>
3 <% if @event.node %>
4 <%= link_to 'node', edit_node_path(@event.node) %>
5 <% end %>
6 <%= link_to 'show', @event %>
7<% end %>
8
9<h1>Editing event</h1> 1<h1>Editing event</h1>
10 2
3<div class="node_action_bar standalone_action_bar">
4 <%= link_to 'Back', safe_return_to(params[:return_to] || events_path) %>
5 <%= button_to event_path(@event), method: :delete,
6 form: { data: { confirm: 'Delete this event?' }, class: 'button_to destructive' } do %>
7 <%= icon("trash", library: "tabler", "aria-hidden": true) %> Destroy
8 <% end %>
9</div>
10
11<%= form_for(@event) do |f| %> 11<%= form_for(@event) do |f| %>
12 <%= hidden_field_tag :return_to, @return_to %> 12 <%= hidden_field_tag :return_to, @return_to %>
13 <%= form_error_messages(f) %> 13 <%= form_error_messages(f) %>
14 14
15 <p> 15 <div id="page_editor">
16 <%= f.label :start_time %><br /> 16 <div id="content">
17 <%= f.datetime_select :start_time %> 17 <div class="node_description">Node</div>
18 </p> 18 <div class="node_content">
19 <p> 19 <% if @event.node %>
20 <%= f.label :end_time %><br /> 20 <%= link_to @event.node.title, node_path(@event.node) %>
21 <%= f.datetime_select :end_time %> 21 <details>
22 </p> 22 <summary>Change node</summary>
23 <p> 23 <%= text_field_tag :event_node_search_term %>
24 <%= f.label :rrule %><br /> 24 <div id="event_search_results" class="search_results"></div>
25 <%= f.text_field :rrule %> 25 <span class="field_hint">This will re-link the event to a different node — rarely needed.</span>
26 </p> 26 </details>
27 <p> 27 <% else %>
28 <%= f.label :custom_rrule %><br /> 28 <%= text_field_tag :event_node_search_term %>
29 <%= f.check_box :custom_rrule %> 29 <div id="event_search_results" class="search_results"></div>
30 </p> 30 <span class="field_hint">Optional — search and pick a node to associate this event with a page.</span>
31 <p> 31 <% end %>
32 <%= f.label :allday %><br /> 32 <%= f.hidden_field :node_id %>
33 <%= f.check_box :allday %> 33 </div>
34 </p> 34
35 <p> 35 <div class="node_description">Start time</div>
36 <%= f.label :url %><br /> 36 <div class="node_content"><%= f.datetime_select :start_time %></div>
37 <%= f.text_field :url %> 37
38 </p> 38 <div class="node_description">End time</div>
39 <p> 39 <div class="node_content"><%= f.datetime_select :end_time %></div>
40 <%= f.label :latitude %><br /> 40
41 <%= f.text_field :latitude %> 41 <div class="node_description">Recurrence</div>
42 </p> 42 <div class="node_content">
43 <p> 43 <div id="rrule_builder">
44 <%= f.label :longitude %><br /> 44 <p>
45 <%= f.text_field :longitude %> 45 <label><%= radio_button_tag "rrule_freq", "weekly", true %> Weekly</label>
46 </p> 46 <label><%= radio_button_tag "rrule_freq", "monthly" %> Monthly</label>
47 <p> 47 </p>
48 <%= f.hidden_field :node_id %> 48 <div id="rrule_weekly_options">
49 </p> 49 <p><label><%= check_box_tag "rrule_biweekly" %> Every 2 weeks</label></p>
50 <p> 50 <p>
51 <%= f.submit 'Update' %> 51 <% %w[MO TU WE TH FR SA SU].each do |code| %>
52 </p> 52 <label><%= check_box_tag "rrule_byday_#{code}" %> <%= RruleHumanizer::WEEKDAY_NAMES_ABBR[:de][code] %></label>
53 <% end %>
54 </p>
55 </div>
56 <div id="rrule_monthly_options" style="display: none;">
57 <p><label><%= check_box_tag "rrule_monthly_ordinal" %> On a specific weekday each month</label></p>
58 <p id="rrule_ordinal_fields" style="display: none;">
59 <%= select_tag "rrule_ordinal", options_for_select([["1.", 1], ["2.", 2], ["3.", 3], ["4.", 4], ["letzter", -1], ["vorletzter", -2]]) %>
60 <%= select_tag "rrule_ordinal_day", options_for_select(%w[MO TU WE TH FR SA SU].map { |c| [RruleHumanizer::WEEKDAY_NAMES[:de][c], c] }) %>
61 </p>
62 </div>
63 <p>
64 <label><%= check_box_tag "rrule_exclude_month" %> Except in one month</label>
65 <%= select_tag "rrule_excluded_month", options_for_select((1..12).map { |m| [RruleHumanizer::MONTH_NAMES[:de][m-1], m] }), style: "display: none;" %>
66 </p>
67 <span class="field_hint">Builds the field below automatically. If your pattern is more complex than this covers, just edit it directly below - these controls won't touch it unless you use them.</span>
68 </div>
69 <%= f.text_field :rrule, id: "event_rrule" %>
70 </div>
71
72 <div class="node_description">Title</div>
73 <div class="node_content">
74 <%= f.text_field :title %>
75 <span id="event_title_hint" class="field_hint">Optional — if left blank, the associated node's title is used.</span>
76 </div>
77
78 <div class="node_description">Tags</div>
79 <div class="node_content"><%= f.text_field :tag_list %></div>
80
81 <div class="node_description">Allday</div>
82 <div class="node_content"><%= f.check_box :allday %></div>
83
84 <div class="node_description">Url</div>
85 <div class="node_content"><%= f.text_field :url %></div>
86
87 <div class="node_description">Latitude</div>
88 <div class="node_content"><%= f.text_field :latitude %></div>
89
90 <div class="node_description">Longitude</div>
91 <div class="node_content"><%= f.text_field :longitude %></div>
92
93 <div class="node_description"></div>
94 <div class="node_content"><%= f.submit 'Update' %></div>
95 </div>
96 </div>
53<% end %> 97<% end %>