misc: handle summary_url in submission context (#8595)
This commit is contained in:
parent
ae14c854da
commit
caf87ecc34
|
@ -420,6 +420,7 @@ def test_backoffice_submission_context(pub):
|
|||
'thumbnail_url': 'http://www.example.com/thumbnail.png',
|
||||
'user_id': user.id,
|
||||
'comments': 'test_backoffice_submission_context',
|
||||
'summary_url': 'http://www.example.com/summary',
|
||||
}
|
||||
number31.store()
|
||||
resp = app.get('/backoffice/management/form-title/')
|
||||
|
@ -429,6 +430,7 @@ def test_backoffice_submission_context(pub):
|
|||
assert 'http://www.example.com/test.pdf' in resp.body
|
||||
assert 'Associated User' in resp.body
|
||||
assert 'test_backoffice_submission_context' in resp.body
|
||||
assert 'http://www.example.com/summary' in resp.body
|
||||
|
||||
|
||||
def test_backoffice_info_text(pub):
|
||||
|
|
|
@ -1229,6 +1229,9 @@ class FormBackOfficeStatusPage(FormStatusPage):
|
|||
if extra_context.get('comments'):
|
||||
r += htmltext('<h3>%s</h3>') % _('Comments')
|
||||
r += htmltext('<p>%s</p>') % extra_context.get('comments')
|
||||
if extra_context.get('summary_url'):
|
||||
r += htmltext('<div data-content-url="%s"></div>' %
|
||||
(extra_context.get('summary_url')))
|
||||
r += htmltext('</div>')
|
||||
return r.getvalue()
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class RootDirectory(BackofficeRootDirectory):
|
|||
return redirect(url)
|
||||
except KeyError:
|
||||
pass
|
||||
get_response().add_javascript(['jquery.js', 'gadjo.sidepage.js'])
|
||||
get_response().add_javascript(['jquery.js', 'qommon.js', 'gadjo.sidepage.js'])
|
||||
return super(RootDirectory, self)._q_traverse(path)
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
$(function() {
|
||||
$('[data-content-url]').each(function(idx, elem) {
|
||||
$.ajax({url: $(elem).data('content-url'),
|
||||
xhrFields: { withCredentials: true },
|
||||
async: true,
|
||||
dataType: 'jsonp',
|
||||
crossDomain: true,
|
||||
success: function(data) { $(elem).html(data.content); },
|
||||
error: function(error) { console.log('bouh', error); }
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue