Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/urls.py
# Copyright (C) 2017-2019 The Software Heritage developers | # Copyright (C) 2017-2021 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 redirect, render | from django.shortcuts import redirect, render | ||||
from swh.web import config | |||||
from swh.web.browse.browseurls import BrowseUrls | from swh.web.browse.browseurls import BrowseUrls | ||||
from swh.web.browse.identifiers import swhid_browse | from swh.web.browse.identifiers import swhid_browse | ||||
import swh.web.browse.views.content # noqa | import swh.web.browse.views.content # noqa | ||||
import swh.web.browse.views.directory # noqa | import swh.web.browse.views.directory # 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.common.utils import origin_visit_types, reverse | from swh.web.common.utils import origin_visit_types, 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 ?"} | ||||
) | ) | ||||
def _browse_search_view(request): | def _browse_search_view(request): | ||||
return render( | return render( | ||||
request, | request, | ||||
"browse/search.html", | "browse/search.html", | ||||
{ | { | ||||
"heading": "Search software origins to browse", | "heading": "Search software origins to browse", | ||||
"enable_ql": config.get_config()["search_config"].get("enable_ql", False), | |||||
"visit_types": origin_visit_types(), | "visit_types": origin_visit_types(), | ||||
}, | }, | ||||
) | ) | ||||
def _browse_vault_view(request): | def _browse_vault_view(request): | ||||
return render( | return render( | ||||
request, | request, | ||||
Show All 24 Lines |