admin: add a popup to display the public URL of the form (#7111)
This commit is contained in:
parent
35c0eff0eb
commit
8c5e72ccd9
|
@ -174,7 +174,8 @@ class FormDefPage(Directory):
|
|||
('workflow-variables', 'workflow_variables'),
|
||||
('workflow-status-remapping', 'workflow_status_remapping'),
|
||||
'roles', 'title', 'options', ('acl-read', 'acl_read'),
|
||||
'overwrite', 'qrcode', 'information']
|
||||
'overwrite', 'qrcode', 'information',
|
||||
('public-url', 'public_url')]
|
||||
|
||||
def __init__(self, component):
|
||||
try:
|
||||
|
@ -384,11 +385,24 @@ class FormDefPage(Directory):
|
|||
if not self.formdef.is_disabled():
|
||||
r += htmltext('<li><a href="%s">%s</a></li>') % (
|
||||
self.formdef.get_url(), _('Display Online'))
|
||||
r += htmltext('<li><a href="public-url" rel="popup">%s</a></li>') % _('Display public URL')
|
||||
if qrcode is not None:
|
||||
r += htmltext('<li><a href="qrcode" rel="popup">%s</a></li>') % _('Display QR Code')
|
||||
r += htmltext('</ul>')
|
||||
return r.getvalue()
|
||||
|
||||
def public_url(self):
|
||||
self.html_top(title=self.formdef.name)
|
||||
get_response().breadcrumb.append(('public-url', _('Public URL')))
|
||||
r = TemplateIO(html=True)
|
||||
r += htmltext('<h2>%s</h2>' % _('Public URL'))
|
||||
r += htmltext('<div>')
|
||||
r += htmltext('<p>%s</p>') % _('The public URL of this form is:')
|
||||
url = self.formdef.get_url()
|
||||
r += htmltext('<a href="%s">%s</a>') % (url, url)
|
||||
r += htmltext('</div>')
|
||||
return r.getvalue()
|
||||
|
||||
def qrcode(self):
|
||||
self.html_top(title=self.formdef.name)
|
||||
get_response().breadcrumb.append(('qrcode', _('QR Code')))
|
||||
|
|
Loading…
Reference in New Issue