コード例 #1
0
 def getBandoState(self):
     """
     return corretc bando state
     """
     scadenza_bando = getattr(self.context, 'scadenza_bando', None)
     chiusura_procedimento_bando = getattr(self.context,
                                           'chiusura_procedimento_bando',
                                           None)
     state = ('open', translate(_(u'Open'), context=self.request))
     if scadenza_bando and scadenza_bando < datetime.now():
         if chiusura_procedimento_bando and (chiusura_procedimento_bando <
                                             datetime.now().date()):
             state = (
                 'closed',
                 translate(_(u'Closed'), context=self.request),
             )
         else:
             state = (
                 'inProgress',
                 translate(_(u'In progress'), context=self.request),
             )
     elif chiusura_procedimento_bando and (chiusura_procedimento_bando <
                                           datetime.now().date()):
         state = ('closed', translate(_(u'Closed'), context=self.request))
     return state
コード例 #2
0
ファイル: search.py プロジェクト: PloneGov-IT/rer.bandi
    def getBandoState(self, bando):
        """
        """

        scadenza_bando = bando.getScadenza_bando
        chiusura_procedimento_bando = bando.getChiusura_procedimento_bando
        state = ("open", translate(_(u"Open"), context=self.request))
        if scadenza_bando and scadenza_bando.isPast():
            if (
                chiusura_procedimento_bando
                and chiusura_procedimento_bando.isPast()
            ):
                state = (
                    "closed",
                    translate(_(u"Closed"), context=self.request),
                )
            else:
                state = (
                    "inProgress",
                    translate(_(u"In progress"), context=self.request),
                )
        else:
            if (
                chiusura_procedimento_bando
                and chiusura_procedimento_bando.isPast()
            ):
                state = (
                    "closed",
                    translate(_(u"Closed"), context=self.request),
                )

        return state
コード例 #3
0
ファイル: bando.py プロジェクト: PloneGov-IT/rer.bandi
 def getBandoState(self):
     """
     return corretc bando state
     """
     scadenza_bando = getattr(self.context, 'scadenza_bando', None)
     chiusura_procedimento_bando = getattr(
         self.context, 'chiusura_procedimento_bando', None
     )
     state = ('open', translate(_(u'Open'), context=self.request))
     if scadenza_bando and scadenza_bando < datetime.now():
         if chiusura_procedimento_bando and (
             chiusura_procedimento_bando < datetime.now().date()
         ):
             state = ('closed', translate(
                 _(u'Closed'), context=self.request)
             )
         else:
             state = ('inProgress', translate(
                 _(u'In progress'), context=self.request)
             )
     elif chiusura_procedimento_bando and (
         chiusura_procedimento_bando < datetime.now().date()
     ):
         state = ('closed', translate(
             _(u'Closed'), context=self.request)
         )
     return state
コード例 #4
0
ファイル: collection.py プロジェクト: libremente/rer.bandi
    def getBandoState(self, bando):
        """
        return corretc bando state
        """
        scadenza_bando = bando.getScadenza_bando
        chiusura_procedimento_bando = bando.getChiusura_procedimento_bando
        state = ('open', translate(_(u'Open'), context=self.request))
        if scadenza_bando and scadenza_bando.isPast():
            if (chiusura_procedimento_bando
                    and chiusura_procedimento_bando.isPast()):
                state = (
                    'closed',
                    translate(_(u'Closed'), context=self.request),
                )
            else:
                state = (
                    'inProgress',
                    translate(_(u'In progress'), context=self.request),
                )
        else:
            if (chiusura_procedimento_bando
                    and chiusura_procedimento_bando.isPast()):
                state = (
                    'closed',
                    translate(_(u'Closed'), context=self.request),
                )

        return state
