Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

export: styling and debug improvements

  • Loading branch information...
commit 10dc99cada0f7140dee72e8aa461bb6b752c626c 1 parent 177e52d
@trey0 trey0 authored
View
2  geocamTiePoint/models.py
@@ -195,7 +195,7 @@ def generateExport(self, exportName, metaJson, slug):
viewHtmlPath = 'view.html'
tileRootUrl = './%s' % slug
- html = self.getSimpleViewHtml(viewHtmlPath, tileRootUrl, metaJson, slug)
+ html = self.getSimpleViewHtml(tileRootUrl, metaJson, slug)
logging.debug('html: len=%s head=%s', len(html), repr(html[:10]))
writer.writeData(viewHtmlPath, html)
View
2  geocamTiePoint/static/geocamTiePoint/css/backbone.css
@@ -67,7 +67,7 @@ input#locationSearch {
margin-left: 0.2em;
}
-#download_link, #simple_viewer {
+#download_link, #simple_viewer, #export_container {
padding-top: 1em;
}
View
2  geocamTiePoint/static/geocamTiePoint/js/backbone/models.js
@@ -161,7 +161,7 @@ $(function($) {
startExport: function(options) {
//this.unset('exportUrl');
assert(! this.get('exportUrl'), "Model has an exportUrl already.");
- var request_url = this.get('url').replace('.json', '/generateExport');
+ var request_url = this.get('url').replace('.json', '/generateExport/');
this.exportPending = true;
var model = this;
model.on('export_ready', function(){this.exportPending = false;}, this);
View
2  geocamTiePoint/static/geocamTiePoint/js/backbone/views.js
@@ -881,10 +881,12 @@ $(function($) {
'{{else}}'+
'<div id="export_controls">' +
'{{#if alignedTilesUrl}}' +
+ '<div id="export_container">' +
'<span id="export_button"><button id="create_archive">' +
'Create Export Archive (this could take a few minutes)' +
'</button></span>' +
'<span id="exportError" style="color:red"></span>' +
+ '</div>' +
'{{else}}' +
'<p>Add at least 2 tiepoint pairs before exporting the aligned image.</p>' +
'{{/if}}' +
View
4 geocamTiePoint/urls.py
@@ -38,12 +38,12 @@
url(r'^overlay/(?P<key>\d+)/warp$', 'overlayIdWarp',
{}, 'geocamTiePoint_overlayIdWarp'),
- url(r'^overlay/(?P<key>\d+)/generateExport$', 'overlayGenerateExport',
+ url(r'^overlay/(?P<key>\d+)/generateExport/$', 'overlayGenerateExport',
{}, 'geocamTiePoint_overlayGenerateExport'),
# duplicate url that starts with 'backend' so we can set 'login: admin'
# on the backend version of the view.
- url(r'^backend/overlay/(?P<key>\d+)/generateExport$', 'overlayGenerateExport',
+ url(r'^backend/overlay/(?P<key>\d+)/generateExport/$', 'overlayGenerateExport',
{}, 'geocamTiePoint_overlayGenerateExportBackend'),
url(r'^overlay/(?P<key>\d+)/export\.html$', 'overlayExportInterface',
View
10 geocamTiePoint/views.py
@@ -471,7 +471,13 @@ def uiDemo(request, key):
@csrf_exempt
def overlayGenerateExport(request, key):
- if request.method == 'POST':
+ if request.method == 'GET':
+ return (HttpResponse
+ ('<form action="." method="post">'
+ + '<input type="submit" name="submit"'
+ + ' value="Create Export Archive"/>'
+ + '</form>'))
+ elif request.method == 'POST':
if settings.USING_APP_ENGINE:
onFrontEndInstance = (backends.get_backend() == None)
if onFrontEndInstance:
@@ -486,7 +492,7 @@ def overlayGenerateExport(request, key):
return HttpResponse('{"result": "ok"}',
content_type='application/json')
else:
- return HttpResponseNotAllowed(['POST'])
+ return HttpResponseNotAllowed(['GET', 'POST'])
def overlayExportInterface(request, key):
Please sign in to comment.
Something went wrong with that request. Please try again.