Ejemplo n.º 1
0
    def state_filter_list(self):

        submitted = utils.translate(self.request, _(u'Submitted'))
        submitted += u' (%i)' % self.catalog.submitted_count

        return [
            ('submitted', submitted),
            ('published', _(u'Published'))
        ]
Ejemplo n.º 2
0
    def state_filter_list(self):

        submitted = utils.translate(self.request, _(u'Submitted'))
        submitted += u' (%i)' % self.catalog.submitted_count

        return [
            ('submitted', submitted),
            ('published', _(u'Published')),
            ('hidden', _(u'Hidden'))
        ]
Ejemplo n.º 3
0
def human_daterange(start, end, request):

    if is_whole_day(start, end):
        if split_days_count(start, end) < 1:
            return utils.translate(request, _(u'Whole Day'))
        else:
            if default_now().year == start.year:
                return start.strftime('%d.%m. - ') \
                    + end.strftime('%d.%m. ') \
                    + utils.translate(request, _(u'Whole Day'))
            else:
                return start.strftime('%d.%m.%Y. - ') \
                    + end.strftime('%d.%m.%Y. ') \
                    + utils.translate(request, _(u'Whole Day'))

    if split_days_count(start, end) < 1:
        return start.strftime('%H:%M - ') + end.strftime('%H:%M')
    else:
        if default_now().year == start.year:
            return start.strftime('%d.%m. %H:%M - ') \
                + end.strftime('%d.%m. %H:%M')
        else:
            return start.strftime('%d.%m.%Y. %H:%M - ') \
                + end.strftime('%d.%m.%Y. %H:%M')
Ejemplo n.º 4
0
def human_daterange(start, end, request):

    if is_whole_day(start, end):
        if split_days_count(start, end) < 1:
            return utils.translate(request, _(u'Whole Day'))
        else:
            if default_now().year == start.year:
                return start.strftime('%d.%m. - ') \
                    + end.strftime('%d.%m. ') \
                    + utils.translate(request, _(u'Whole Day'))
            else:
                return start.strftime('%d.%m.%Y. - ') \
                    + end.strftime('%d.%m.%Y. ') \
                    + utils.translate(request, _(u'Whole Day'))

    if split_days_count(start, end) < 1:
        return start.strftime('%H:%M - ') + end.strftime('%H:%M')
    else:
        if default_now().year == start.year:
            return start.strftime('%d.%m. %H:%M - ') \
                + end.strftime('%d.%m. %H:%M')
        else:
            return start.strftime('%d.%m.%Y. %H:%M - ') \
                + end.strftime('%d.%m.%Y. %H:%M')
Ejemplo n.º 5
0
    def update_dynamic_fields(self):
        self.fields['submitter'].field.required = True
        self.fields['submitter_email'].field.required = True

        # remove the terms and conditions agreement if there is none
        if not self.context.get_parent().terms:
            del self.fields['agreed']
        else:
            # otherwise be sure to link to it
            url = self.context.get_parent().absolute_url() + '/@@terms'
            self.fields['agreed'].field.description = utils.translate(
                self.request,
                _(
                    u"I agree to the <a target='_blank' href='${url}'>"
                    u"Terms and Conditions</a>",
                    mapping={'url': url}))
Ejemplo n.º 6
0
    def update_dynamic_fields(self):
        self.fields['submitter'].field.required = True
        self.fields['submitter_email'].field.required = True

        # remove the terms and conditions agreement if there is none
        if not self.context.get_parent().terms:
            del self.fields['agreed']
        else:
            # otherwise be sure to link to it
            url = self.context.get_parent().absolute_url() + '/@@terms'
            self.fields['agreed'].field.description = utils.translate(
                self.request, _(
                    u"I agree to the <a target='_blank' href='${url}'>"
                    u"Terms and Conditions</a>",
                    mapping={'url': url}
                )
            )
Ejemplo n.º 7
0
 def translate(self, text, domain="seantis.dir.events"):
     return utils.translate(self.request, text, domain)
Ejemplo n.º 8
0
 def translate(self, text, domain="seantis.dir.events"):
     return utils.translate(self.request, text, domain)