Skip to content

Commit 9a498ab

Browse files
committed
Revert "FP-1099: …" (remove all of FP-1099 from dev branch)
Revert "FP-1099: Clarify Search feature value results" This reverts commit 9ce83d2. Revert "FP-1099: Make Search a feature" This reverts commit 7ebecb1. Revert "FP-1099: Test: Disable reindex on publish" This reverts commit 580a7a5.
1 parent a4ce4c3 commit 9a498ab

3 files changed

Lines changed: 24 additions & 40 deletions

File tree

taccsite_cms/default_secrets.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,6 @@
157157
# SEE: https://confluence.tacc.utexas.edu/x/EwDeCg
158158
# SEE: https://confluence.tacc.utexas.edu/x/FAA9Cw
159159
"blog": False,
160-
161-
# Search
162-
# - `True` (Portal: allow search, Any CMS: allow index)
163-
# - (falsy) (Portal & CMS: allow search & index, SAD CMS: never index)
164-
# - `False` (Portal: no search bar, Any CMS: never index)
165-
# FP-1099: Search can be disabled as a workaround to suspected index bug
166-
"search": None,
167160
}
168161

169162
########################

taccsite_cms/settings.py

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ def getsecrets():
232232
'djangocms_bootstrap4.contrib.bootstrap4_picture',
233233
'djangocms_bootstrap4.contrib.bootstrap4_tabs',
234234
'djangocms_bootstrap4.contrib.bootstrap4_utilities',
235+
'haystack',
236+
'aldryn_apphooks_config',
235237
# For faster testing, disable migrations during database creation
236238
# SEE: https://stackoverflow.com/a/37150997
237239
'test_without_migrations',
@@ -382,8 +384,8 @@ def get_subdirs_as_module_names(path):
382384
for feature in FEATURES:
383385
print(feature + ": ", FEATURES[feature])
384386

385-
# Support Blog/News & Social Media Metadata
386-
if FEATURES['blog']:
387+
if current_secrets._FEATURES['blog']:
388+
# Install required apps
387389
INSTALLED_APPS += [
388390
# Blog/News
389391
# 'filer', # Already added
@@ -399,54 +401,27 @@ def get_subdirs_as_module_names(path):
399401
'djangocms_page_meta',
400402
]
401403

402-
# Configure metadata
404+
# Metadata: Configure
403405
META_SITE_PROTOCOL = 'http'
404406
META_USE_SITES = True
405407
META_USE_OG_PROPERTIES = True
406408
META_USE_TWITTER_PROPERTIES = True
407409
META_USE_GOOGLEPLUS_PROPERTIES = True # django-meta 1.x+
408410
# META_USE_SCHEMAORG_PROPERTIES=True # django-meta 2.x+
409411

410-
# Set custom paths for templates
412+
# Blog/News: Set custom paths for templates
411413
BLOG_PLUGIN_TEMPLATE_FOLDERS = (
412414
('plugins/default', 'Default template'), # i.e. `templates/djangocms_blog/plugins/default/`
413415
('plugins/default-clone', 'Clone of default template'), # i.e. `templates/djangocms_blog/plugins/default-clone/`
414416
)
415417

416-
# Change default values for the auto-setup of one `BlogConfig`
418+
# Blog/News: Change default values for the auto-setup of one `BlogConfig`
417419
# SEE: https://github.com/nephila/djangocms-blog/issues/629
418420
BLOG_AUTO_SETUP = True
419421
BLOG_AUTO_HOME_TITLE ='Home'
420422
BLOG_AUTO_BLOG_TITLE = 'News'
421423
BLOG_AUTO_APP_TITLE = 'News'
422424

423-
# Support Portal search or CMS indexing
424-
if 'search' in FEATURES and (
425-
FEATURES['search']
426-
# FAQ: Portals can search by default, but may not set `FEATURES['search']`
427-
or (PORTAL and FEATURES['search'] != False)
428-
):
429-
INSTALLED_APPS += [
430-
'haystack',
431-
'aldryn_apphooks_config',
432-
]
433-
434-
# Elasticsearch Indexing
435-
HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter',]
436-
HAYSTACK_SIGNAL_PROCESSOR = 'taccsite_cms.signal_processor.RealtimeSignalProcessor'
437-
ALDRYN_SEARCH_DEFAULT_LANGUAGE = 'en'
438-
ALDRYN_SEARCH_REGISTER_APPHOOK = True
439-
HAYSTACK_CONNECTIONS = {
440-
'default': {
441-
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
442-
'URL': current_secrets._ES_HOSTS,
443-
'INDEX_NAME': current_secrets._ES_INDEX_PREFIX.format('cms'),
444-
'KWARGS': {'http_auth': current_secrets._ES_AUTH }
445-
}
446-
}
447-
448-
ES_DOMAIN = current_secrets._ES_DOMAIN
449-
450425

451426
DJANGOCMS_PICTURE_NESTING = True
452427
DJANGOCMS_PICTURE_RESPONSIVE_IMAGES = True
@@ -497,6 +472,22 @@ def get_subdirs_as_module_names(path):
497472
# Use a custom namespace (using default settings.VARIABLE configuration)
498473
SETTINGS_EXPORT_VARIABLE_NAME = 'settings'
499474

475+
# Elasticsearch Indexing
476+
HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter',]
477+
HAYSTACK_SIGNAL_PROCESSOR = 'taccsite_cms.signal_processor.RealtimeSignalProcessor'
478+
ALDRYN_SEARCH_DEFAULT_LANGUAGE = 'en'
479+
ALDRYN_SEARCH_REGISTER_APPHOOK = True
480+
HAYSTACK_CONNECTIONS = {
481+
'default': {
482+
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
483+
'URL': current_secrets._ES_HOSTS,
484+
'INDEX_NAME': current_secrets._ES_INDEX_PREFIX.format('cms'),
485+
'KWARGS': {'http_auth': current_secrets._ES_AUTH }
486+
}
487+
}
488+
489+
ES_DOMAIN = current_secrets._ES_DOMAIN
490+
500491
# Exported settings.
501492
SETTINGS_EXPORT = [
502493
'DEBUG',

taccsite_cms/templates/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{% include "nav_cms.html" with className="navbar-nav" %}
2424

2525
{# NOTE: As of 2020-12, search is only available with a Portal #}
26-
{% if settings.FEATURES.search != False %}{% include "nav_search.html" with className="form-inline ml-auto" only %}{% endif %}
26+
{% include "nav_search.html" with className="form-inline ml-auto" only %}
2727
{% include "nav_portal.html" with className="navbar-nav" settings=settings only %}
2828
{% else %}
2929
{# FAQ: If template were included with `only`, then it would NOT render `show_menu` #}

0 commit comments

Comments
 (0)