From 3d7ddaf18419c983dd179b50eabe253c3eee8194 Mon Sep 17 00:00:00 2001
From: erdgeist
Date: Wed, 8 Jul 2026 11:55:25 +0200
Subject: WIP: dynamic rrule builder
---
app/views/events/edit.html.erb | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
(limited to 'app/views')
diff --git a/app/views/events/edit.html.erb b/app/views/events/edit.html.erb
index 5aee501..d37c299 100644
--- a/app/views/events/edit.html.erb
+++ b/app/views/events/edit.html.erb
@@ -18,8 +18,34 @@
<%= f.datetime_select :end_time %>
+
+ <%= radio_button_tag "rrule_freq", "weekly", true %> Weekly
+ <%= radio_button_tag "rrule_freq", "monthly" %> Monthly
+
+
+
<%= check_box_tag "rrule_biweekly" %> Every 2 weeks
+
+ <% %w[MO TU WE TH FR SA SU].each do |code| %>
+ <%= check_box_tag "rrule_byday_#{code}" %> <%= RruleHumanizer::WEEKDAY_NAMES_ABBR[:de][code] %>
+ <% end %>
+
+
+
+
<%= check_box_tag "rrule_monthly_ordinal" %> On a specific weekday each month
+
+ <%= select_tag "rrule_ordinal", options_for_select([["1.", 1], ["2.", 2], ["3.", 3], ["4.", 4], ["letzter", -1], ["vorletzter", -2]]) %>
+ <%= select_tag "rrule_ordinal_day", options_for_select(%w[MO TU WE TH FR SA SU].map { |c| [RruleHumanizer::WEEKDAY_NAMES[:de][c], c] }) %>
+
+
+
+ <%= check_box_tag "rrule_exclude_month" %> Except in one month
+ <%= select_tag "rrule_excluded_month", options_for_select((1..12).map { |m| [RruleHumanizer::MONTH_NAMES[:de][m-1], m] }), style: "display: none;" %>
+
+
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.
+
+ <%= f.text_field :rrule, id: "event_rrule" %>