Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

views: optional index page registration #2952

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions invenio_app_rdm/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

Check failure on line 1 in invenio_app_rdm/config.py

View workflow job for this annotation

GitHub Actions / Python / Tests (3.9, postgresql14, opensearch2)

Black format check --- /home/runner/work/invenio-app-rdm/invenio-app-rdm/invenio_app_rdm/config.py 2025-01-14 16:21:20.019460+00:00 +++ /home/runner/work/invenio-app-rdm/invenio-app-rdm/invenio_app_rdm/config.py 2025-01-14 16:25:08.897199+00:00 @@ -273,10 +273,11 @@ THEME_FRONTPAGE_TEMPLATE = "invenio_app_rdm/frontpage.html" """Frontpage template.""" THEME_HEADER_LOGIN_TEMPLATE = "invenio_app_rdm/header_login.html" """Header login base template.""" + def _get_package_version(): from importlib.metadata import PackageNotFoundError, version from packaging.version import Version

Check failure on line 1 in invenio_app_rdm/config.py

View workflow job for this annotation

GitHub Actions / Python / Tests (3.12, postgresql14, opensearch2)

Black format check --- /home/runner/work/invenio-app-rdm/invenio-app-rdm/invenio_app_rdm/config.py 2025-01-14 16:21:19.593820+00:00 +++ /home/runner/work/invenio-app-rdm/invenio-app-rdm/invenio_app_rdm/config.py 2025-01-14 16:25:18.979798+00:00 @@ -273,10 +273,11 @@ THEME_FRONTPAGE_TEMPLATE = "invenio_app_rdm/frontpage.html" """Frontpage template.""" THEME_HEADER_LOGIN_TEMPLATE = "invenio_app_rdm/header_login.html" """Header login base template.""" + def _get_package_version(): from importlib.metadata import PackageNotFoundError, version from packaging.version import Version
#
# Copyright (C) 2019-2024 CERN.
# Copyright (C) 2019-2020 Northwestern University.
Expand Down Expand Up @@ -262,7 +262,7 @@
"""Footer base template."""

THEME_FRONTPAGE = False
"""Use default frontpage."""
"""Use default theme frontpage."""

THEME_FRONTPAGE_TITLE = _("The turn-key research data management repository")
"""Frontpage title."""
Expand All @@ -276,7 +276,6 @@
THEME_HEADER_LOGIN_TEMPLATE = "invenio_app_rdm/header_login.html"
"""Header login base template."""


def _get_package_version():
from importlib.metadata import PackageNotFoundError, version

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@ const handleAuthButtonClick = () => {

$authButton.on({ click: handleAuthButtonClick });

const invenioConfig = JSON.parse(document.body.dataset.invenioConfig);
const isMathJaxEnabled = invenioConfig?.isMathJaxEnabled;
if (window.invenio) {
window.invenio.onSearchResultsRendered = () => {
if (isMathJaxEnabled) {
// Re-render mathematical content on the page using MathJax.
return window.MathJax?.typeset();
}
};
if (document.body.dataset.invenioConfig) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should always be there. @anikachurilova worked on this.
What was the issue?

const invenioConfig = JSON.parse(document.body.dataset.invenioConfig);
const isMathJaxEnabled = invenioConfig?.isMathJaxEnabled;
if (window.invenio) {
window.invenio.onSearchResultsRendered = () => {
if (isMathJaxEnabled) {
// Re-render mathematical content on the page using MathJax.
return window.MathJax?.typeset();
}
};
}
}
5 changes: 3 additions & 2 deletions invenio_app_rdm/theme/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

Check failure on line 1 in invenio_app_rdm/theme/views.py

View workflow job for this annotation

GitHub Actions / Python / Tests (3.9, postgresql14, opensearch2)

Black format check --- /home/runner/work/invenio-app-rdm/invenio-app-rdm/invenio_app_rdm/theme/views.py 2025-01-14 16:21:20.040460+00:00 +++ /home/runner/work/invenio-app-rdm/invenio-app-rdm/invenio_app_rdm/theme/views.py 2025-01-14 16:25:23.647073+00:00 @@ -41,13 +41,11 @@ "invenio_app_rdm", __name__, template_folder="templates", static_folder="static", ) - blueprint.add_url_rule( - **create_url_rule(routes["index"], default_view_func=index) - ) + blueprint.add_url_rule(**create_url_rule(routes["index"], default_view_func=index)) blueprint.add_url_rule( **create_url_rule(routes["robots"], default_view_func=robots) ) blueprint.add_url_rule( **create_url_rule(routes["help_search"], default_view_func=help_search)

Check failure on line 1 in invenio_app_rdm/theme/views.py

View workflow job for this annotation

GitHub Actions / Python / Tests (3.12, postgresql14, opensearch2)

Black format check --- /home/runner/work/invenio-app-rdm/invenio-app-rdm/invenio_app_rdm/theme/views.py 2025-01-14 16:21:19.614821+00:00 +++ /home/runner/work/invenio-app-rdm/invenio-app-rdm/invenio_app_rdm/theme/views.py 2025-01-14 16:25:39.341543+00:00 @@ -41,13 +41,11 @@ "invenio_app_rdm", __name__, template_folder="templates", static_folder="static", ) - blueprint.add_url_rule( - **create_url_rule(routes["index"], default_view_func=index) - ) + blueprint.add_url_rule(**create_url_rule(routes["index"], default_view_func=index)) blueprint.add_url_rule( **create_url_rule(routes["robots"], default_view_func=robots) ) blueprint.add_url_rule( **create_url_rule(routes["help_search"], default_view_func=help_search)
#
# Copyright (C) 2019-2024 CERN.
# Copyright (C) 2019-2020 Northwestern University.
Expand Down Expand Up @@ -43,8 +43,9 @@
template_folder="templates",
static_folder="static",
)

blueprint.add_url_rule(**create_url_rule(routes["index"], default_view_func=index))
blueprint.add_url_rule(
**create_url_rule(routes["index"], default_view_func=index)
)
blueprint.add_url_rule(
**create_url_rule(routes["robots"], default_view_func=robots)
)
Expand Down
Loading