diff --git a/pandora/0xdb.jsonc b/pandora/0xdb.jsonc index 1d210b6b..2598999c 100644 --- a/pandora/0xdb.jsonc +++ b/pandora/0xdb.jsonc @@ -639,6 +639,11 @@ "showHome": true, "showIconBrowser": false, "showInfo": true, + "showLayers": { + "privatenotes": true, + "publicnotes": true, + "subtitles": true + }, "showMapControls": false, "showMapLabels": false, "showFolder": { diff --git a/pandora/app/views.py b/pandora/app/views.py index 2a428f9a..ec0460cf 100644 --- a/pandora/app/views.py +++ b/pandora/app/views.py @@ -74,7 +74,7 @@ def opensearch_xml(request): def robots_txt(request, url): return HttpResponse( - 'User-agent: *\nDisallow:\nSitemap: %s\n' % request.build_absolute_uri('/sitemap.xml.gz'), + 'User-agent: *\nDisallow:\nSitemap: %s\n' % request.build_absolute_uri('/sitemap.xml'), 'text/plain' ) diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index b7114b08..12ae4061 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -113,6 +113,7 @@ def update_sitemap(base_url): el = ET.SubElement(video, "video:duration") el.text = "%s" % duration + with open(sitemap[:-3], 'wb') as f: + f.write('\n' + ET.tostring(urlset)) with gzip.open(sitemap, 'wb') as f: f.write('\n' + ET.tostring(urlset)) - diff --git a/pandora/item/views.py b/pandora/item/views.py index f5fb6c16..fca883cc 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -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): diff --git a/pandora/padma.jsonc b/pandora/padma.jsonc index 8325cf65..dfd6440e 100644 --- a/pandora/padma.jsonc +++ b/pandora/padma.jsonc @@ -547,6 +547,13 @@ "showHome": true, "showIconBrowser": false, "showInfo": true, + "showLayers": { + "places": true, + "events": true, + "keywords": true, + "descriptions": true, + "transcripts": true + }, "showMapControls": false, "showMapLabels": false, "showFolder": { diff --git a/pandora/urls.py b/pandora/urls.py index 5a181438..7baa86b5 100644 --- a/pandora/urls.py +++ b/pandora/urls.py @@ -31,7 +31,7 @@ urlpatterns = patterns('', (r'^opensearch.xml$', 'app.views.opensearch_xml'), (r'^oembed$', 'item.views.oembed'), (r'^robots.txt$', 'app.views.robots_txt'), - (r'^sitemap.xml.gz$', 'item.views.sitemap_xml_gz'), + (r'^sitemap.xml$', 'item.views.sitemap_xml'), (r'', include('item.urls')), ) #if settings.DEBUG: diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js index 793ed8b9..d4cea5fc 100644 --- a/static/js/pandora/item.js +++ b/static/js/pandora/item.js @@ -231,6 +231,7 @@ pandora.ui.item = function() { : '', showAnnotations: pandora.user.ui.showAnnotations, showLargeTimeline: true, + showLayers: pandora.user.ui.showLayers, subtitles: videoOptions.subtitles, tooltips: true, video: videoOptions.video, @@ -328,6 +329,9 @@ pandora.ui.item = function() { toggleannotations: function(data) { pandora.UI.set('showAnnotations', data.showAnnotations); }, + togglelayer: function(data) { + pandora.UI.set('showLayers.' + data.layer, !data.collapsed); + }, pandora_showannotations: function(data) { pandora.$ui.editor.options({showAnnotations: data.value}); }