diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-09 18:54:39 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-09 18:54:39 +0200 |
| commit | 7b57d898da07811bb35ec088cb12505783a55214 (patch) | |
| tree | f89b6806c7fc1e37e5e7fbae462dc49a39e095a8 | |
| parent | 400f104320aeb551eddc6ed5608460992a3d23ca (diff) | |
Add an events view for events without node
| -rw-r--r-- | app/views/events/without_node.html.erb | 28 | ||||
| -rw-r--r-- | config/routes.rb | 7 |
2 files changed, 34 insertions, 1 deletions
diff --git a/app/views/events/without_node.html.erb b/app/views/events/without_node.html.erb new file mode 100644 index 0000000..52514ab --- /dev/null +++ b/app/views/events/without_node.html.erb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <h1>Events without a node</h1> | ||
| 2 | |||
| 3 | <%= link_to '← All events', events_path %> | ||
| 4 | <%= link_to 'New event', new_event_path, class: 'action_button' %> | ||
| 5 | |||
| 6 | <%= will_paginate @events %> | ||
| 7 | |||
| 8 | <table class="events_table"> | ||
| 9 | <tr class="header"> | ||
| 10 | <th>Title</th> | ||
| 11 | <th>Start time</th> | ||
| 12 | <th>End time</th> | ||
| 13 | <th>Allday</th> | ||
| 14 | <th>Url</th> | ||
| 15 | <th></th> | ||
| 16 | </tr> | ||
| 17 | |||
| 18 | <% @events.each do |event| %> | ||
| 19 | <tr> | ||
| 20 | <td><%= link_to event.display_title, event %></td> | ||
| 21 | <td><%=h event.start_time %></td> | ||
| 22 | <td><%=h event.end_time %></td> | ||
| 23 | <td><%=h event.allday %></td> | ||
| 24 | <td><%=h event.url %></td> | ||
| 25 | <td><%= link_to 'edit', edit_event_path(event) %></td> | ||
| 26 | </tr> | ||
| 27 | <% end %> | ||
| 28 | </table> | ||
diff --git a/config/routes.rb b/config/routes.rb index 5d68828..c0aef2f 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -20,7 +20,12 @@ Cccms::Application.routes.draw do | |||
| 20 | scope '(:locale)', locale: /de|en/ do | 20 | scope '(:locale)', locale: /de|en/ do |
| 21 | 21 | ||
| 22 | resources :tags | 22 | resources :tags |
| 23 | resources :events | 23 | |
| 24 | resources :events do | ||
| 25 | collection do | ||
| 26 | get :without_node | ||
| 27 | end | ||
| 28 | end | ||
| 24 | 29 | ||
| 25 | get 'pages/:id/preview', to: 'pages#preview', as: :preview_page | 30 | get 'pages/:id/preview', to: 'pages#preview', as: :preview_page |
| 26 | put 'pages/:id/sort_images', to: 'pages#sort_images', as: :sort_images_page | 31 | put 'pages/:id/sort_images', to: 'pages#sort_images', as: :sort_images_page |
