Projet

Général

Profil

0001-do-not-depend-on-auquotidien-to-show-fargo-pick-a-fi.patch

Benjamin Dauvergne, 01 avril 2016 17:08

Télécharger (1,58 ko)

Voir les différences:

Subject: [PATCH] do not depend on auquotidien to show fargo pick a file button

It also changes the behaviour from auquotien so that the button is hidden if is
user is not connected.
 wcs/qommon/form.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
wcs/qommon/form.py
772 772
            if not valid_file_type:
773 773
                self.error = _('invalid file type')
774 774

  
775
    def render_hint(self, hint):
776
        hint = CompositeWidget.render_hint(self, hint)
777
        if not self.allow_portfolio_picking:
778
            return t
779
        root_url = get_publisher().get_root_url()
780
        if file_validation.has_file_validation() and get_request().user and not self.preview:
781
            get_response().add_javascript(['fargo.js'])
782
            params = root_url, _('Pick a file from your dropbox'), _('Use file from my dropbox')
783
            hint += htmltext('<p class="use-file-from-fargo"><span '
784
                             'data-src="%sfargo/pick" '
785
                             'data-width="500" '
786
                             'data-height="400" '
787
                             'data-title="%s" '
788
                             'rel="popup">%s</span></p>' % params)
789
        return hint
790

  
775 791

  
776 792
class PicklableUpload(Upload):
777 793
    def __getstate__(self):
778
-