コード例 #5
0
ファイル: collection.py プロジェクト: libremente/rer.bandi
class IBandoCollectionPortlet(ICollectionPortlet):
    """A portlet which renders the results of a collection object.
    """

    show_more_text = schema.TextLine(
        title=_(u"Other text"),
        description=_(u"Alternative text to show in 'other' link."),
        required=True,
        default=u'Altro\u2026',
    )

    show_more_path = schema.Choice(
        title=_(u"Internal link"),
        description=_(
            u"Insert an internal link. This field override external link field"
        ),
        required=False,
        source=CatalogSource(),
    )

    show_description = schema.Bool(title=u'Mostra descrizione',
                                   required=True,
                                   default=False)

    show_tipologia_bando = schema.Bool(title=u'Mostra tipologia bando',
                                       required=True,
                                       default=False)

    show_effective = schema.Bool(title=u'Mostra data di pubblicazione',
                                 required=True,
                                 default=False)

    show_scadenza_bando = schema.Bool(title=u'Mostra data di scadenza',
                                      required=True,
                                      default=False)
コード例 #6
0
    def getBandoState(self, bando):
        """
        """

        scadenza_bando = bando.getScadenza_bando
        chiusura_procedimento_bando = bando.getChiusura_procedimento_bando
        state = ("open", translate(_(u"Open"), context=self.request))
        if scadenza_bando and scadenza_bando.isPast():
            if (chiusura_procedimento_bando
                    and chiusura_procedimento_bando.isPast()):
                state = (
                    "closed",
                    translate(_(u"Closed"), context=self.request),
                )
            else:
                state = (
                    "inProgress",
                    translate(_(u"In progress"), context=self.request),
                )
        else:
            if (chiusura_procedimento_bando
                    and chiusura_procedimento_bando.isPast()):
                state = (
                    "closed",
                    translate(_(u"Closed"), context=self.request),
                )

        return state
コード例 #7
0
ファイル: collection.py プロジェクト: libremente/rer.bandi
class EditForm(formhelper.EditForm):
    """Portlet edit form.

    This is registered with configure.zcml. The form_fields variable tells
    zope.formlib which fields to display.
    """

    schema = IBandoCollectionPortlet

    label = _(u"Edit Bandi Portlet")
    description = _(
        u"This portlet display a listing of bandi from a Collection.")
コード例 #8
0
ファイル: collection.py プロジェクト: libremente/rer.bandi
class AddForm(formhelper.AddForm):
    """Portlet add form.

    This is registered in configure.zcml. The form_fields variable tells
    zope.formlib which fields to display. The create() method actually
    constructs the assignment that is being added.
    """

    schema = IBandoCollectionPortlet

    label = _(u"Add Bandi Portlet")
    description = _(
        u"This portlet display a listing of bandi from a Collection.")

    def create(self, data):
        return Assignment(**data)
コード例 #9
0
ファイル: collection.py プロジェクト: PloneGov-IT/rer.bandi
 def getBandoState(self, bando):
     """
     return corretc bando state
     """
     scadenza_bando = bando.getScadenza_bando
     chiusura_procedimento_bando = bando.getChiusura_procedimento_bando
     state = ('open', translate(_(u'Open'), context=self.request))
     if scadenza_bando and scadenza_bando.isPast():
         if chiusura_procedimento_bando and chiusura_procedimento_bando.isPast():
             state = ('closed', translate(
                 _(u'Closed'), context=self.request))
         else:
             state = ('inProgress', translate(
                 _(u'In progress'), context=self.request))
     else:
         if chiusura_procedimento_bando and chiusura_procedimento_bando.isPast():
             state = ('closed', translate(
                 _(u'Closed'), context=self.request))
     return state
