Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/urls.py
# Copyright (C) 2017-2019 The Software Heritage developers | # Copyright (C) 2017-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from django.conf.urls import url | from django.conf.urls import url | ||||
from django.shortcuts import render, redirect | from django.shortcuts import render, redirect | ||||
import swh.web.browse.views.directory # noqa | import swh.web.browse.views.directory # noqa | ||||
import swh.web.browse.views.content # noqa | import swh.web.browse.views.content # noqa | ||||
import swh.web.browse.views.origin # noqa | import swh.web.browse.views.origin # noqa | ||||
import swh.web.browse.views.release # noqa | import swh.web.browse.views.release # noqa | ||||
import swh.web.browse.views.revision # noqa | import swh.web.browse.views.revision # noqa | ||||
import swh.web.browse.views.snapshot # noqa | import swh.web.browse.views.snapshot # noqa | ||||
from swh.web.browse.browseurls import BrowseUrls | from swh.web.browse.browseurls import BrowseUrls | ||||
from swh.web.browse.identifiers import swh_id_browse | from swh.web.browse.identifiers import swhid_browse | ||||
from swh.web.common.utils import reverse | from swh.web.common.utils import reverse | ||||
def _browse_help_view(request): | def _browse_help_view(request): | ||||
return render( | return render( | ||||
request, "browse/help.html", {"heading": "How to browse the archive ?"} | request, "browse/help.html", {"heading": "How to browse the archive ?"} | ||||
) | ) | ||||
Show All 18 Lines | |||||
urlpatterns = [ | urlpatterns = [ | ||||
url(r"^$", _browse_search_view), | url(r"^$", _browse_search_view), | ||||
url(r"^help/$", _browse_help_view, name="browse-help"), | url(r"^help/$", _browse_help_view, name="browse-help"), | ||||
url(r"^search/$", _browse_search_view, name="browse-search"), | url(r"^search/$", _browse_search_view, name="browse-search"), | ||||
url(r"^vault/$", _browse_vault_view, name="browse-vault"), | url(r"^vault/$", _browse_vault_view, name="browse-vault"), | ||||
# for backward compatibility | # for backward compatibility | ||||
url(r"^origin/save/$", _browse_origin_save_view, name="browse-origin-save"), | url(r"^origin/save/$", _browse_origin_save_view, name="browse-origin-save"), | ||||
url(r"^(?P<swh_id>swh:[0-9]+:[a-z]+:[0-9a-f]+.*)/$", swh_id_browse), | url(r"^(?P<swhid>swh:[0-9]+:[a-z]+:[0-9a-f]+.*)/$", swhid_browse), | ||||
] | ] | ||||
urlpatterns += BrowseUrls.get_url_patterns() | urlpatterns += BrowseUrls.get_url_patterns() |