-
Notifications
You must be signed in to change notification settings - Fork 11
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
base: master
Are you sure you want to change the base?
Lcds scheme #313
Conversation
* assets: fix responsive views, reorganise content * closes CERNDocumentServer#204
|
||
def index(): | ||
"""Frontpage.""" | ||
featured_communities_search = current_communities.service.featured_search( |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(...)
.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?
screenshots in #311