diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-16 16:59:28 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-16 16:59:28 +0200 |
| commit | c831c46b5522a44cefd430bdca04ec9db5a90052 (patch) | |
| tree | d78a647ef4185163029b86713f5adf7259c193b5 /app/views/events/_rrule_builder.html.erb | |
| parent | aa752d4839375f313f0d3e0070e85fbbac13ced9 (diff) | |
Move rrule builder to a partial and share between events#new and events#edit
Diffstat (limited to 'app/views/events/_rrule_builder.html.erb')
| -rw-r--r-- | app/views/events/_rrule_builder.html.erb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app/views/events/_rrule_builder.html.erb b/app/views/events/_rrule_builder.html.erb new file mode 100644 index 00000000..1ffec0a2 --- /dev/null +++ b/app/views/events/_rrule_builder.html.erb | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | <div id="rrule_builder"> | ||
| 2 | <p> | ||
| 3 | <label><%= radio_button_tag "rrule_freq", "weekly", true %> Weekly</label> | ||
| 4 | <label><%= radio_button_tag "rrule_freq", "monthly" %> Monthly</label> | ||
| 5 | </p> | ||
| 6 | <div id="rrule_weekly_options"> | ||
| 7 | <p><label><%= check_box_tag "rrule_biweekly" %> Every 2 weeks</label></p> | ||
| 8 | <p> | ||
| 9 | <% %w[MO TU WE TH FR SA SU].each do |code| %> | ||
| 10 | <label><%= check_box_tag "rrule_byday_#{code}" %> <%= RruleHumanizer::WEEKDAY_NAMES_ABBR[:de][code] %></label> | ||
| 11 | <% end %> | ||
| 12 | </p> | ||
| 13 | </div> | ||
| 14 | <div id="rrule_monthly_options" style="display: none;"> | ||
| 15 | <p><label><%= check_box_tag "rrule_monthly_ordinal" %> On a specific weekday each month</label></p> | ||
| 16 | <p id="rrule_ordinal_fields" style="display: none;"> | ||
| 17 | <%= select_tag "rrule_ordinal", options_for_select([["1.", 1], ["2.", 2], ["3.", 3], ["4.", 4], ["letzter", -1], ["vorletzter", -2], ["Selected weeks", "custom"]]) %> | ||
| 18 | <%= select_tag "rrule_ordinal_day", options_for_select(%w[MO TU WE TH FR SA SU].map { |c| [RruleHumanizer::WEEKDAY_NAMES[:de][c], c] }) %> | ||
| 19 | </p> | ||
| 20 | <p id="rrule_custom_ordinal_fields" style="display: none;"> | ||
| 21 | Weeks of the month: | ||
| 22 | <% (1..5).each do |ordinal| %> | ||
| 23 | <label><%= check_box_tag "rrule_custom_ordinal_#{ordinal}" %> <%= ordinal %>.</label> | ||
| 24 | <% end %> | ||
| 25 | </p> | ||
| 26 | </div> | ||
| 27 | <p> | ||
| 28 | <label><%= check_box_tag "rrule_exclude_month" %> Except in one month</label> | ||
| 29 | <%= select_tag "rrule_excluded_month", options_for_select((1..12).map { |m| [RruleHumanizer::MONTH_NAMES[:de][m-1], m] }), style: "display: none;" %> | ||
| 30 | </p> | ||
| 31 | <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> | ||
| 32 | </div> | ||
| 33 | <%= f.text_field :rrule, id: "event_rrule" %> | ||