コード例 #10
0
class IBandoSchema(model.Schema):
    """ A Dexterity schema for Annoucements """

    directives.widget(tipologia_bando=RadioFieldWidget)
    tipologia_bando = schema.Choice(
        title=_('tipologia_bando_label', default=u"Announcement type"),
        description=_('tipologia_bando_help', default=''),
        vocabulary='rer.bandi.tipologie.vocabulary',
        required=True,
    )

    directives.widget(destinatari=CheckBoxFieldWidget)
    destinatari = schema.List(
        title=_('destinatari_label', default=u'Who can apply'),
        description=_('bandi_multiselect_help',
                      default='Select one or more values.'),
        constraint=checkRequiredField,
        required=True,
        value_type=schema.Choice(
            vocabulary='rer.bandi.destinatari.vocabulary'),
    )

    directives.widget(finanziatori=CheckBoxFieldWidget)
    finanziatori = schema.List(
        title=_('finanziatori_label', default=u'Financed by EU programmes'),
        description=_('bandi_multiselect_help',
                      default='Select one or more values.'),
        required=False,
        value_type=schema.Choice(
            vocabulary='rer.bandi.finanziatori.vocabulary'),
    )

    directives.widget(materie=CheckBoxFieldWidget)
    materie = schema.List(
        title=_('materie_label', default=u'Topic'),
        description=_('bandi_multiselect_help',
                      default='Select one or more values.'),
        required=False,
        value_type=schema.Choice(vocabulary='rer.bandi.materie.vocabulary'),
    )

    scadenza_bando = schema.Datetime(
        title=_('scadenza_bando_label', default=u"Expiration date and time"),
        description=_(
            'scadenza_bando_help',
            default=u"Deadline to participate in the announcement",
        ),
        required=False,
    )
    chiusura_procedimento_bando = schema.Date(
        title=_(
            'chiusura_procedimento_bando_label',
            default=u"Closing date procedure",
        ),
        description=_('chiusura_procedimento_bando_help', default=u''),
        required=False,
    )

    riferimenti_bando = RichText(
        title=_('riferimenti_bando_label', default=u"References"),
        description=_('riferimenti_bando_help', default=u""),
        required=False,
    )

    form.order_after(tipologia_bando='IRichText.text')
    form.order_after(destinatari='tipologia_bando')
    form.order_after(finanziatori='destinatari')
    form.order_after(materie='finanziatori')
    form.order_after(scadenza_bando='materie')
    form.order_after(chiusura_procedimento_bando='scadenza_bando')
    form.order_after(riferimenti_bando='chiusura_procedimento_bando')
コード例 #11
0
class View(BrowserView):

    display_name = _('bandi_layout', default='Layout Bandi')
コード例 #12
0
class IBandoSchema(model.Schema):
    """ A Dexterity schema for Annoucements """

    form.order_after(riferimenti_bando='IRichText.text')
    riferimenti_bando = RichText(
        title=_('riferimenti_bando_label', default=u"References"),
        description=_('riferimenti_bando_help', default=u""),
        required=False
    )

    form.order_after(chiusura_procedimento_bando='IRichText.text')
    chiusura_procedimento_bando = schema.Date(
        title=_(
            'chiusura_procedimento_bando_label',
            default=u"Closing date procedure"
        ),
        description=_('chiusura_procedimento_bando_help', default=u''),
        required=False
    )

    form.order_after(scadenza_bando='IRichText.text')
    scadenza_bando = schema.Datetime(
        title=_('scadenza_bando_label', default=u"Expiration date and time"),
        description=_(
            'scadenza_bando_help',
            default=u"Deadline to participate in the announcement"
        ),
        required=False
    )

    form.order_after(ente_bando='IRichText.text')
    directives.widget('ente_bando', AjaxSelectFieldWidget,
                      vocabulary='rer.bandi.enti.vocabulary')
    ente_bando = schema.Tuple(
        title=_(u'ente_label', default=u'Authority'),
        description=_(u'ente_help', default=u'Select some authorities.'),
        required=False,
        defaultFactory=getDefaultEnte,
        value_type=schema.TextLine(),
        missing_value=None
    )

    form.order_after(destinatari='IRichText.text')
    directives.widget(destinatari=CheckBoxFieldWidget)
    destinatari = schema.List(
        title=_('destinatari_label', default=u"Recipients"),
        description=_('destinatari_help', default=''),
        required=True,
        value_type=schema.Choice(vocabulary='rer.bandi.destinatari.vocabulary')
    )

    form.order_after(tipologia_bando='IRichText.text')
    directives.widget(tipologia_bando=RadioFieldWidget)
    tipologia_bando = schema.Choice(
        title=_('tipologia_bando_label', default=u"Announcement type"),
        description=_('tipologia_bando_help', default=''),
        vocabulary='rer.bandi.tipologia.vocabulary',
        required=True
    )