## -*- coding: utf-8 -*- <%inherit file="base.html"/> <%def name="breadcrumbs_links()"> %if c.repo: ${h.link_to('Settings',h.url('edit_repo', repo_name=c.repo.repo_name))} » ${h.link_to(_('Integrations'),request.route_url(route_name='repo_integrations_home', repo_name=c.repo.repo_name))} » ${h.link_to(current_IntegrationType.display_name, request.route_url(route_name='repo_integrations_list', repo_name=c.repo.repo_name, integration=current_IntegrationType.key))} %else: ${h.link_to(_('Admin'),h.url('admin_home'))} » ${h.link_to(_('Settings'),h.url('admin_settings'))} » ${h.link_to(_('Integrations'),request.route_url(route_name='global_integrations_home'))} » ${h.link_to(current_IntegrationType.display_name, request.route_url(route_name='global_integrations_list', integration=current_IntegrationType.key))} %endif %if integration: » ${integration.name} %endif

%if integration: ${current_IntegrationType.display_name} - ${integration.name} %else: ${_('Create new %(integration_type)s integration') % {'integration_type': current_IntegrationType.display_name}} %endif

${h.secure_form(request.url)}
%for node in schema: <% label_css_class = ("label-checkbox" if (node.widget == "bool") else "") %>
%if node.widget in ["string", "int", "unicode"]: ${h.text(node.name, defaults.get(node.name), class_="medium", placeholder=hasattr(node, 'placeholder') and node.placeholder or '')} %elif node.widget in ["text"]: ${h.textarea(node.name, defaults.get(node.name), class_="medium", placeholder=hasattr(node, 'placeholder') and node.placeholder or '')} %elif node.widget == "password": ${h.password(node.name, defaults.get(node.name), class_="medium")} %elif node.widget == "bool":
${h.checkbox(node.name, True, checked=defaults.get(node.name))}
%elif node.widget == "select": ${h.select(node.name, defaults.get(node.name), node.choices)} %elif node.widget == "checkbox_list": %for i, choice in enumerate(node.choices): <% name, value = choice, choice if isinstance(choice, tuple): choice, name = choice %>
%endfor %elif node.widget == "readonly": ${node.default} %else: This field is of type ${node.typ}, which cannot be displayed. Must be one of [string|int|bool|select|password|text|checkbox_list]. %endif %if node.name in errors: ${errors.get(node.name)}
%endif

${node.description}

%endfor ## Allow derived templates to add something below the form ## input fields %if hasattr(next, 'below_form_fields'): ${next.below_form_fields()} %endif
${h.submit('save',_('Save'),class_="btn")} %if integration: ${h.submit('delete',_('Delete'),class_="btn btn-danger")} %endif
${h.end_form()}