03019898b0
Добавлена офлайн/EndUser-подпись «ознакомлен и принял в работу» для документов отчётов и файловые вложения к задачам через Nextcloud. Co-authored-by: Cursor <cursoragent@cursor.com>
73 lines
4.0 KiB
HTML
73 lines
4.0 KiB
HTML
{% load i18n %}
|
|
<div class="nc-browser-drop" data-nc-upload="1">
|
|
{% if attach_message %}
|
|
<div style="margin-bottom:0.875rem; padding:0.625rem 0.875rem; border-radius:0.5rem; font-size:0.8125rem;
|
|
{% if attach_message_type == 'success' %}color:#137333; background:rgba(19,115,51,0.1); border:1px solid rgba(19,115,51,0.25);
|
|
{% else %}color:#d63333; background:rgba(214,51,51,0.1); border:1px solid rgba(214,51,51,0.25);{% endif %}">
|
|
{{ attach_message }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if attachments %}
|
|
<div style="border:1px solid var(--color-border); border-radius:0.5rem; overflow:hidden; margin-bottom:0.875rem;">
|
|
<table style="width:100%; border-collapse:collapse; font-size:0.8125rem;">
|
|
<tbody>
|
|
{% for att in attachments %}
|
|
<tr style="border-bottom:1px solid var(--color-border);" class="tr-hover">
|
|
<td style="padding:0.5rem 0.75rem;">
|
|
<span style="display:inline-flex; align-items:center; gap:0.5rem;">
|
|
<span class="nc-file-ico nc-file-ico-file" aria-hidden="true"></span>
|
|
<a href="{% url 'task_attachment_download' task.pk att.pk %}"
|
|
style="color:var(--color-primary); text-decoration:none;">{{ att.original_name }}</a>
|
|
</span>
|
|
</td>
|
|
<td style="padding:0.5rem 0.75rem; color:var(--color-muted-foreground); white-space:nowrap;">
|
|
{% if att.uploaded_by %}{{ att.uploaded_by.short_name|default:att.uploaded_by.get_full_name }} · {% endif %}{{ att.created_at|date:"d.m H:i" }}
|
|
</td>
|
|
<td style="padding:0.5rem 0.75rem; text-align:right; color:var(--color-muted-foreground); white-space:nowrap;">
|
|
{% if att.size %}{{ att.size|filesizeformat }}{% endif %}
|
|
</td>
|
|
<td style="padding:0.5rem 0.75rem; text-align:right; width:1%; white-space:nowrap;">
|
|
{% if att.can_delete %}
|
|
<form method="post" action="{% url 'task_attachment_delete' task.pk att.pk %}"
|
|
hx-post="{% url 'task_attachment_delete' task.pk att.pk %}"
|
|
hx-target="#task-attachments-slot" hx-swap="innerHTML"
|
|
hx-confirm="{% trans 'Удалить файл?' %}"
|
|
style="display:inline; margin:0;">
|
|
{% csrf_token %}
|
|
<button type="submit" class="nc-file-act nc-file-act-danger">{% trans "Удалить" %}</button>
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div style="padding:0.5rem 0; font-size:0.8125rem; color:var(--color-muted-foreground); margin-bottom:0.75rem;">
|
|
{% trans "Файлов пока нет" %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="nc-file-toolbar">
|
|
<form method="post" action="{% url 'task_attachment_upload' task.pk %}"
|
|
hx-post="{% url 'task_attachment_upload' task.pk %}"
|
|
hx-target="#task-attachments-slot" hx-swap="innerHTML"
|
|
hx-encoding="multipart/form-data"
|
|
enctype="multipart/form-data"
|
|
class="nc-drop">
|
|
{% csrf_token %}
|
|
<label class="nc-drop-label">
|
|
<input type="file" name="file" class="nc-drop-input" multiple>
|
|
<span class="nc-drop-text">
|
|
<strong class="nc-drop-title">{% trans "Загрузить файл" %}</strong>
|
|
<span class="nc-drop-name">{% trans "или перетащите сюда / в список" %}</span>
|
|
</span>
|
|
</label>
|
|
<button type="submit" class="btn btn-primary"
|
|
style="font-size:0.8125rem; white-space:nowrap;">{% trans "Загрузить" %}</button>
|
|
</form>
|
|
</div>
|
|
</div>
|