{% if page != null %}<!-- PAGE #{{ page }} -->{% endif %}
{% for row in rows %}
<div id="{{ row.task._key }}" style="--columns: 13;"
	class="row reinitializable{% if row.task.confirmed %} confirmed{% endif %}{% if row.task.published %} published{% endif %}{% if row.task.hided %} hided{% endif %}{% if date() >= row.task.start %}{% if date() <= row.task.end %} coming{% else %} passed{% endif %}{% endif %}{% if row.task.completed %} completed{% endif %}{% if row.task.problematic %} problematic{% endif %}"
	data-row="task">
	<span class="unselectable interactive" data-column="date" title="Заявка создана: {{ row.task.created is empty ? 'Никогда' :
	row.task.created|date('d.m.Y H:i') }}; Заявка обновлена: {{ row.task.updated is empty ? 'Никогда' :
	row.task.updated|date('d.m.Y H:i') }}" {% if account.type !='worker' %}onclick="tasks.popup(this.parentElement)" {%
		endif %}>{{ row.task.date|date('d.m.Y')
		}}</span>
	<span class="unselectable interactive" data-column="worker" title="{{ row.worker.id }}" {% if account.type !='worker'
		%}onclick="tasks.worker.popup(this.parentElement)" {% endif %}>{{
		row.worker.id }}</span>
	<span class="unselectable interactive" data-column="name"
		title="{% if row.worker.name.first is not empty %}{{ row.worker.name.first }}{% endif %}{% if row.worker.name.second is not empty %} {{ row.worker.name.second }}{% endif %}{% if row.worker.name.last is not empty %} {{ row.worker.name.last }}{% endif %}">{%
		if row.worker.name.first is not empty %}{{
		row.worker.name.first|slice(0, 1)|upper }}.{% endif %}{% if row.worker.name.last is not empty %} {{
		row.worker.name.last|slice(0, 1)|upper }}.{% endif %}{% if row.worker.name.second is not empty %} {{
		row.worker.name.second }}{% endif %}</span>
	<span class="unselectable interactive" data-column="work" title="{{ row.task.description }}">{{ row.task.work|work
		}}</span>
	<span class="unselectable interactive" data-column="start">{{
		row.task.generated.start }}</span>
	<span class="unselectable interactive" data-column="end">{{
		row.task.generated.end }}</span>
	<span class="unselectable interactive" data-column="hours">{{
		row.task.generated.hours }}</span>
	<span class="unselectable interactive" data-column="market" {% if account.type !='market' and account.type !='worker'
		%}onclick="tasks.market.popup(this.parentElement)" {% endif %}>{{
		row.market.id }}</span>
	<span class="unselectable interactive" data-column="address"
		title="{% if row.market.city is not null %}{{ row.market.city }}, {% endif %}{{ row.market.address }}">{% if
		row.market.city is not null %}{{ row.market.city }}, {% endif
		%}{{
		row.market.address|replace({'ул.': '', 'ул ': '', 'пр ': ''}) }}</span>
	<span class="unselectable interactive" data-column="type" title="{{ row.market.type }}">{{
		row.market.type }}</span>
	<span class="unselectable interactive" data-column="tax" title="{{ row.worker.tax }}">{{
		row.worker.tax }}</span>
	<span class="unselectable interactive" data-column="commentary" title="{{ row.task.commentary }}" {% if account.type
		!='market' and account.type !='worker' %}onclick="tasks.commentary.popup(this.parentElement)" {% endif %}>{{
		row.task.commentary }}</span>
	<span class="unselectable interactive" data-column="chat" title="Непрочитанные сообщения"
		onclick="chat.popup(this.parentElement)">{{ row.task.generated.chat.unreaded ?? 0 }}</span>
</div>
{% endfor %}
