Skip to content

Commit

Permalink
feat: add feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
carlinmack committed Sep 18, 2024
1 parent 94538cd commit 8a9cb45
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions invenio_communities/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,6 @@

COMMUNITIES_DEFAULT_RECORD_SUBMISSION_POLICY = RecordSubmissionPolicyEnum.OPEN
"""Default value of record submission policy community access setting."""

COMMUNITIES_SHOW_BROWSE_PAGE = False
"""Whether the browse page is enabled for communities"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{# -*- coding: utf-8 -*-

This file is part of Invenio.
Copyright (C) 2024 CERN.

Invenio is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
#}

{% extends "invenio_communities/details/base.html" %}
{% set active_community_header_menu_item= 'browse' %}


{%- block page_body %}
{{ super() }}
<div class="ui text container rich-input-content rel-m-2 rel-pt-1">
Browse
</div>
{%- endblock page_body -%}

4 changes: 4 additions & 0 deletions invenio_communities/views/communities.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ def communities_browse(pid_value, community, community_ui):
"""Community browse page."""
permissions = community.has_permissions_to(MEMBERS_PERMISSIONS)

conf = current_app.config
if not conf.get("COMMUNITIES_SHOW_BROWSE_PAGE", False):
abort(404)

return render_community_theme_template(
"invenio_communities/details/browse/index.html",
theme=community_ui.get("theme", {}),
Expand Down

0 comments on commit 8a9cb45

Please sign in to comment.