{% load i18n %} {% load codenerix_lists %} {% load codenerix_common %} {% comment %} django-codenerix Copyright 2017 Centrologic Computational Logistic Center S.L. Project URL : http://www.codenerix.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. {% endcomment %} {{html_head}} {% block form_head %}{% endblock %} {% with langcode=LANGUAGE_CODE|default:"en" %} {% with formlist=forms|getforms:form|langforms:langcode %} {% verbatim %} {% endverbatim %}
{% block extra_form_top%}{% endblock %} {% if show_internal_name and formlist|len <= 1 %}

{% block form_action %}{% trans "Editing" %}{% endblock %} {{form.get_name}}

{% endif %} {# BUTTONS at the top #}
{% block buttons_top %} {% if not cannot_update %} {% endif %} {% if linkback %} {% if show_details %} {% else %} {% endif %} {% endif %} {% if linkdelete %} {% if cannot_delete %} {% else %} {% endif %} {% endif %} {% endblock %}
{% for formobj in formlist %} {% if formlist|len > 1 and formobj != form and forloop.counter0 == open_tabs %} {# If this form has several forms, work with tabs #}
{% endif %} {% if formlist|len > 1 and formobj != form %} {{formobj.get_name}} {% if formobj.errors %} {% endif %} {% endif %} {% if forloop.counter0 == position_form_default %}



{% endif %}
{% if formobj.get_errors %}


{% for err in formobj.get_errors %}

{{ err|safe }}

{% endfor %}
{% else %} {% if formobj.errors %}
{% for err in formobj.errors.items %}

{{err.1|safe}}

{% endfor %}
{% endif %} {% if cannot_update %}
* {{ cannot_update }}
{% endif %} {% endif %}
{% with column_counter0=1|column_counter %} {% for group in formobj.get_groups %} {% if column_counter0|add_columns:group.columns %}
{% endif %}
{% if group.name %}
{{group.name}}
{% if group.html_helper_pre %}
{{group.html_helper_pre|safe}}
{% endif %}
{% endif %}
{% with column_counter1=1|column_counter %} {% for field in group.fields %} {% with input=field.input %} {% if input %} {% if column_counter1|add_columns:field.columns %}
{% endif %} {% if not input.field.label %}
{{input}}
{% else %} {# IF INPUT: INI ============================================================================= {{{1 #} {% with zi=forloop.revcounter|stringformat:"s" %} {% with zindex="style=z-index:"|add:zi %} {% with autofocus=field|autofocus %} {% with attrs=input|widgetize|addattr:autofocus|addattr:zindex|addattr:"class=form-control"|inireadonly:input|addextra:field.extra|lockattr:cannot_update %}
{# FIELD: INI {{{2 #} {% if field.html_helper_pre %} {{field.html_helper_pre|safe}} {% endif %} {% if not field.inline %} {{input.errors|unlist|safe}} {% if cannot_update %} {{input|setattrs:attrs|safe}} {% else %} {% if input|foreignkey:no_render_as_foreign %} {# INPUT IS FOREIGN KEY: INI {{{3 #} {% if hide_foreignkey_button %} {{input|setattrs:attrs|safe}} {% else %}
{{input|setattrs:attrs|safe}}
{% endif %} {# INPUT IS FOREIGN KEY: END }}}3 #} {% else %} {% if input|istype:"datetime" %} {# INPUT IS DATETIME:INI {{{3 #} {% with dateinfo=input|datewidget:langcode %} {% endwith %} {# INPUT IS DATETIME: END }}}3 #} {% else %} {% if input|istype:"color" %} {# INPUT IS COLOR: INI {{{3 #}
{% with attrs=attrs|addattr:"colorpicker" %} {{input|setattrs:attrs|safe}} {% endwith %}
{# INPUT IS COLOR: END }}}3 #} {% else %} {# NORMAL INPUT: INI {{{3 #} {{input|setattrs:attrs|safe}} {# NORMAL INPUT: END }}}3 #} {% endif %} {% endif %} {% endif %} {% endif %} {# FIELD: END }}}2 #} {% endif %} {% if field.html_helper_post %} {{field.html_helper_post|safe}} {% endif %} {# FIELD: END }}}2 #}
{% endwith %} {% endwith %} {% endwith %} {% endwith %} {# IF INPUT: END ============================================================================= }}} 1#} {% endif %} {% else %} {# IF NOT INPUT: INI ========================================================================= {{{1 #}
{% if field.html_helper_pre %} {{field.html_helper_pre|safe}} {% endif %} {% if field.name %}
{{field.name}}
{% endif %}
{% with column_counter2=1|column_counter %} {% for subfield in field.fields %} {% with input=subfield.input %} {% if column_counter2|add_columns:subfield.columns %}
{% endif %} {% if not input.field.label %}
{{input}}
{% else %} {# INPUT PROCESSOR: INI {{{2 #} {% with zi=forloop.revcounter|stringformat:"s" %} {% with autofocus=input|autofocus %} {% with zindex="style=z-index:"|add:zi %} {% with attrs=input|widgetize|addattr:autofocus|addattr:zindex|addattr:"class=form-control"|inireadonly:input|addextra:subfield.extra|lockattr:cannot_update %}
{# FIELD: INI {{{3 #} {{input.errors|unlist|safe}} {% if cannot_update %} {{input|setattrs:attrs|safe}} {% else %} {% if input|foreignkey:no_render_as_foreign %} {# INPUT IS FOREIGN KEY: INI {{{4 #} {% if hide_foreignkey_button %} {{input|setattrs:attrs|safe}} {% else %}
{{input|setattrs:attrs|safe}}
{% endif %} {# INPUT IS FOREIGN KEY: INI }}}4 #} {% else %} {% if input|istype:"datetime" %} {# INPUT IS DATETIME:INI {{{4 #} {% with dateinfo=input|datewidget:langcode %} {% endwith %} {# INPUT IS DATETIME: END }}}4 #} {% else %} {% if input|istype:"color" %} {# INPUT IS COLOR: INI {{{4 #}
{% with attrs=attrs|addattr:"colorpicker" %} {{input|setattrs:attrs|safe}} {% endwith %}
{# INPUT IS COLOR: END }}}4 #} {% else %} {# NORMAL INPUT: INI {{{4 #} {{input|setattrs:attrs|safe}} {# NORMAL INPUT: END }}}4 #} {% endif %} {% endif %} {% endif %} {% endif %} {# FIELD: END }}}3 #}
{# INPUT PROCESSOR: END }}}2 #} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endif %} {% endwith %} {% endfor %} {% endwith %}
{% if field.name %}
{% if field.html_helper_post %} {{field.html_helper_post|safe}} {% endif %}
{% endif %} {# IF NOT INPUT: END ========================================================================= }}}1 #} {% endif %} {% endwith %} {% endfor %} {% endwith %}
{% if group.name %}
{% if group.html_helper_pre %} {% endif %}
{% endif %}
{% endfor %} {% endwith %}
{% if formobj.get_errors %}
{% for err in formobj.get_errors %}

{{ err|safe }}

{% endfor %}
{% else %} {% if cannot_update %}
* {{ cannot_update }}
{% endif %} {% endif %}
{% if formlist|len > 1 and formobj != form %}
{% endif %} {% if formlist|len > 1 and formobj != form and forloop.counter == formlist|len %}
{% endif %} {% endfor %} {# BUTTONS at the bottom #}
{% block buttons_bottom %} {% if not cannot_update %} {% endif %} {% if linkback %} {% if show_details %} {% else %} {% endif %} {% endif %} {% if linkdelete %} {% if cannot_delete %} {% else %} {% endif %} {% endif %} {% endblock %}
{% block extra_form_bottom%}{% endblock %}
{% endwith %} {% endwith %} {% block form_bottom %}{% endblock %}