Changeset View
Changeset View
Standalone View
Standalone View
swh/web/misc/iframe.py
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | if root_dir: | ||||
{ | { | ||||
"name": root_dir[:7], | "name": root_dir[:7], | ||||
"object_id": root_dir_swhid.object_id.hex(), | "object_id": root_dir_swhid.object_id.hex(), | ||||
"path": "/", | "path": "/", | ||||
"url": reverse( | "url": reverse( | ||||
"swhid-iframe", | "swhid-iframe", | ||||
url_args={"swhid": str(root_dir_swhid)}, | url_args={"swhid": str(root_dir_swhid)}, | ||||
query_params={ | query_params={ | ||||
"focus_swhid": focus_swhid | "focus_swhid": str(focus_swhid) | ||||
if focus_swhid != root_dir_swhid | if focus_swhid != root_dir_swhid | ||||
else None | else None | ||||
}, | }, | ||||
), | ), | ||||
} | } | ||||
) | ) | ||||
for pi in path_info: | for pi in path_info: | ||||
Show All 9 Lines | if root_dir: | ||||
breadcrumbs.append( | breadcrumbs.append( | ||||
{ | { | ||||
"name": pi["name"], | "name": pi["name"], | ||||
"object_id": dir_swhid.object_id.hex(), | "object_id": dir_swhid.object_id.hex(), | ||||
"path": dir_swhid.path.decode("utf-8") if dir_swhid.path else "", | "path": dir_swhid.path.decode("utf-8") if dir_swhid.path else "", | ||||
"url": reverse( | "url": reverse( | ||||
"swhid-iframe", | "swhid-iframe", | ||||
url_args={"swhid": str(dir_swhid)}, | url_args={"swhid": str(dir_swhid)}, | ||||
query_params={"focus_swhid": focus_swhid}, | query_params={"focus_swhid": str(focus_swhid)}, | ||||
), | ), | ||||
} | } | ||||
) | ) | ||||
if filename: | if filename: | ||||
breadcrumbs.append( | breadcrumbs.append( | ||||
{ | { | ||||
"name": filename, | "name": filename, | ||||
"object_id": swhid.object_id.hex(), | "object_id": swhid.object_id.hex(), | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |