diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/application.rb | 1 | ||||
| -rw-r--r-- | config/environments/test.rb | 2 | ||||
| -rw-r--r-- | config/initializers/ensure_search_vector_trigger.rb | 7 | ||||
| -rw-r--r-- | config/initializers/rails_icons.rb | 16 | ||||
| -rw-r--r-- | config/locales/de.yml | 84 | ||||
| -rw-r--r-- | config/locales/en.yml | 20 | ||||
| -rw-r--r-- | config/routes.rb | 75 |
7 files changed, 120 insertions, 85 deletions
diff --git a/config/application.rb b/config/application.rb index 0be3396..5ec3e8f 100644 --- a/config/application.rb +++ b/config/application.rb | |||
| @@ -17,6 +17,7 @@ module Cccms | |||
| 17 | config.time_zone = 'Berlin' | 17 | config.time_zone = 'Berlin' |
| 18 | 18 | ||
| 19 | config.i18n.default_locale = :de | 19 | config.i18n.default_locale = :de |
| 20 | config.i18n.available_locales = [:de, :en] | ||
| 20 | config.i18n.fallbacks = { en: [:en, :de] } | 21 | config.i18n.fallbacks = { en: [:en, :de] } |
| 21 | 22 | ||
| 22 | config.filter_parameters += [:password, :password_confirmation] | 23 | config.filter_parameters += [:password, :password_confirmation] |
diff --git a/config/environments/test.rb b/config/environments/test.rb index bb89065..08fcefa 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb | |||
| @@ -42,6 +42,8 @@ Rails.application.configure do | |||
| 42 | # Print deprecation notices to the stderr. | 42 | # Print deprecation notices to the stderr. |
| 43 | config.active_support.deprecation = :stderr | 43 | config.active_support.deprecation = :stderr |
| 44 | 44 | ||
| 45 | config.active_record.verify_foreign_keys_for_fixtures = false | ||
| 46 | |||
| 45 | # Raises error for missing translations. | 47 | # Raises error for missing translations. |
| 46 | # config.i18n.raise_on_missing_translations = true | 48 | # config.i18n.raise_on_missing_translations = true |
| 47 | 49 | ||
diff --git a/config/initializers/ensure_search_vector_trigger.rb b/config/initializers/ensure_search_vector_trigger.rb new file mode 100644 index 0000000..a750e9c --- /dev/null +++ b/config/initializers/ensure_search_vector_trigger.rb | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | Rails.application.config.after_initialize do | ||
| 2 | begin | ||
| 3 | Page.ensure_search_vector_trigger! if Page.connection.table_exists?(:page_translations) | ||
| 4 | rescue ActiveRecord::NoDatabaseError, ActiveRecord::ConnectionNotEstablished, PG::ConnectionBad | ||
| 5 | # Database doesn't exist yet -- e.g. mid `rails db:create`. Nothing to install yet. | ||
| 6 | end | ||
| 7 | end | ||
diff --git a/config/initializers/rails_icons.rb b/config/initializers/rails_icons.rb new file mode 100644 index 0000000..1503db7 --- /dev/null +++ b/config/initializers/rails_icons.rb | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | RailsIcons.configure do |config| | ||
| 2 | config.default_library = "tabler" | ||
| 3 | config.default_variant = "outline" # Set a default variant for all libraries | ||
| 4 | |||
| 5 | # Override Tabler defaults | ||
| 6 | # config.libraries.tabler.default_variant = "" # Set a default variant for Tabler | ||
| 7 | # config.libraries.tabler.exclude_variants = [] # Exclude specific variants | ||
| 8 | |||
| 9 | # config.libraries.tabler.regular.default.css = "size-6" | ||
| 10 | # config.libraries.tabler.solid.default.css = "size-6" | ||
| 11 | # config.libraries.tabler.solid.default.data = {} | ||
| 12 | |||
| 13 | # config.libraries.tabler.outline.default.css = "size-6" | ||
| 14 | # config.libraries.tabler.outline.default.stroke_width = "2" | ||
| 15 | # config.libraries.tabler.outline.default.data = {} | ||
| 16 | end | ||
diff --git a/config/locales/de.yml b/config/locales/de.yml index 5f77d79..550ccb3 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml | |||
| @@ -7,6 +7,17 @@ de: | |||
| 7 | sponsors: Sponsoren | 7 | sponsors: Sponsoren |
| 8 | show_tag_headline: "Seiten mit dem Tag:" | 8 | show_tag_headline: "Seiten mit dem Tag:" |
| 9 | old_ccc_de: das alte ccc.de | 9 | old_ccc_de: das alte ccc.de |
| 10 | event_schedule_time: "um %{time} Uhr" | ||
| 11 | event_schedule_unrecognized: "Termin-Regel nicht automatisch lesbar" | ||
| 12 | event_schedule_none: "Kein Termin" | ||
| 13 | open_days: "Offene Tage" | ||
| 14 | open_days_label: "Offene Tage" | ||
| 15 | upcoming_events: "Weitere Termine" | ||
| 16 | open_today: "Das Chaos, lokal und heute offen" | ||
| 17 | published: "veröffentlicht" | ||
| 18 | published_by: "veröffentlicht durch %{editor}" | ||
| 19 | editor_self: "du" | ||
| 20 | publisher_self: "dich" | ||
| 10 | date: | 21 | date: |
| 11 | formats: | 22 | formats: |
| 12 | default: "%d.%m.%Y" | 23 | default: "%d.%m.%Y" |
| @@ -22,7 +33,6 @@ de: | |||
| 22 | - :day | 33 | - :day |
| 23 | - :month | 34 | - :month |
| 24 | - :year | 35 | - :year |
| 25 | |||
| 26 | time: | 36 | time: |
| 27 | formats: | 37 | formats: |
| 28 | default: "%A, %e. %B %Y, %H:%M Uhr" | 38 | default: "%A, %e. %B %Y, %H:%M Uhr" |
| @@ -34,42 +44,6 @@ de: | |||
| 34 | am: "vormittags" | 44 | am: "vormittags" |
| 35 | pm: "nachmittags" | 45 | pm: "nachmittags" |
| 36 | 46 | ||
| 37 | datetime: | ||
| 38 | distance_in_words: | ||
| 39 | half_a_minute: 'eine halbe Minute' | ||
| 40 | less_than_x_seconds: | ||
| 41 | zero: 'weniger als 1 Sekunde' | ||
| 42 | one: 'weniger als 1 Sekunde' | ||
| 43 | other: 'weniger als {{count}} Sekunden' | ||
| 44 | x_seconds: | ||
| 45 | one: '1 Sekunde' | ||
| 46 | other: '{{count}} Sekunden' | ||
| 47 | less_than_x_minutes: | ||
| 48 | zero: 'weniger als 1 Minute' | ||
| 49 | one: 'weniger als eine Minute' | ||
| 50 | other: 'weniger als {{count}} Minuten' | ||
| 51 | x_minutes: | ||
| 52 | one: '1 Minute' | ||
| 53 | other: '{{count}} Minuten' | ||
| 54 | about_x_hours: | ||
| 55 | one: 'etwa 1 Stunde' | ||
| 56 | other: 'etwa {{count}} Stunden' | ||
| 57 | x_days: | ||
| 58 | one: '1 Tag' | ||
| 59 | other: '{{count}} Tage' | ||
| 60 | about_x_months: | ||
| 61 | one: 'etwa 1 Monat' | ||
| 62 | other: 'etwa {{count}} Monate' | ||
| 63 | x_months: | ||
| 64 | one: '1 Monat' | ||
| 65 | other: '{{count}} Monate' | ||
| 66 | about_x_years: | ||
| 67 | one: 'etwa 1 Jahr' | ||
| 68 | other: 'etwa {{count}} Jahre' | ||
| 69 | over_x_years: | ||
| 70 | one: 'mehr als 1 Jahr' | ||
| 71 | other: 'mehr als {{count}} Jahre' | ||
| 72 | |||
| 73 | number: | 47 | number: |
| 74 | format: | 48 | format: |
| 75 | precision: 2 | 49 | precision: 2 |
| @@ -98,31 +72,11 @@ de: | |||
| 98 | sentence_connector: "und" | 72 | sentence_connector: "und" |
| 99 | skip_last_comma: true | 73 | skip_last_comma: true |
| 100 | 74 | ||
| 101 | activerecord: | 75 | will_paginate: |
| 102 | errors: | 76 | previous_label: "← Zurück" |
| 103 | template: | 77 | previous_aria_label: "Vorherige Seite" |
| 104 | header: | 78 | next_label: "Weiter →" |
| 105 | one: 1 error prohibited this {{model}} from being saved | 79 | next_aria_label: "Nächste Seite" |
| 106 | other: "{{count}} errors prohibited this {{model}} from being saved" | 80 | page_gap: "…" |
| 107 | body: "There were problems with the following fields:" | 81 | container_aria_label: "Seitennavigation" |
| 108 | 82 | page_aria_label: "Seite %{page}" | |
| 109 | messages: | ||
| 110 | inclusion: "is not included in the list" | ||
| 111 | exclusion: "is reserved" | ||
| 112 | invalid: "is invalid" | ||
| 113 | confirmation: "doesn't match confirmation" | ||
| 114 | accepted: "must be accepted" | ||
| 115 | empty: "can't be empty" | ||
| 116 | blank: "can't be blank" | ||
| 117 | too_long: "is too long (maximum is {{count}} characters)" | ||
| 118 | too_short: "is too short (minimum is {{count}} characters)" | ||
| 119 | wrong_length: "is the wrong length (should be {{count}} characters)" | ||
| 120 | taken: "has already been taken" | ||
| 121 | not_a_number: "is not a number" | ||
| 122 | greater_than: "must be greater than {{count}}" | ||
| 123 | greater_than_or_equal_to: "must be greater than or equal to {{count}}" | ||
| 124 | equal_to: "must be equal to {{count}}" | ||
| 125 | less_than: "must be less than {{count}}" | ||
| 126 | less_than_or_equal_to: "must be less than or equal to {{count}}" | ||
| 127 | odd: "must be odd" | ||
| 128 | even: "must be even" | ||
diff --git a/config/locales/en.yml b/config/locales/en.yml index 2458d4d..73271ed 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml | |||
| @@ -8,7 +8,27 @@ en: | |||
| 8 | hello: "Hello world" | 8 | hello: "Hello world" |
| 9 | show_tag_headline: "Pages tagged with:" | 9 | show_tag_headline: "Pages tagged with:" |
| 10 | old_ccc_de: the old ccc.de | 10 | old_ccc_de: the old ccc.de |
| 11 | event_schedule_time: "at %{time}" | ||
| 12 | event_schedule_unrecognized: "Schedule not automatically readable" | ||
| 13 | event_schedule_none: "No schedule" | ||
| 14 | open_days: "Open days" | ||
| 15 | open_days_label: "Open days" | ||
| 16 | upcoming_events: "Upcoming events" | ||
| 17 | open_today: "Open today" | ||
| 18 | published: "published" | ||
| 19 | published_by: "published by %{editor}" | ||
| 20 | publisher_self: "you" | ||
| 21 | editor_self: "you" | ||
| 11 | 22 | ||
| 12 | time: | 23 | time: |
| 13 | formats: | 24 | formats: |
| 14 | ccc: "%d %B, %Y %H:%M" | 25 | ccc: "%d %B, %Y %H:%M" |
| 26 | |||
| 27 | will_paginate: | ||
| 28 | previous_label: "← Previous" | ||
| 29 | previous_aria_label: "Previous page" | ||
| 30 | next_label: "Next →" | ||
| 31 | next_aria_label: "Next page" | ||
| 32 | page_gap: "…" | ||
| 33 | container_aria_label: "Pagination" | ||
| 34 | page_aria_label: "Page %{page}" | ||
diff --git a/config/routes.rb b/config/routes.rb index a7775b3..826bb18 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -20,41 +20,76 @@ 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 :occurrences | ||
| 24 | resources :events | ||
| 25 | 23 | ||
| 26 | resources :pages do | 24 | resources :events do |
| 27 | member do | 25 | collection do |
| 28 | get :preview | 26 | get :without_node |
| 29 | put :sort_images | ||
| 30 | end | 27 | end |
| 31 | end | 28 | end |
| 32 | 29 | ||
| 33 | resources :nodes do | 30 | get 'pages/:id/preview', to: 'pages#preview', as: :preview_page |
| 34 | member do | 31 | put 'pages/:id/sort_images', to: 'pages#sort_images', as: :sort_images_page |
| 35 | put :unlock | ||
| 36 | put :publish | ||
| 37 | end | ||
| 38 | 32 | ||
| 39 | resources :revisions do | 33 | get 'preview/:token', to: 'shared_previews#show', as: :shared_preview |
| 34 | |||
| 35 | scope '/admin' do | ||
| 36 | resources :assets | ||
| 37 | |||
| 38 | resources :nodes do | ||
| 40 | collection do | 39 | collection do |
| 41 | post :diff | 40 | get 'tags/:tags', action: :tags, as: :tags, constraints: { tags: /[^\/]+/ } |
| 41 | get :parameterize_preview | ||
| 42 | get :drafts | ||
| 43 | get :recent | ||
| 44 | get :mine | ||
| 45 | get :chapters | ||
| 46 | get :sitemap | ||
| 42 | end | 47 | end |
| 48 | |||
| 43 | member do | 49 | member do |
| 44 | put :restore | 50 | put :unlock |
| 51 | put :publish | ||
| 52 | put :generate_shared_preview | ||
| 53 | put :revoke_shared_preview | ||
| 54 | put :autosave | ||
| 55 | put :revert | ||
| 56 | end | ||
| 57 | |||
| 58 | resources :translations, controller: 'page_translations', | ||
| 59 | param: :translation_locale, | ||
| 60 | constraints: { translation_locale: /en/ }, | ||
| 61 | only: [:index, :show, :edit, :update, :destroy] do | ||
| 62 | member do | ||
| 63 | put :autosave | ||
| 64 | end | ||
| 65 | end | ||
| 66 | |||
| 67 | resources :related_assets, only: [:create, :destroy, :update] do | ||
| 68 | collection do | ||
| 69 | get :search | ||
| 70 | end | ||
| 71 | end | ||
| 72 | |||
| 73 | resources :revisions do | ||
| 74 | collection do | ||
| 75 | post :diff | ||
| 76 | get :diff | ||
| 77 | end | ||
| 78 | member do | ||
| 79 | put :restore | ||
| 80 | end | ||
| 45 | end | 81 | end |
| 46 | end | 82 | end |
| 47 | end | ||
| 48 | 83 | ||
| 49 | scope '/admin' do | 84 | match '' => 'admin#index', :as => :admin, :via => :get |
| 50 | resources :assets | 85 | match 'search' => 'admin#search', :as => :admin_search, :via => :get |
| 86 | match 'menu_search' => 'admin#menu_search', :as => :admin_menu_search, :via => :get | ||
| 87 | match 'conventions' => 'admin#conventions', :as => :admin_conventions, :via => :get | ||
| 88 | match 'dashboard_search' => 'admin#dashboard_search', :as => :admin_dashboard_search, :via => :get | ||
| 51 | end | 89 | end |
| 52 | 90 | ||
| 53 | match '/logout' => 'sessions#destroy', :as => :logout, :via => :delete | 91 | match '/logout' => 'sessions#destroy', :as => :logout, :via => :delete |
| 54 | match '/login' => 'sessions#new', :as => :login, :via => :get | 92 | match '/login' => 'sessions#new', :as => :login, :via => :get |
| 55 | match 'admin' => 'admin#index', :as => :admin, :via => :get | ||
| 56 | match 'admin/search' => 'admin#search', :as => :admin_search, :via => :get | ||
| 57 | match 'admin/menu_search' => 'admin#menu_search', :as => :admin_menu_search, :via => :get | ||
| 58 | match 'search' => 'search#index', :as => :search, :via => :get | 93 | match 'search' => 'search#index', :as => :search, :via => :get |
| 59 | 94 | ||
| 60 | resources :users | 95 | resources :users |
