class IProfileLink(IPortletDataProvider):

    header = schema.TextLine(
        title=_(u"Link Title"),
        required=True,
        default=_(u"My Profile"),
    )
class Assignment(base.Assignment):
    implements(IProfileLink)

    def __init__(self, header):
        self.header = header

    title = _(u"Profile Link Portlet")
class AddForm(base.NullAddForm):
    form_fields = form.Fields(INetworkSearchPortlet)
    label = _(u"Add Network Search Facility")

    #description = _(u"Display upcoming prayer cycle")

    def create(self):
        return Assignment()
class IEnhancedUserDataSchema(IUserDataSchema):
    # ...
    twitter_username = schema.TextLine(
        title=_(u'label_twitter', default=u'Twitter'),
        description=_(u'desc_twitter_username',
                      default=u"Enter your Twitter Account"),
        required=False,
    )
    #form.widget(user_biography=WysiwygFieldWidget)
    user_biography = schema.Text(
        title=_(u'label_user_biography', default=u'Biography'),
        description=_(
            u'desc_user_biography',
            default=
            u"A short overview of who you are and what you do. Will be displayed on your author page, linked from the items you create."
        ),
        required=False,
    )

    church = schema.Choice(
        title=_(u'Church'),
        required=True,
        source=church_member_val,
    )

    region = schema.Choice(
        title=_(u"Region"),
        required=True,
        vocabulary=regions_val,
    )

    wcc_commission = schema.List(title=_(u'WCC Commission or Governing Body'),
                                 required=True,
                                 value_type=schema.Choice(
                                     vocabulary=wcc_commission_val, ))
                        val['church_member_values'])),
                    'title':
                    val['church_member_values']
                })
            #values.append(SimpleTerm(value=unicode(val['church_member_values']), token=unicode(val['church_member_values']), title=val['church_member_values']))
    if values:
        values.sort(key=lambda k: k['title'])
        result = [
            SimpleTerm(value=v['value'], token=v['value'], title=v['title'])
            for v in values
        ]
    return SimpleVocabulary(result)


regions_val = SimpleVocabulary([
    SimpleTerm(value=u'Africa', title=_(u'Africa')),
    SimpleTerm(value=u'Asia', title=_(u'Asia')),
    SimpleTerm(value=u'Caribbean', title=_(u'Caribbean')),
    SimpleTerm(value=u'Europe', title=_(u'Europe')),
    SimpleTerm(value=u'Latin America', title=_(u'Latin America')),
    SimpleTerm(value=u'Middle East', title=_(u'Middle East')),
    SimpleTerm(value=u'North America', title=_(u'North America')),
    SimpleTerm(value=u'Pacific', title=_(u'Pacific'))
])

wcc_commission_val = SimpleVocabulary([
    SimpleTerm(
        value='Commission of the Churches on International Affairs',
        title=_(u'Commission of the Churches on International Affairs')),
    SimpleTerm(value='Commission on Education and Ecumenical Formation',
               title=_(u'Commission on Education and Ecumenical Formation')),
    values = []
    result = []
    unique_list = []
    if settings.church_member:
        for val in settings.church_member:
            cmv = unicode(idnormalizer.normalize(val['church_member_values']))
            if cmv not in unique_list:
                unique_list.append(cmv)
                values.append({'value':unicode(idnormalizer.normalize(val['church_member_values'])), 'title':val['church_member_values']})
            #values.append(SimpleTerm(value=unicode(val['church_member_values']), token=unicode(val['church_member_values']), title=val['church_member_values']))
    if values:
        values.sort(key=lambda k:k['title'])
        result = [SimpleTerm(value=v['value'], token=v['value'], title=v['title']) for v in values]
    return SimpleVocabulary(result)

regions_val = SimpleVocabulary([SimpleTerm(value=u'Africa', title=_(u'Africa')),
                            SimpleTerm(value=u'Asia', title=_(u'Asia')),
                            SimpleTerm(value=u'Caribbean', title=_(u'Caribbean')),
                            SimpleTerm(value=u'Europe', title=_(u'Europe')),
                            SimpleTerm(value=u'Latin America', title=_(u'Latin America')),
                            SimpleTerm(value=u'Middle East', title=_(u'Middle East')),
                            SimpleTerm(value=u'North America', title=_(u'North America')),
                            SimpleTerm(value=u'Pacific', title=_(u'Pacific'))])

wcc_commission_val = SimpleVocabulary([SimpleTerm(value='Commission of the Churches on International Affairs', title=_(u'Commission of the Churches on International Affairs')),
                                       SimpleTerm(value='Commission on Education and Ecumenical Formation', title=_(u'Commission on Education and Ecumenical Formation')),
                                       SimpleTerm(value='Commission on Faith and Order', title=_(u'Commission on Faith and Order')),
                                       SimpleTerm(value='Commission on World Mission and Evangelism', title=_(u'Commission on World Mission and Evangelism')),
                                       SimpleTerm(value='ECHOS Commission on Youth in the Ecumenical Movement', title=_(u'ECHOS Commission on Youth in the Ecumenical Movement')),
                                       SimpleTerm(value='Joint Consultative Commission with Christian World Communions', title=_(u'Joint Consultative Commission with Christian World Communions')),
                                       SimpleTerm(value='Joint Consultative Group between the WCC and Pentecostals', title=_(u'Joint Consultative Group between the WCC and Pentecostals')),
 def title(self):
     return _('Search Network Members')
from collective.grok import gs
from wccminisites.policy import MessageFactory as _


@gs.importstep(name=u'wccminisites.policy',
               title=_('wccminisites.policy import handler'),
               description=_(''))
def setupVarious(context):
    if context.readDataFile('wccminisites.policy.marker.txt') is None:
        return
    portal = context.getSite()

    # do anything here
示例#9
0
class ICaptchaSchema(Interface):
    captcha = Captcha(
        title=_(u'Type the code'),
        description=_(u'Type the code from the picture shown below.'))
from collective.grok import gs
from wccminisites.policy import MessageFactory as _

@gs.importstep(
    name=u'wccminisites.policy', 
    title=_('wccminisites.policy import handler'),
    description=_(''))
def setupVarious(context):
    if context.readDataFile('wccminisites.policy.marker.txt') is None:
        return
    portal = context.getSite()

    # do anything here
 def title(self):
     return _('Search Network Members')