Skip to content

Commit

Permalink
export: styling and debug improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
trey0 committed Oct 22, 2012
1 parent 177e52d commit 10dc99c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion geocamTiePoint/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion geocamTiePoint/static/geocamTiePoint/css/backbone.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ input#locationSearch {
margin-left: 0.2em;
}

#download_link, #simple_viewer {
#download_link, #simple_viewer, #export_container {
padding-top: 1em;
}

Expand Down
2 changes: 1 addition & 1 deletion geocamTiePoint/static/geocamTiePoint/js/backbone/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions geocamTiePoint/static/geocamTiePoint/js/backbone/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}}' +
Expand Down
4 changes: 2 additions & 2 deletions geocamTiePoint/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 8 additions & 2 deletions geocamTiePoint/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down

0 comments on commit 10dc99c

Please sign in to comment.