Exemplo n.º 1
0
def create_destinet_account_html(context, request):
    """ """
    ns = {'here': context}
    contact_schema = context.getSite().getSchemaTool()['NyContact']
    sh = SchemaFormHelper(contact_schema, context)
    widgets = []
    for wid in WIDGET_NAMES:
        widgets.append(sh._get_renderer(wid, contact_schema["%s-property" % wid], False))
    register_extra_schema = context.getSite().getSchemaTool()['registration']
    sh = SchemaFormHelper(register_extra_schema, context)
    groups_widget = sh._get_renderer('groups', register_extra_schema['groups-property'], False)
    ns = {'widgets': widgets,
          'here': context,
          'groups_widget': groups_widget}
    return context.getFormsTool().getContent(ns, 'site_createaccount')
    def show_on_atlas(self, REQUEST=None, RESPONSE=None):
        """ Show your organisation on the global DestiNet Atlas """
        meta_type = 'Naaya Contact'
        form_helper = get_schema_helper_for_metatype(self, meta_type)

        schema_tool = self.getSite().getSchemaTool()
        register_extra_schema = schema_tool['registration']
        register_helper = SchemaFormHelper(register_extra_schema, self)
        groups_widget = register_helper._get_renderer(
            'groups', register_extra_schema['groups-property'], False)

        return self.getFormsTool().getContent({
            'here': self,
            'kind': meta_type,
            'action': 'addNyContact_who_who',
            'form_helper': form_helper,
            'submitter_info_html': submitter.info_html(self, REQUEST),
            'groups_widget':groups_widget,
        }, 'contact_add')
Exemplo n.º 3
0
def create_destinet_account_html(context, request):
    """ """
    schema_tool = context.getSite().getSchemaTool()

    contact_schema = schema_tool['NyContact']
    register_extra_schema = schema_tool['registration']

    contact_helper = SchemaFormHelper(contact_schema, context)
    register_helper = SchemaFormHelper(register_extra_schema, context)

    widgets = {}
    for name in WIDGET_NAMES:
        widgets[name] = contact_helper._get_renderer(
            name, contact_schema["%s-property" % name], False)

    groups_widget = register_helper._get_renderer(
        'groups', register_extra_schema['groups-property'], False)

    ns = {'widgets': widgets,
          'here': context,
          'groups_widget': groups_widget}

    return context.getFormsTool().getContent(ns, 'site_createaccount')