diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-10 18:07:15 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-10 18:07:15 +0200 |
| commit | c9401e45433ea45b46f9a8faf1e7e537e4683244 (patch) | |
| tree | c2fabb1942a257f64b4be0c3ab5a5d5bff717d25 /app/views | |
| parent | ed9e846d1d85fa326389982e16bbc8799f2001c0 (diff) | |
Fix rrule/url column overflow on events#index
Long RRULEs previously overflowed their column with no wrap point;
now escaped and rendered with a <wbr> after each semicolon, so a
long rule wraps at a clause boundary instead of running off the
table. Deliberately not truncated -- a cut-off RRULE's trailing
clause (BYDAY, BYMONTH, etc.) is usually the most specific part.
The url column is now a real link, truncated with an ellipsis at a
fixed width -- deliberately no tooltip, since hovering a real link
already shows the full address in the browser's own status bar.
rrule_with_break_opportunities splits on the raw string's own
semicolons before escaping each piece, not after -- escaping first
and searching the result for semicolons also matches the ones inside
</> entities, corrupting anything containing a literal < or >.
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/events/index.html.erb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 8127e3a..3d953d5 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb | |||
| @@ -22,9 +22,13 @@ | |||
| 22 | <td><%= link_to event.display_title, event %></td> | 22 | <td><%= link_to event.display_title, event %></td> |
| 23 | <td><%=h event.start_time %></td> | 23 | <td><%=h event.start_time %></td> |
| 24 | <td><%=h event.end_time %></td> | 24 | <td><%=h event.end_time %></td> |
| 25 | <td><%=h event.rrule %></td> | 25 | <td class="rrule_cell"><span class="rrule_text"><%= rrule_with_break_opportunities(event.rrule) %></span></td> |
| 26 | <td><%=h event.allday %></td> | 26 | <td><%=h event.allday %></td> |
| 27 | <td><%=h event.url %></td> | 27 | <td class="url_cell"> |
| 28 | <% if event.url.present? %> | ||
| 29 | <span class="truncate"><%= link_to event.url, event.url %></span> | ||
| 30 | <% end %> | ||
| 31 | </td> | ||
| 28 | <td><%= event.node ? link_to(event.node_id, node_path(event.node)) : '' %></td> | 32 | <td><%= event.node ? link_to(event.node_id, node_path(event.node)) : '' %></td> |
| 29 | <td><%= link_to 'edit', edit_event_path(event) %></td> | 33 | <td><%= link_to 'edit', edit_event_path(event) %></td> |
| 30 | </tr> | 34 | </tr> |
