Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/views/revision.py
Show First 20 Lines • Show All 482 Lines • ▼ Show 20 Lines | if content_data: | ||||
content_display_data = prepare_content_for_display( | content_display_data = prepare_content_for_display( | ||||
content_data["raw_data"], content_data["mimetype"], path | content_data["raw_data"], content_data["mimetype"], path | ||||
) | ) | ||||
content = content_display_data["content_data"] | content = content_display_data["content_data"] | ||||
language = content_display_data["language"] | language = content_display_data["language"] | ||||
mimetype = content_display_data["mimetype"] | mimetype = content_display_data["mimetype"] | ||||
if path: | if path: | ||||
filename = path_info[-1]["name"] | filename = path_info[-1]["name"] | ||||
query_params["filename"] = filename | |||||
filepath = "/".join(pi["name"] for pi in path_info[:-1]) | |||||
extra_context["path"] = f"/{filepath}/" if filepath else "/" | |||||
extra_context["filename"] = filename | extra_context["filename"] = filename | ||||
top_right_link = { | top_right_link = { | ||||
"url": reverse( | "url": reverse( | ||||
"browse-content-raw", | "browse-content-raw", | ||||
url_args={"query_string": query_string}, | url_args={"query_string": query_string}, | ||||
query_params={"filename": filename}, | query_params={"filename": filename}, | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |