Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/views/snapshot.py
Show All 35 Lines | @browse_route(r'snapshot/(?P<snapshot_id>[0-9a-f]+)/directory/', | ||||
checksum_args=['snapshot_id']) | checksum_args=['snapshot_id']) | ||||
def snapshot_directory_browse(request, snapshot_id, path=None): | def snapshot_directory_browse(request, snapshot_id, path=None): | ||||
"""Django view for browsing the content of a directory collected | """Django view for browsing the content of a directory collected | ||||
in a snapshot. | in a snapshot. | ||||
The url that points to it is | The url that points to it is | ||||
:http:get:`/browse/snapshot/(snapshot_id)/directory/[(path)/]` | :http:get:`/browse/snapshot/(snapshot_id)/directory/[(path)/]` | ||||
""" | """ | ||||
origin_type = request.GET.get('origin_type', None) | |||||
origin_url = request.GET.get('origin_url', None) | origin_url = request.GET.get('origin_url', None) | ||||
if not origin_url: | if not origin_url: | ||||
origin_url = request.GET.get('origin', None) | origin_url = request.GET.get('origin', None) | ||||
return browse_snapshot_directory(request, snapshot_id=snapshot_id, | return browse_snapshot_directory(request, snapshot_id=snapshot_id, | ||||
path=path, origin_type=origin_type, | path=path, origin_url=origin_url) | ||||
origin_url=origin_url) | |||||
@browse_route(r'snapshot/(?P<snapshot_id>[0-9a-f]+)/content/(?P<path>.+)/', | @browse_route(r'snapshot/(?P<snapshot_id>[0-9a-f]+)/content/(?P<path>.+)/', | ||||
view_name='browse-snapshot-content', | view_name='browse-snapshot-content', | ||||
checksum_args=['snapshot_id']) | checksum_args=['snapshot_id']) | ||||
def snapshot_content_browse(request, snapshot_id, path): | def snapshot_content_browse(request, snapshot_id, path): | ||||
"""Django view that produces an HTML display of a content | """Django view that produces an HTML display of a content | ||||
collected in a snapshot. | collected in a snapshot. | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |