make layer collapsed/expanded state sticky
This commit is contained in:
parent
52643a9218
commit
758c821d5a
7 changed files with 23 additions and 8 deletions
|
|
@ -855,16 +855,14 @@ def oembed(request):
|
|||
)
|
||||
return HttpResponse(json.dumps(oembed, indent=2), 'application/json')
|
||||
|
||||
def sitemap_xml_gz(request):
|
||||
sitemap = os.path.abspath(os.path.join(settings.MEDIA_ROOT, 'sitemap.xml.gz'))
|
||||
age = time.mktime(time.localtime()) - os.stat(sitemap).st_ctime
|
||||
def sitemap_xml(request):
|
||||
sitemap = os.path.abspath(os.path.join(settings.MEDIA_ROOT, 'sitemap.xml'))
|
||||
if not os.path.exists(sitemap):
|
||||
tasks.update_sitemap(request.build_absolute_uri('/'))
|
||||
elif age > 24*60*60:
|
||||
elif time.mktime(time.localtime()) - os.stat(sitemap).st_ctime > 24*60*60:
|
||||
tasks.update_sitemap.delay(request.build_absolute_uri('/'))
|
||||
response = HttpFileResponse(sitemap)
|
||||
response['Content-Type'] = 'application/xml'
|
||||
response['Content-Encoding'] = 'x-gzip'
|
||||
return response
|
||||
|
||||
def item(request, id):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue