Project

General

Profile

Download (1.35 KB) Statistics
| Branch: | Tag: | Revision:
32470887 Frédéric Péters
from qommon.form import *
f05897b9 Frédéric Péters
32470887 Frédéric Péters
c24c0df8 Frédéric Péters
class FileWithPreviewAndStrongboxWidget(FileWithPreviewWidget):
2e7cacea Frédéric Péters
def render_hint(self, hint):
t = CompositeWidget.render_hint(self, hint)
c24c0df8 Frédéric Péters
if get_publisher().has_site_option('strongbox') and get_request().user and not self.preview:
get_response().add_javascript(['../../aq/js/strongbox.js'])
2e7cacea Frédéric Péters
root_url = get_publisher().get_root_url()
c24c0df8 Frédéric Péters
t += htmltext('''<p class="use-file-from-strongbox"><span
b7279f81 Benjamin Dauvergne
data-url="%smyspace/strongbox/pick"
c24c0df8 Frédéric Péters
rel="popup">%s</span></p>''') % (
b7279f81 Benjamin Dauvergne
root_url, _('Use file from strongbox'))
670fe833 Benjamin Dauvergne
if get_publisher().get_site_option('msp') is not None and not self.preview:
64c1c6ef Benjamin Dauvergne
get_response().add_javascript(['../../aq/js/msp.js'])
root_url = get_publisher().get_root_url()
t += htmltext('''<p class="use-file-from-msp"><span
data-src="%smsp/pick"
data-width="500"
data-height="400"
b2ea17fd Benjamin Dauvergne
data-title="%s"
64c1c6ef Benjamin Dauvergne
rel="popup">%s</span></p>''') % (
b2ea17fd Benjamin Dauvergne
root_url, _('Pick a file on mon.Service-Public.fr'),
_('Use file from mon.Service-Public.fr'))
2e7cacea Frédéric Péters
return t