morozovka-portal/app/templates/project_detail.html
2026-10-20 03:27:14 +03:00

99 lines
5.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>{{ project.title }} — Morozovka Portal</title>
<style>
body { background: #0d1117; color: #e6edf3; font-family: sans-serif; padding: 40px; }
.container { max-width: 800px; margin: 0 auto; }
h1 { color: #58a6ff; margin-top: 0; margin-bottom: 10px; }
.badges { display: flex; gap: 10px; margin-bottom: 20px; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; }
.status-in_progress { background: #1f6feb; color: white; }
.status-idea { background: #30363d; color: white; }
.status-completed { background: #238636; color: white; }
.status-frozen { background: #da3633; color: white; }
.vis-public { background: rgba(63,185,80,0.2); color: #3fb950; border: 1px solid #3fb950; }
.vis-internal { background: rgba(210,153,34,0.2); color: #d29922; border: 1px solid #d29922; }
.vis-private { background: rgba(248,81,73,0.2); color: #f85149; border: 1px solid #f85149; }
.desc { font-size: 1.1rem; line-height: 1.6; color: #c9d1d9; margin-bottom: 30px; white-space: pre-wrap; }
.repo-btn { display: inline-block; background: #21262d; color: #58a6ff; text-decoration: none; padding: 10px 20px; border-radius: 5px; border: 1px solid #30363d; font-weight: bold; margin-bottom: 30px; }
.section-title { border-bottom: 1px solid #30363d; padding-bottom: 10px; margin-bottom: 20px; color: #8b949e; font-size: 1.2rem; }
.members-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 30px; }
.member { background: #161b22; border: 1px solid #30363d; padding: 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.member-name { font-weight: bold; }
.member-role { font-size: 0.75rem; color: #8b949e; text-transform: uppercase; }
.member-role.lead { color: #d29922; }
.add-member-form { display: flex; gap: 10px; margin-bottom: 40px; }
.add-member-form input { flex: 1; padding: 10px; background: #0d1117; border: 1px solid #30363d; border-radius: 5px; color: white; }
.btn { background: #238636; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; text-decoration: none; }
.btn:hover { background: #2ea043; }
.btn-danger { background: #da3633; }
.btn-danger:hover { background: #f85149; }
.back-link { display: block; margin-bottom: 20px; color: #8b949e; text-decoration: none; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
</style>
</head>
<body>
<div class="container">
<a href="/projects" class="back-link">← К проектам</a>
<div style="display: flex; justify-content: space-between; align-items: start;">
<div>
<h1>{{ project.title }}</h1>
<div class="badges">
<span class="badge status-{{ project.status }}">{{ project.status }}</span>
<span class="badge vis-{{ project.visibility }}">{{ project.visibility }}</span>
</div>
</div>
<div class="actions">
{% if role == 'admin' or project.owner_id == user_id or (is_member and role == 'lead') %}
<a href="/projects/{{ project.id }}/edit" class="btn" style="background: #21262d; border: 1px solid #30363d;">Редактировать</a>
{% endif %}
{% if role == 'admin' or project.owner_id == user_id %}
<form action="/projects/{{ project.id }}/delete" method="POST" onsubmit="return confirm('Удалить проект?');">
<button type="submit" class="btn btn-danger">Удалить</button>
</form>
{% endif %}
</div>
</div>
<div class="desc">{{ project.description or 'Описание пока не добавлено.' }}</div>
{% if project.gitea_url %}
<a href="{{ project.gitea_url }}" target="_blank" class="repo-btn">📦 Перейти в репозиторий Gitea</a>
{% endif %}
<h2 class="section-title">Участники ({{ members|length }})</h2>
<div class="members-list">
{% for member_obj, user in members %}
<div class="member">
<div>
<div class="member-name">{{ user.full_name or user.username }}</div>
<div class="member-role {{ member_obj.role }}">{{ member_obj.role }}</div>
</div>
{% if (role == 'admin' or project.owner_id == user_id or (is_member and role == 'lead')) and user.id != project.owner_id %}
<form action="/projects/{{ project.id }}/members/{{ user.id }}/remove" method="POST" onsubmit="return confirm('Удалить участника?');">
<button type="submit" style="background:none; border:none; color:#da3633; cursor:pointer;">✕</button>
</form>
{% endif %}
</div>
{% endfor %}
</div>
{% if role == 'admin' or project.owner_id == user_id or (is_member and role == 'lead') %}
<h3 style="color:#8b949e; margin-bottom: 10px;">Добавить участника</h3>
<form action="/projects/{{ project.id }}/members/add" method="POST" class="add-member-form">
<input type="text" name="username" placeholder="Введите логин пользователя (например, testuser)" required>
<button type="submit" class="btn">Добавить</button>
</form>
{% endif %}
</div>
</body>
</html>