{% load split %}

{% if kpi_n %}
	<form method="POST" action="/regress/{{ component.tag }}/{{ component.n }}/edit_kpi?kpi={{ kpi_n }}" id="edit_kpi_form__{{ kpi_n }}" style="white-space: nowrap;">
	{% csrf_token %}
{% endif %}
	<table class="regress-edit-table">
	<tr>
		<td>	
{% with kpitype.0|split:"__" as kpi_type %}
	{% if kpi_type.0 == 'imbalance' %}	
		{% include 'kpi_editor_imbalance.html' %}	
	{% elif kpi_type.0 == 'job_trail' %}
		{% include 'kpi_editor_quantiles.html' %}
	{% elif kpi_type.0 == 'trail' %}
		{% include 'kpi_editor_trail.html' %}
	{% elif kpi_type.0 == 'monitoring' %} 
		{% include 'kpi_editor_monitoring.html' %}
	{% elif kpi_type.0 == 'trail_time' %} 
		{% include 'kpi_editor_trail_time.html' %}
	{% elif kpi_type.0 == 'trail_net' %} 
		{% include 'kpi_editor_trail_net.html' %}
	{% elif kpi_type.0 == 'trail_resp' %} 
		{% include 'kpi_editor_trail_resp.html' %}
	{% endif %}
{% endwith %}
	</td>
	</tr>
</table>
	<input class="btn btn-secondary " type="submit" value="Сохранить KPI">
{% if kpi_n %}
	<input type="button" class="btn btn-secondary cancel_edit_kpi" id="cancel_edit_kpi__{{ kpi_n }}" value="Отмена">
{% endif %}
	<br>
	<br>
{% if kpi_n %}
	</form>
{% endif %}
