Migrate from ledermann/rails-settings to rails-settings-cached which allows global settings

with YAML-defined defaults. Add admin page for editing global settings. Add "site_description"
setting that would show as a paragraph on the frontpage
This commit is contained in:
Eugen Rochko 2017-01-12 20:46:24 +01:00
parent babc6a1528
commit b11fdc3ae3
20 changed files with 188 additions and 34 deletions

View file

@ -7,5 +7,6 @@ SimpleNavigation::Configuration.run do |navigation|
primary.item :domain_blocks, safe_join([fa_icon('lock fw'), 'Domain Blocks']), admin_domain_blocks_url
primary.item :sidekiq, safe_join([fa_icon('diamond fw'), 'Sidekiq']), sidekiq_url
primary.item :pghero, safe_join([fa_icon('database fw'), 'PgHero']), pghero_url
primary.item :settings, safe_join([fa_icon('cogs fw'), 'Site Settings']), admin_settings_url
end
end

View file

@ -58,6 +58,7 @@ Rails.application.routes.draw do
namespace :admin do
resources :pubsubhubbub, only: [:index]
resources :domain_blocks, only: [:index, :create]
resources :settings, only: [:index, :update]
resources :accounts, only: [:index, :show, :update] do
member do

23
config/settings.yml Normal file
View file

@ -0,0 +1,23 @@
# config/app.yml for rails-settings-cached
defaults: &defaults
site_description: ''
site_contact_username: ''
site_contact_email: ''
notification_emails:
follow: false
reblog: false
favourite: false
mention: false
follow_request: true
interactions:
must_be_follower: false
must_be_following: false
development:
<<: *defaults
test:
<<: *defaults
production:
<<: *defaults