diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-30 03:55:42 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-30 19:22:24 +0200 |
| commit | 51629c5c42270a346885057a441095c964101cc1 (patch) | |
| tree | c2eaf148feb443ef51b20d3147fc9e368239ab12 /app/views | |
| parent | 4705ef970469a852c7bdb4c097ba748e972c8f63 (diff) | |
Fix events CRUD for standalone events and add events to admin menu
- event_params now permits title, description, is_primary
- event_information helper lists all node.events, not just the first
- Occurrence.generate handles nil node (standalone events)
- Page.aggregate order_by title uses correlated subquery to avoid
GROUP BY conflict with tag-filter path; order_direction whitelisted
to ASC/DESC to prevent SQL injection
- Events link added to admin menu bar
- events/index shows title, is_primary; drops latitude/longitude columns
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/admin/_menu.html.erb | 1 | ||||
| -rw-r--r-- | app/views/events/index.html.erb | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 6dba085..c87c5f7 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb | |||
| @@ -4,5 +4,6 @@ | |||
| 4 | <a href="#" onclick="admin_search.display_toggle(); return false;">search</a> | 4 | <a href="#" onclick="admin_search.display_toggle(); return false;">search</a> |
| 5 | <%= link_to 'Nodes', nodes_path, selected?('nodes') %> | 5 | <%= link_to 'Nodes', nodes_path, selected?('nodes') %> |
| 6 | <%= link_to 'Assets', assets_path, selected?('assets') %> | 6 | <%= link_to 'Assets', assets_path, selected?('assets') %> |
| 7 | <%= link_to 'Events', events_path, selected?('events') %> | ||
| 7 | <%= link_to 'User', users_path, selected?('users') %> | 8 | <%= link_to 'User', users_path, selected?('users') %> |
| 8 | <%= link_to 'Navigation', menu_items_path, selected?('menu_items') %> > | 9 | <%= link_to 'Navigation', menu_items_path, selected?('menu_items') %> > |
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 19b21ce..064fa86 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb | |||
| @@ -2,27 +2,27 @@ | |||
| 2 | 2 | ||
| 3 | <table> | 3 | <table> |
| 4 | <tr> | 4 | <tr> |
| 5 | <th>Title</th> | ||
| 6 | <th>Is primary</th> | ||
| 5 | <th>Start time</th> | 7 | <th>Start time</th> |
| 6 | <th>End time</th> | 8 | <th>End time</th> |
| 7 | <th>Rrule</th> | 9 | <th>Rrule</th> |
| 8 | <th>Custom rrule</th> | 10 | <th>Custom rrule</th> |
| 9 | <th>Allday</th> | 11 | <th>Allday</th> |
| 10 | <th>Url</th> | 12 | <th>Url</th> |
| 11 | <th>Latitude</th> | ||
| 12 | <th>Longitude</th> | ||
| 13 | <th>Node</th> | 13 | <th>Node</th> |
| 14 | </tr> | 14 | </tr> |
| 15 | 15 | ||
| 16 | <% @events.each do |event| %> | 16 | <% @events.each do |event| %> |
| 17 | <tr> | 17 | <tr> |
| 18 | <td><%=h event.display_title %></td> | ||
| 19 | <td><%=h event.is_primary %></td> | ||
| 18 | <td><%=h event.start_time %></td> | 20 | <td><%=h event.start_time %></td> |
| 19 | <td><%=h event.end_time %></td> | 21 | <td><%=h event.end_time %></td> |
| 20 | <td><%=h event.rrule %></td> | 22 | <td><%=h event.rrule %></td> |
| 21 | <td><%=h event.custom_rrule %></td> | 23 | <td><%=h event.custom_rrule %></td> |
| 22 | <td><%=h event.allday %></td> | 24 | <td><%=h event.allday %></td> |
| 23 | <td><%=h event.url %></td> | 25 | <td><%=h event.url %></td> |
| 24 | <td><%=h event.latitude %></td> | ||
| 25 | <td><%=h event.longitude %></td> | ||
| 26 | <td><%=h event.node_id %></td> | 26 | <td><%=h event.node_id %></td> |
| 27 | <td><%= link_to 'Show', event %></td> | 27 | <td><%= link_to 'Show', event %></td> |
| 28 | <td><%= link_to 'Edit', edit_event_path(event) %></td> | 28 | <td><%= link_to 'Edit', edit_event_path(event) %></td> |
