Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/utils.py
Show First 20 Lines • Show All 1,085 Lines • ▼ Show 20 Lines | for swh_object in swh_objects: | ||||
swh_id = get_swh_persistent_id(swh_object['type'], swh_object['id']) | swh_id = get_swh_persistent_id(swh_object['type'], swh_object['id']) | ||||
show_options = swh_object['type'] == 'content' or \ | show_options = swh_object['type'] == 'content' or \ | ||||
(snapshot_context and snapshot_context['origin_info'] is not None) | (snapshot_context and snapshot_context['origin_info'] is not None) | ||||
object_icon = swh_object_icons[swh_object['type']] | object_icon = swh_object_icons[swh_object['type']] | ||||
swh_ids.append({ | swh_ids.append({ | ||||
'object_type': swh_object['type'], | 'object_type': swh_object['type'], | ||||
'object_id': swh_object['id'], | |||||
'object_icon': object_icon, | 'object_icon': object_icon, | ||||
'swh_id': swh_id, | 'swh_id': swh_id, | ||||
'swh_id_url': reverse('browse-swh-id', | 'swh_id_url': reverse('browse-swh-id', | ||||
url_args={'swh_id': swh_id}), | url_args={'swh_id': swh_id}), | ||||
'show_options': show_options | 'show_options': show_options | ||||
}) | }) | ||||
return swh_ids | return swh_ids |