diff options
| -rw-r--r-- | app/controllers/events_controller.rb | 5 | ||||
| -rw-r--r-- | app/views/events/index.html.erb | 1 | ||||
| -rw-r--r-- | app/views/events/without_node.html.erb | 30 | ||||
| -rw-r--r-- | config/locales/de.yml | 4 | ||||
| -rw-r--r-- | config/locales/en.yml | 4 | ||||
| -rw-r--r-- | config/routes.rb | 50 |
6 files changed, 22 insertions, 72 deletions
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 818459c4..d581de16 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb | |||
| @@ -18,11 +18,6 @@ class EventsController < ApplicationController | |||
| 18 | end | 18 | end |
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | # GET /events/without_node | ||
| 22 | def without_node | ||
| 23 | @events = Event.where(node_id: nil).order(:start_time).paginate(page: params[:page], per_page: 25) | ||
| 24 | end | ||
| 25 | |||
| 26 | # GET /events/1 | 21 | # GET /events/1 |
| 27 | # GET /events/1.xml | 22 | # GET /events/1.xml |
| 28 | def show | 23 | def show |
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index d07d6f82..a2710c2a 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | <%= link_to new_event_path, class: 'action_button' do %> | 4 | <%= link_to new_event_path, class: 'action_button' do %> |
| 5 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_event") %> | 5 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_event") %> |
| 6 | <% end %> | 6 | <% end %> |
| 7 | <%= link_to t(".without_page_link"), without_node_events_path %> | ||
| 8 | </div> | 7 | </div> |
| 9 | 8 | ||
| 10 | <%= will_paginate @events %> | 9 | <%= will_paginate @events %> |
diff --git a/app/views/events/without_node.html.erb b/app/views/events/without_node.html.erb deleted file mode 100644 index e59eedc7..00000000 --- a/app/views/events/without_node.html.erb +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | ||
| 2 | |||
| 3 | <%= link_to t(".all_events_link"), events_path %> | ||
| 4 | <%= link_to new_event_path, class: 'action_button' do %> | ||
| 5 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t("events.index.create_event") %> | ||
| 6 | <% end %> | ||
| 7 | |||
| 8 | <%= will_paginate @events %> | ||
| 9 | |||
| 10 | <table class="events_table"> | ||
| 11 | <tr class="header"> | ||
| 12 | <th><%= t("admin.columns.title") %></th> | ||
| 13 | <th><%= Event.human_attribute_name(:start_time) %></th> | ||
| 14 | <th><%= Event.human_attribute_name(:end_time) %></th> | ||
| 15 | <th><%= Event.human_attribute_name(:allday) %></th> | ||
| 16 | <th><%= Event.human_attribute_name(:url) %></th> | ||
| 17 | <th></th> | ||
| 18 | </tr> | ||
| 19 | |||
| 20 | <% @events.each do |event| %> | ||
| 21 | <tr> | ||
| 22 | <td><%= link_to event.display_title, event %></td> | ||
| 23 | <td><%= admin_datetime(event.start_time) %></td> | ||
| 24 | <td><%= admin_datetime(event.end_time) %></td> | ||
| 25 | <td><%= t("admin.common.#{event.allday ? "yes" : "no"}") %></td> | ||
| 26 | <td><%=h event.url %></td> | ||
| 27 | <td class="url_cell"><span class="truncate"><%= external_url_link(event.url) %></span></td> | ||
| 28 | </tr> | ||
| 29 | <% end %> | ||
| 30 | </table> | ||
diff --git a/config/locales/de.yml b/config/locales/de.yml index 9428c4be..2139e0da 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml | |||
| @@ -574,7 +574,6 @@ de: | |||
| 574 | index: | 574 | index: |
| 575 | title: "Termine" | 575 | title: "Termine" |
| 576 | create_event: "Termin anlegen" | 576 | create_event: "Termin anlegen" |
| 577 | without_page_link: "Termine ohne Seite anzeigen →" | ||
| 578 | edit_link: "bearbeiten" | 577 | edit_link: "bearbeiten" |
| 579 | show: | 578 | show: |
| 580 | title: "Termin" | 579 | title: "Termin" |
| @@ -585,9 +584,6 @@ de: | |||
| 585 | title: "Termin bearbeiten" | 584 | title: "Termin bearbeiten" |
| 586 | change_node: "Node ändern" | 585 | change_node: "Node ändern" |
| 587 | change_node_hint: "Verknüpft den Termin mit einem anderen Node (selten nötig)." | 586 | change_node_hint: "Verknüpft den Termin mit einem anderen Node (selten nötig)." |
| 588 | without_node: | ||
| 589 | title: "Termine ohne Node" | ||
| 590 | all_events_link: "← Alle Termine" | ||
| 591 | form: | 587 | form: |
| 592 | node_hint: "Optional — Node suchen und auswählen, um diesen Termin mit einer Seite zu verknüpfen." | 588 | node_hint: "Optional — Node suchen und auswählen, um diesen Termin mit einer Seite zu verknüpfen." |
| 593 | recurrence: "Wiederholung" | 589 | recurrence: "Wiederholung" |
diff --git a/config/locales/en.yml b/config/locales/en.yml index dcf4275d..b4d6e4ae 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml | |||
| @@ -521,15 +521,11 @@ en: | |||
| 521 | index: | 521 | index: |
| 522 | title: "Events" | 522 | title: "Events" |
| 523 | create_event: "Create event" | 523 | create_event: "Create event" |
| 524 | without_page_link: "View events without a page →" | ||
| 525 | edit_link: "edit" | 524 | edit_link: "edit" |
| 526 | edit: | 525 | edit: |
| 527 | title: "Editing event" | 526 | title: "Editing event" |
| 528 | change_node: "Change node" | 527 | change_node: "Change node" |
| 529 | change_node_hint: "This will re-link the event to a different node — rarely needed." | 528 | change_node_hint: "This will re-link the event to a different node — rarely needed." |
| 530 | without_node: | ||
| 531 | title: "Events without a node" | ||
| 532 | all_events_link: "← All events" | ||
| 533 | show: | 529 | show: |
| 534 | title: "Event" | 530 | title: "Event" |
| 535 | title_for_node: "Event for node %{path}" | 531 | title_for_node: "Event for node %{path}" |
diff --git a/config/routes.rb b/config/routes.rb index d19ac25b..fe38d6d7 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -21,20 +21,13 @@ Cccms::Application.routes.draw do | |||
| 21 | # Adding a new locale requires updating all three locations. | 21 | # Adding a new locale requires updating all three locations. |
| 22 | scope '(:locale)', locale: /de|en/ do | 22 | scope '(:locale)', locale: /de|en/ do |
| 23 | 23 | ||
| 24 | resources :tags | 24 | get 'pages/:id/preview', to: 'pages#preview', as: :preview_page |
| 25 | 25 | get 'preview/:token', to: 'shared_previews#show', as: :shared_preview | |
| 26 | resources :events do | ||
| 27 | collection do | ||
| 28 | get :without_node | ||
| 29 | end | ||
| 30 | end | ||
| 31 | |||
| 32 | get 'pages/:id/preview', to: 'pages#preview', as: :preview_page | ||
| 33 | |||
| 34 | get 'preview/:token', to: 'shared_previews#show', as: :shared_preview | ||
| 35 | 26 | ||
| 36 | scope '/admin' do | 27 | scope '/admin' do |
| 28 | resources :events | ||
| 37 | resources :assets | 29 | resources :assets |
| 30 | resources :tags | ||
| 38 | 31 | ||
| 39 | resources :nodes do | 32 | resources :nodes do |
| 40 | collection do | 33 | collection do |
| @@ -84,6 +77,24 @@ Cccms::Application.routes.draw do | |||
| 84 | end | 77 | end |
| 85 | end | 78 | end |
| 86 | 79 | ||
| 80 | resources :menu_items, :except => :show do | ||
| 81 | member do | ||
| 82 | post :sort | ||
| 83 | post :move_up | ||
| 84 | post :move_down | ||
| 85 | end | ||
| 86 | end | ||
| 87 | |||
| 88 | resources :users, :except => :destroy do | ||
| 89 | member do | ||
| 90 | put :reset_otp | ||
| 91 | put :deactivate | ||
| 92 | put :reactivate | ||
| 93 | put :grant_redaktion | ||
| 94 | put :revoke_redaktion | ||
| 95 | end | ||
| 96 | end | ||
| 97 | |||
| 87 | match '' => 'admin#index', :as => :admin, :via => :get | 98 | match '' => 'admin#index', :as => :admin, :via => :get |
| 88 | match 'search' => 'admin#search', :as => :admin_search, :via => :get | 99 | match 'search' => 'admin#search', :as => :admin_search, :via => :get |
| 89 | match 'menu_search' => 'admin#menu_search', :as => :admin_menu_search, :via => :get | 100 | match 'menu_search' => 'admin#menu_search', :as => :admin_menu_search, :via => :get |
| @@ -97,29 +108,12 @@ Cccms::Application.routes.draw do | |||
| 97 | match '/login' => 'sessions#new', :as => :login, :via => :get | 108 | match '/login' => 'sessions#new', :as => :login, :via => :get |
| 98 | match 'search' => 'search#index', :as => :search, :via => :get | 109 | match 'search' => 'search#index', :as => :search, :via => :get |
| 99 | 110 | ||
| 100 | resources :users, :except => :destroy do | ||
| 101 | member do | ||
| 102 | put :reset_otp | ||
| 103 | put :deactivate | ||
| 104 | put :reactivate | ||
| 105 | put :grant_redaktion | ||
| 106 | put :revoke_redaktion | ||
| 107 | end | ||
| 108 | end | ||
| 109 | resource :otp_enrollment, :only => [:show, :create, :update, :destroy] | 111 | resource :otp_enrollment, :only => [:show, :create, :update, :destroy] |
| 110 | resource :otp_challenge, :only => [:new, :create] | 112 | resource :otp_challenge, :only => [:new, :create] |
| 111 | resource :elevation, :only => [:new, :create, :destroy] do | 113 | resource :elevation, :only => [:new, :create, :destroy] do |
| 112 | post :renew | 114 | post :renew |
| 113 | end | 115 | end |
| 114 | 116 | ||
| 115 | resources :menu_items, :except => :show do | ||
| 116 | member do | ||
| 117 | post :sort | ||
| 118 | post :move_up | ||
| 119 | post :move_down | ||
| 120 | end | ||
| 121 | end | ||
| 122 | |||
| 123 | resource :session | 117 | resource :session |
| 124 | 118 | ||
| 125 | get 'rss/updates', :to => 'rss#updates', :as => :rss, :defaults => { :format => :xml } | 119 | get 'rss/updates', :to => 'rss#updates', :as => :rss, :defaults => { :format => :xml } |
