030bbc98fd
Шаблоны/ручное создание, access_projects, сид «Открытие аптеки». Плюс SILO/S3 для Django media. Co-authored-by: Cursor <cursoragent@cursor.com>
110 lines
6.7 KiB
HTML
110 lines
6.7 KiB
HTML
{% load i18n %}
|
||
<div class="page-content">
|
||
<div style="margin-bottom:1rem;">
|
||
<a href="{% url 'projects' %}" hx-get="{% url 'projects' %}" hx-target="#main-content" hx-push-url="{% url 'projects' %}" hx-indicator="#loader"
|
||
style="font-size:0.8125rem; color:var(--color-primary); text-decoration:none;">← {% trans "К списку проектов" %}</a>
|
||
</div>
|
||
|
||
{% if ug_message %}
|
||
<div style="margin-bottom:1rem; padding:0.625rem 0.875rem; border-radius:0.5rem; font-size:0.8125rem; color:#137333; background:rgba(19,115,51,0.1); border:1px solid rgba(19,115,51,0.25);">{{ ug_message }}</div>
|
||
{% endif %}
|
||
{% if ug_error %}
|
||
<div style="margin-bottom:1rem; padding:0.625rem 0.875rem; border-radius:0.5rem; font-size:0.8125rem; color:#d63333; background:rgba(214,51,51,0.1); border:1px solid rgba(214,51,51,0.25);">{{ ug_error }}</div>
|
||
{% endif %}
|
||
|
||
<div style="display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-bottom:1.25rem; align-items:flex-start;">
|
||
<div>
|
||
<h1 style="font-size:1.25rem; font-weight:500; margin:0;">{{ project.title }}</h1>
|
||
<p style="font-size:0.8125rem; color:var(--color-muted-foreground); margin:0.35rem 0 0;">
|
||
{{ project.get_status_display }}
|
||
{% if project.template %} · {{ project.template.name }}{% endif %}
|
||
{% if project.pharmacy %} · {{ project.pharmacy }}{% endif %}
|
||
{% if project.start_date %} · {% trans "с" %} {{ project.start_date }}{% endif %}
|
||
{% if project.due_date %} · {% trans "до" %} {{ project.due_date }}{% endif %}
|
||
</p>
|
||
{% if project.description %}
|
||
<p style="font-size:0.875rem; margin:0.75rem 0 0; max-width:40rem;">{{ project.description }}</p>
|
||
{% endif %}
|
||
</div>
|
||
{% if can_manage and project.status == 'draft' %}
|
||
<form method="post" action="{% url 'project_activate' project.pk %}" style="margin:0;">
|
||
{% csrf_token %}
|
||
<button type="submit" class="btn btn-primary">{% trans "Запустить проект" %}</button>
|
||
</form>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div style="margin-bottom:1.5rem; max-width:28rem;">
|
||
<div style="display:flex; justify-content:space-between; font-size:0.75rem; color:var(--color-muted-foreground); margin-bottom:0.35rem;">
|
||
<span>{% trans "Прогресс" %}</span>
|
||
<span>{{ done_count }}/{{ total_count }} · {{ pct }}%</span>
|
||
</div>
|
||
<div style="height:0.45rem; background:var(--color-muted); border-radius:999px; overflow:hidden;">
|
||
<div style="height:100%; width:{{ pct }}%; background:var(--color-primary);"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<h2 style="font-size:0.9375rem; font-weight:500; margin:0 0 0.75rem;">{% trans "Шаги" %}</h2>
|
||
|
||
{% for step in project.steps.all %}
|
||
<div style="background:var(--color-card); border:1px solid var(--color-border); border-radius:0.75rem; padding:1rem 1.15rem; margin-bottom:0.75rem;">
|
||
<div style="display:flex; justify-content:space-between; gap:0.75rem; flex-wrap:wrap; align-items:flex-start;">
|
||
<div>
|
||
<div style="font-size:0.9375rem; font-weight:500;">{{ step.order|add:1 }}. {{ step.title }}</div>
|
||
<div style="font-size:0.75rem; color:var(--color-muted-foreground); margin-top:0.2rem;">
|
||
{% if step.department %}{{ step.department.name }} · {% endif %}
|
||
{{ step.get_status_display }}
|
||
{% if step.planned_due %} · {% trans "до" %} {{ step.planned_due }}{% endif %}
|
||
</div>
|
||
</div>
|
||
{% if can_manage and project.status != 'cancelled' %}
|
||
{% if step.items.all %}
|
||
<form method="post" action="{% url 'project_step_activate' project.pk step.pk %}" style="margin:0;">
|
||
{% csrf_token %}
|
||
<button type="submit" class="btn btn-secondary" style="font-size:0.75rem;">{% trans "Создать задачи шага" %}</button>
|
||
</form>
|
||
{% endif %}
|
||
{% endif %}
|
||
</div>
|
||
<ul style="list-style:none; margin:0.75rem 0 0; padding:0;">
|
||
{% for item in step.items.all %}
|
||
<li style="display:flex; align-items:center; gap:0.5rem; padding:0.4rem 0; border-top:1px solid var(--color-border); font-size:0.8125rem;">
|
||
{% if item.task %}
|
||
<a href="{% url 'task_detail' item.task.pk %}"
|
||
hx-get="{% url 'task_detail' item.task.pk %}" hx-target="#main-content" hx-push-url="{% url 'task_detail' item.task.pk %}" hx-indicator="#loader"
|
||
style="color:var(--color-primary); text-decoration:none; flex:1;">
|
||
{{ item.title }}
|
||
<span style="color:var(--color-muted-foreground); font-size:0.75rem;"> · {{ item.task.get_status_display }}</span>
|
||
</a>
|
||
{% else %}
|
||
<span style="flex:1; color:var(--color-muted-foreground);">{{ item.title }} <em>({% trans "задача ещё не создана" %})</em></span>
|
||
{% endif %}
|
||
</li>
|
||
{% empty %}
|
||
<li style="font-size:0.8125rem; color:var(--color-muted-foreground); padding-top:0.5rem;">{% trans "Нет пунктов" %}</li>
|
||
{% endfor %}
|
||
</ul>
|
||
</div>
|
||
{% empty %}
|
||
<p style="color:var(--color-muted-foreground); font-size:0.875rem;">{% trans "Шагов пока нет." %}</p>
|
||
{% endfor %}
|
||
|
||
{% if can_manage and project.status != 'cancelled' and project.status != 'done' %}
|
||
<div style="margin-top:1.5rem; background:var(--color-card); border:1px solid var(--color-border); border-radius:0.75rem; padding:1.15rem;">
|
||
<h3 style="font-size:0.875rem; font-weight:500; margin:0 0 0.75rem;">{% trans "Добавить шаг" %}</h3>
|
||
<form method="post" action="{% url 'project_add_step' project.pk %}">
|
||
{% csrf_token %}
|
||
<input type="text" name="title" required class="input" style="width:100%; margin-bottom:0.5rem;" placeholder="{% trans 'Название шага' %}">
|
||
<select name="department_id" class="input" style="width:100%; margin-bottom:0.5rem;">
|
||
<option value="">{% trans "Отдел…" %}</option>
|
||
{% for d in departments %}
|
||
<option value="{{ d.id }}">{{ d.name }}</option>
|
||
{% endfor %}
|
||
</select>
|
||
<textarea name="items" class="input" rows="3" style="width:100%; margin-bottom:0.75rem;" placeholder="{% trans 'Задачи, каждая с новой строки' %}"></textarea>
|
||
<button type="submit" class="btn btn-primary">{% trans "Добавить" %}</button>
|
||
</form>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|