Exemplo n.º 1
0
    def index(self, **kwargs):
        """Display the upload form.

        :rtype: Dict
        :returns:
            legal_wording
                XHTML legal wording for rendering
            support_email
                An help contact address
            upload_form
                The :class:`~mediadrop.forms.uploader.UploadForm` instance
            form_values
                ``dict`` form values, if any

        """
        support_emails = request.settings['email_support_requests']
        support_emails = email.parse_email_string(support_emails)
        support_email = support_emails and support_emails[0] or None

        return dict(
            legal_wording = request.settings['wording_user_uploads'],
            support_email = support_email,
            upload_form = upload_form,
            form_values = kwargs,
        )
Exemplo n.º 2
0
    def index(self, **kwargs):
        """Display the upload form.

        :rtype: Dict
        :returns:
            legal_wording
                XHTML legal wording for rendering
            support_email
                An help contact address
            upload_form
                The :class:`~mediadrop.forms.uploader.UploadForm` instance
            form_values
                ``dict`` form values, if any

        """
        support_emails = request.settings['email_support_requests']
        support_emails = email.parse_email_string(support_emails)
        support_email = support_emails and support_emails[0] or None

        return dict(
            legal_wording = request.settings['wording_user_uploads'],
            support_email = support_email,
            upload_form = upload_form,
            form_values = kwargs,
        )
Exemplo n.º 3
0
    def index(self, **kwargs):
        """Display the upload form.

        :rtype: Dict
        :returns:
            legal_wording
                XHTML legal wording for rendering
            support_email
                An help contact address
            upload_form
                The :class:`~mediadrop.forms.uploader.UploadForm` instance
            form_values
                ``dict`` form values, if any

        """
        name = request.perm.user.display_name
        support_emails = request.settings['email_support_requests']
        support_emails = email.parse_email_string(support_emails)
        support_email = support_emails and support_emails[0] or None
        aux = DBSession.query(
            Podcast.id, Podcast.title).filter(Podcast.author_name == name)
        if 'podcast_include' in kwargs:
            aux = aux.filter(Podcast.id == kwargs['podcast_include']).all()
        else:
            aux = aux.all()

        s = SingleSelectField('podcast',
                              label_text=N_('Include in the Podcast'),
                              css_classes=['dropdown-select'],
                              options=lambda: aux)
        upload_form.children._widget_lst[0] = s
        return dict(
            legal_wording=request.settings['wording_user_uploads'],
            support_email=support_email,
            upload_form=upload_form,
            form_values=kwargs,
        )