{% load custom_filters %} {% if is_type %}
{% else %} {% endif %} {% for attribute in attribute_list %}
{{attribute.0}}
{% if forloop.last %}
{{title}}
{% endif %} {% endfor %} {% if is_type %} {% url 'configuration:survey' selected_component=component selected_type_id=item.id as select_url %} {% else %} {% url 'configuration:survey' selected_component=component selected_id=item.id as select_url %} {% endif %} {% for item in item_list %} {% if is_type %} {% url 'configuration:survey' selected_component=component selected_type_id=item.id as select_url %} {% url 'configuration:delete_from_survey' component_type=component component_type_id=item.id as delete_url %} {% else %} {% url 'configuration:survey' selected_component=component selected_id=item.id as select_url %} {% url 'configuration:delete_from_survey' component_type=component component_id=item.id as delete_url %} {% endif %} {% comment %} Render Add/Update/Delete button {% endcomment %} {% if component == selected_component and item.id == selected_id %} {% comment %} Start Add/Update button for selected item {% endcomment %} {% comment %} End Add/Update button for selected item {% endcomment %} {% else %} {% comment %} Start Add/Delete/Can't delete button for not selected item {% endcomment %} {% if item.id >= 0 %} {% comment %} Start Delete/Can't delete botton for unselected existing item {% endcomment %} {% if item.can_delete %}
Delete
{% else %}
Can't delete has {% if is_type %} components {% else %} images {% endif %}
{% comment %} End Delete/Can't delete botton for unselected existing item {% endcomment %} {% endif %} {% else %} {% comment %} Start Add botton for new items {% endcomment %}
{% if is_type %} New Type {% else %} Add {{component}} {% endif %}
{% comment %} End Add botton for new items {% endcomment %} {% endif %} {% endif %} {% for attribute in attribute_list %} {% if component == selected_component and item.id == selected_id %} {% if attribute.0 == 'type' %} {% comment %} end rendering type of selected item {% endcomment %} {% elif attribute.0 == 'channels' %} {% comment %} render channels only for already defined items {% endcomment %} {% if item.id >= 0 %} {% for chnl_id, chnl_name, chnl_slice in item|get_key:attribute.1 %} {% endfor %}
Name Offset
{% endif %} {% comment %} end rendering camera channels of selected item {% endcomment %} {% else %} {% comment %} start rendering attribute other than channel and type for selected item {% endcomment %} {% endif %} {% comment %} end rendering any attribute of selected item {% endcomment %} {% else %} {% comment %} start rendering attribute of item that is not selected {% endcomment %} {% if attribute.0 == 'channels' %} {% comment %} render channels of unselected item {% endcomment %} {% for chnl_id, chnl_name, chnl_slice in item|get_key:attribute.1 %} {% endfor %}
{{ chnl_name }} {{ chnl_slice }}
{% comment %} end rendering channels of non select item {% endcomment %} {% else %} {% comment %} start rendering attribute other than channel of not selected item {% endcomment %}
{{item|get_key:attribute.1}}
{% endif %}
{% endif %} {% comment %} end rendering attribute {% endcomment %} {% endfor %} {% comment %} end attribute iteration {% endcomment %} {% if track_access %} {% if item.id >= 0 %} {% if item.access %} {% url 'configuration:change_access' new_access=0 selected_component=selected_component selected_id=selected_id target_component=component target_id=item.id as access_url %} {% else %} {% url 'configuration:change_access' new_access=1 selected_component=selected_component selected_id=selected_id target_component=component target_id=item.id as access_url %} {% endif %}
{% if component == 'observer' %} {% if not item.access %} no {% endif %} {{selected_component}} access {% else %} observer has {% if not item.access %} no {% endif %} access {% endif %}
{% endif %} {% endif %} {% endfor %} {% comment %} end item iteration {% endcomment %} {% if is_type or not type_attributes|get_key:component %}
{% endif %} {% comment %} {% for attribute in attribute_list %} {% endfor %} {% endcomment %}