diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-01 00:24:10 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-01 00:24:10 +0200 |
| commit | 95955abaa339098755a214cfcadf87c90211fe64 (patch) | |
| tree | a3ad7a789e71b20c7c760dc1b09f3efcea3f0331 /app/views/nodes | |
| parent | 51629c5c42270a346885057a441095c964101cc1 (diff) | |
Add RRULE humanizer and wire events into nodes#showerdgeist-revive-events
- app/models/concerns/rrule_humanizer.rb: new concern included into
Event, renders recurring schedule as natural-language German or
English from RRULE string; handles WEEKLY/MONTHLY, biweekly
(INTERVAL=2), ordinal weekday positions (1TU, -1TH, -2WE),
BYMONTH single-month exclusions (December pause convention);
gracefully returns nil for COUNT/UNTIL/unrecognized shapes
- test/models/concerns/rrule_humanizer_test.rb: 15 tests covering
all distinct RRULE shapes found in production data
- app/helpers/nodes_helper.rb: add event_schedule_text helper
combining humanize_rrule with start_time formatting
- app/views/nodes/show.html.erb: add events row, conditionally
rendered when node has associated events
- config/locales/de.yml, en.yml: add event_schedule_time,
event_schedule_unrecognized, event_schedule_none keys
Diffstat (limited to 'app/views/nodes')
| -rw-r--r-- | app/views/nodes/show.html.erb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index de4d8a2..7223219 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb | |||
| @@ -42,6 +42,18 @@ | |||
| 42 | <td class="description">Tagged with:</td> | 42 | <td class="description">Tagged with:</td> |
| 43 | <td><%= @page.tag_list %></td> | 43 | <td><%= @page.tag_list %></td> |
| 44 | </tr> | 44 | </tr> |
| 45 | <% if @node.events.any? %> | ||
| 46 | <tr> | ||
| 47 | <td class="description">Events</td> | ||
| 48 | <td> | ||
| 49 | <ul> | ||
| 50 | <% @node.events.order(:start_time).each do |event| %> | ||
| 51 | <li><%= event_schedule_text(event) %><%= " (primary)" if event.is_primary? %></li> | ||
| 52 | <% end %> | ||
| 53 | </ul> | ||
| 54 | </td> | ||
| 55 | </tr> | ||
| 56 | <% end %> | ||
| 45 | <tr> | 57 | <tr> |
| 46 | <td class="description"><strong>Title</strong></td> | 58 | <td class="description"><strong>Title</strong></td> |
| 47 | <td><%= sanitize( @page.title ) %></td> | 59 | <td><%= sanitize( @page.title ) %></td> |
| @@ -59,4 +71,4 @@ | |||
| 59 | <td class="right"></td> | 71 | <td class="right"></td> |
| 60 | </tr> | 72 | </tr> |
| 61 | </table> | 73 | </table> |
| 62 | </div> \ No newline at end of file | 74 | </div> |
