feat: add photos to daily reports

This commit is contained in:
Арсентьев Александр
2026-10-15 14:42:04 +03:00
parent 1af2a70406
commit 3a3e481750
14 changed files with 1765 additions and 20 deletions
@@ -46,6 +46,37 @@
</tr>
{% else %}<tr><td colspan="8" class="text-center text-muted py-4">В отчёте нет рабочих позиций.</td></tr>{% endfor %}</tbody>
</table></div></div>
<section class="card mt-4" id="photo-section">
<div class="card-header d-flex justify-content-between align-items-center">
<strong>Фотоотчёт</strong>
<span class="text-muted small">{{ photos|length }} фото</span>
</div>
<div class="card-body">
{% if photos %}
<div class="row g-2">
{% for photo in photos %}
<div class="col-6 col-md-3 col-lg-2">
<a href="/projects/{{ project.id }}/daily-reports/{{ report.id }}/photos/{{ photo.id }}"
target="_blank" rel="noopener" class="d-block">
<img class="img-fluid rounded border w-100"
style="aspect-ratio: 4 / 3; object-fit: cover;"
src="/projects/{{ project.id }}/daily-reports/{{ report.id }}/photos/{{ photo.id }}"
alt="{{ photo.original_name or ('Фото ' ~ photo.id) }}"
loading="lazy">
</a>
<div class="small text-muted text-truncate" title="{{ photo.original_name or '' }}">
{{ photo.original_name or ('Фото ' ~ photo.id) }}
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-muted">Фотографии не прикреплены. Их можно добавить при редактировании отчёта.</div>
{% endif %}
</div>
</section>
<div class="mt-3"><a href="/projects/{{ project.id }}/daily-reports" class="btn btn-outline-secondary">К списку отчётов</a></div>
</main>
</body>