Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ from invenio_i18n import lazy_gettext as _
def _(x): # needed to avoid start time failure with lazy strings
return x

# LOM Extension Override
# =====================
# This code controls whether educational resources are available in the instance.
# It's placed here (not in the package) so each instance can easily enable/disable
# this feature by just changing the config and rebuilding.

import invenio_records_lom.ext
from invenio_records_lom.ext import InvenioRecordsLOM

OVERRIDE_SHOW_EDUCATIONAL_RESOURCES = False
"""Set to True to enable educational resources, False to disable them."""

class InvenioOverrideLOM(InvenioRecordsLOM):
"""Extension that only loads if educational resources are enabled."""

def __init__(self, app=None) -> None:
"""Only initialize if educational resources are enabled."""
if app and OVERRIDE_SHOW_EDUCATIONAL_RESOURCES:
super().__init__(app)

# Replace the original LOM extension with our version
invenio_records_lom.ext.InvenioRecordsLOM = InvenioOverrideLOM

# Flask
# =====
# See https://flask.palletsprojects.com/en/1.1.x/config/
Expand Down Expand Up @@ -242,7 +265,6 @@ THEME_SHOW_FRONTPAGE_INTRO_SECTION = False

# Invenio-Override
# --------------

# # # LOGO
# #INVENIO_OVERRIDE_LOGO=images/MUG.svg
# OVERRIDE_LOGO = "images/MUG.svg"
Expand Down
28 changes: 25 additions & 3 deletions themes/MUG/invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,6 @@ OVERRIDE_RESOURCE_OVERVIEW = True
OVERRIDE_SHOW_PUBLICATIONS_SEARCH = True
"""Enable or disable the publication global search feature."""

OVERRIDE_SHOW_EDUCATIONAL_RESOURCES = False
"""Enable or disable the educational resources global search feature."""

GLOBAL_SEARCH_SCHEMAS = {
"rdm": {
"schema": "rdm",
Expand All @@ -300,6 +297,29 @@ GLOBAL_SEARCH_SCHEMAS = {
}
"""Mapping of original schemas for global search."""

# LOM Extension Override
# =====================
# This code controls whether educational resources are available in the instance.
# It's placed here (not in the package) so each instance can easily enable/disable
# this feature by just changing the config and rebuilding.

import invenio_records_lom.ext
from invenio_records_lom.ext import InvenioRecordsLOM

OVERRIDE_SHOW_EDUCATIONAL_RESOURCES = False
"""Set to True to enable educational resources, False to disable them."""

class InvenioOverrideLOM(InvenioRecordsLOM):
"""Extension that only loads if educational resources are enabled."""

def __init__(self, app=None) -> None:
"""Only initialize if educational resources are enabled."""
if app and OVERRIDE_SHOW_EDUCATIONAL_RESOURCES:
super().__init__(app)

# Replace the original LOM extension with our version
invenio_records_lom.ext.InvenioRecordsLOM = InvenioOverrideLOM

# ============================================================================
# Invenio-OAuthclient
# Keycloak configurations
Expand All @@ -324,3 +344,5 @@ OAUTHCLIENT_REMOTE_APPS = {"keycloak": _keycloak_helper.remote_app}

## SET THE CREDENTIALS via .env
# INVENIO_KEYCLOAK_APP_CREDENTIALS={'consumer_key':'<YOUR.CLIENT.ID>','consumer_secret': '<YOUR.CLIENT.CREDENTIALS.SECRET>'}


14 changes: 8 additions & 6 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading