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

Lcds scheme #313

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

kpsherva
Copy link
Contributor

@kpsherva kpsherva commented Jan 10, 2025

screenshots in #311

* assets: fix responsive views, reorganise content
* closes CERNDocumentServer#204
@kpsherva kpsherva self-assigned this Jan 10, 2025

def index():
"""Frontpage."""
featured_communities_search = current_communities.service.featured_search(
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the service requires the identity, but can it be anonymous instead?
Why featured should require the authenticated identity? And the subsequent call?

The issue with this is that we cannot cache the homepage, and it would be nice to do that maybe at some point (for anonymous users)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is because the next step was to have "My communities" tab in this component, which would then be user-specific (check below)

invenio.cfg Outdated
@@ -144,6 +144,7 @@ THEME_SITENAME = 'CDS'
# Site tracking code template for matomo analytics
# Enable the below on the dedicated environment
THEME_TRACKINGCODE_TEMPLATE = "cds_rdm/matomo-test.html"
RDM_FRONTPAGE = False
Copy link

Choose a reason for hiding this comment

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

I see on Zenodo that we override the frontpage view, by using the 2-tuple format for tha APP_RDM_ROUTES config, which still allows to completely override the view function, i.e.:

APP_RDM_ROUTES["index"] = ("/", frontpage_view_function)

This helps also with URL generation, since otherwise you can't use url_for to generate links to the frontpage (unless hardcoded to "/", which wouldn't be great).

I remember, we struggled to find this approach and accidentally discovered it on some Discord thread at the RDM workshop last year 😅. To be honest, I think the APP_RDM_ROUTES config format is the wrong approach for defining these "common" RDM routes, since it also doesn't allow you to pass freely additional args to Blueprint.add_url_rule(...).

Choose a reason for hiding this comment

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

as a footnote:
this code enables that feature. which is limited to APP_RDM_ROUTES and COMMUNITIES_ROUTES in invenio_app_rdm/theme/views.py and invenio_app_rdm/records_ui/views/__init__.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@slint I am not sure I understand from your comment what is the preferred approach in this case. Should I use the tuple or leave my solution ?

invenio.cfg Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants