Certain features can now be enabled/disabled from config

This commit is contained in:
Georg Gadinger 2017-03-31 22:21:19 +02:00
parent 3a663eeb09
commit 28cc6b5938
4 changed files with 14 additions and 4 deletions

View File

@ -22,6 +22,7 @@
%ul.nav.navbar-nav %ul.nav.navbar-nav
= nav_entry t('views.navigation.timeline'), root_path = nav_entry t('views.navigation.timeline'), root_path
= nav_entry t('views.navigation.inbox'), "/inbox", badge: inbox_count = nav_entry t('views.navigation.inbox'), "/inbox", badge: inbox_count
- if APP_CONFIG.dig(:features, :discover, :enabled)
= nav_entry t('views.navigation.discover'), discover_path = nav_entry t('views.navigation.discover'), discover_path
%ul.nav.navbar-nav.navbar-right %ul.nav.navbar-nav.navbar-right
- unless @user.nil? - unless @user.nil?

View File

@ -25,6 +25,7 @@
.panel.panel-default.hidden-xs .panel.panel-default.hidden-xs
.list-group .list-group
= list_group_item t('views.general.timeline'), root_path = list_group_item t('views.general.timeline'), root_path
- if APP_CONFIG.dig(:features, :public, :enabled)
= list_group_item t('views.general.public'), public_timeline_path = list_group_item t('views.general.public'), public_timeline_path
- current_user.groups.each do |group| - current_user.groups.each do |group|
= list_group_item group.display_name, group_timeline_path(group.name) = list_group_item group.display_name, group_timeline_path(group.name)

View File

@ -12,6 +12,14 @@ anonymous_name: "Anonymous"
# How many items (questions, answers, ...) do you want to show per page? # How many items (questions, answers, ...) do you want to show per page?
items_per_page: 10 items_per_page: 10
features:
# "Discover" page
discover:
enabled: true
# Public timeline
public:
enabled: true
# OAuth tokens # OAuth tokens
sharing: sharing:
twitter: twitter:

View File

@ -103,8 +103,8 @@ Rails.application.routes.draw do
match '/unsubscribe', to: 'subscription#unsubscribe', via: :post, as: :unsubscribe_answer match '/unsubscribe', to: 'subscription#unsubscribe', via: :post, as: :unsubscribe_answer
end end
match '/discover', to: 'discover#index', via: :get, as: :discover match '/discover', to: 'discover#index', via: :get, as: :discover if APP_CONFIG.dig(:features, :discover, :enabled)
match '/public', to: 'public#index', via: :get, as: :public_timeline match '/public', to: 'public#index', via: :get, as: :public_timeline if APP_CONFIG.dig(:features, :public, :enabled)
match '/group/:group_name', to: 'group#index', via: :get, as: :group_timeline match '/group/:group_name', to: 'group#index', via: :get, as: :group_timeline
match '/notifications(/:type)', to: 'notifications#index', via: :get, as: :notifications, defaults: {type: 'new'} match '/notifications(/:type)', to: 'notifications#index', via: :get, as: :notifications, defaults: {type: 'new'}