# HG changeset patch # User neko259 # Date 2016-11-01 16:21:10 # Node ID 8a821ff81f908263a7078c7c5d397ce16a7fd84d # Parent f27d6e7b442282ea0964c79718f95f0949da767b Switch to show only favorite tags (BB-94) diff --git a/boards/abstracts/settingsmanager.py b/boards/abstracts/settingsmanager.py --- a/boards/abstracts/settingsmanager.py +++ b/boards/abstracts/settingsmanager.py @@ -21,6 +21,7 @@ SETTING_LAST_NOTIFICATION_ID = 'last_not SETTING_IMAGE_VIEWER = 'image_viewer' SETTING_TRIPCODE = 'tripcode' SETTING_IMAGES = 'images_aliases' +SETTING_ONLY_FAVORITES = 'only_favorites' DEFAULT_THEME = 'md' diff --git a/boards/context_processors.py b/boards/context_processors.py --- a/boards/context_processors.py +++ b/boards/context_processors.py @@ -1,5 +1,5 @@ from boards.abstracts.settingsmanager import get_settings_manager, \ - SETTING_LAST_NOTIFICATION_ID, SETTING_IMAGE_VIEWER + SETTING_LAST_NOTIFICATION_ID, SETTING_IMAGE_VIEWER, SETTING_ONLY_FAVORITES from boards.models.user import Notification from boards.models import Banner @@ -24,6 +24,7 @@ CONTEXT_POW_DIFFICULTY = 'pow_difficulty CONTEXT_NEW_POST_COUNT = 'new_post_count' CONTEXT_SEARCH_ENABLED = 'search_enabled' CONTEXT_BANNERS = 'banners' +CONTEXT_ONLY_FAVORITES = 'only_favorites' def get_notifications(context, settings_manager): @@ -81,6 +82,8 @@ def user_and_ui_processor(request): context[CONTEXT_SEARCH_ENABLED] = 'haystack' in neboard.settings.INSTALLED_APPS context[CONTEXT_BANNERS] = Banner.objects.order_by('-id') + context[CONTEXT_ONLY_FAVORITES] = settings_manager.get_setting( + SETTING_ONLY_FAVORITES, False) get_notifications(context, settings_manager) get_new_post_count(context, settings_manager) diff --git a/boards/templates/boards/base.html b/boards/templates/boards/base.html --- a/boards/templates/boards/base.html +++ b/boards/templates/boards/base.html @@ -31,7 +31,13 @@