Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/views/directory.py
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | def _directory_browse(request, sha1_git, path=None): | ||||
swhids_info = get_swhids_info(swh_objects, snapshot_context, dir_metadata) | swhids_info = get_swhids_info(swh_objects, snapshot_context, dir_metadata) | ||||
heading = "Directory - %s" % sha1_git | heading = "Directory - %s" % sha1_git | ||||
if breadcrumbs: | if breadcrumbs: | ||||
dir_path = "/".join([bc["name"] for bc in breadcrumbs]) + "/" | dir_path = "/".join([bc["name"] for bc in breadcrumbs]) + "/" | ||||
heading += " - %s" % dir_path | heading += " - %s" % dir_path | ||||
top_right_link = None | top_right_link = None | ||||
if snapshot_context is not None and not snapshot_context["is_empty"]: | if ( | ||||
snapshot_context is not None | |||||
and not snapshot_context["is_empty"] | |||||
and snapshot_context["revision_id"] is not None | |||||
): | |||||
history_url = reverse( | history_url = reverse( | ||||
"browse-revision-log", | "browse-revision-log", | ||||
url_args={"sha1_git": snapshot_context["revision_id"]}, | url_args={"sha1_git": snapshot_context["revision_id"]}, | ||||
query_params=query_params, | query_params=query_params, | ||||
) | ) | ||||
top_right_link = { | top_right_link = { | ||||
"url": history_url, | "url": history_url, | ||||
"icon": swh_object_icons["revisions history"], | "icon": swh_object_icons["revisions history"], | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |