{% if task %}
{% if exist is same as(true) %}
{% for work in works %}
<option value="{{ work }}" {% if task.work==work %} selected{% endif %}>{{ work }}</option>
{% endfor %}
{% else %}
{% if task is not null %}
<optgroup label="Текущее">
	<option value="{{ task.work }}" selected>{{ task.work }}</option>
</optgroup>
{% endif %}
<optgroup label="Доступное">
	{% for work in works %}
	<option value="{{ work }}">{{ work }}</option>
	{% endfor %}
</optgroup>
{% endif %}
{% elseif worker %}
{% if exist is same as(true) %}
{% for work in works %}
<option value="{{ work }}" {% if worker.work==work %} selected{% endif %}>{{ work }}</option>
{% endfor %}
{% else %}
{% if worker is not null %}
<optgroup label="Текущее">
	<option value="{{ worker.work }}" selected>{{ worker.work }}</option>
</optgroup>
{% endif %}
<optgroup label="Доступное">
	{% for work in works %}
	<option value="{{ work }}">{{ work }}</option>
	{% endfor %}
</optgroup>
{% endif %}
{% else %}
{% for work in works %}
<option value="{{ work }}">{{ work }}</option>
{% endfor %}
{% endif %}
