Skip to content

Commit

Permalink
communities: config: Update static page URLs to prevent name collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshamarora1 committed Nov 12, 2024
1 parent 006f2f4 commit fa43030
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 4 additions & 2 deletions invenio_communities/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@

COMMUNITIES_ROUTES = {
"frontpage": "/communities",
"search": "/communities/search",
"new": "/communities/new",
"search": "/communities-search",
"deprecated_search": "/communities/search",
"new": "/communities-new",
"deprecated_new": "/communities/new",
"upload": "/communities/<pid_value>/upload",
"settings": "/communities/<pid_value>/settings",
"requests": "/communities/<pid_value>/requests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<h1 class="ui large header m-0">{{_("Communities")}}</h1>

{% if permissions.can_create %}
<a class="ui button positive left labeled icon m-0" href="/communities/new">
<a class="ui button positive left labeled icon m-0" href="{{ config.COMMUNITIES_ROUTES['new'] }}">
<i class="plus icon" aria-hidden="true"></i>
{{ _('New community') }}
</a>
Expand Down
11 changes: 11 additions & 0 deletions invenio_communities/views/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,22 @@ def create_ui_blueprint(app):
strict_slashes=False,
)

blueprint.add_url_rule(
routes["deprecated_search"],
view_func=communities_search,
strict_slashes=False,
)

blueprint.add_url_rule(
routes["new"],
view_func=communities_new,
)

blueprint.add_url_rule(
routes["deprecated_new"],
view_func=communities_new,
)

blueprint.add_url_rule(
routes["about"],
view_func=communities_about,
Expand Down

0 comments on commit fa43030

Please sign in to comment.