80 lines
4.3 KiB
HTML
80 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="ru">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<title>Проекты — Morozovka Portal</title>
|
||
<style>
|
||
body { background: #0d1117; color: #e6edf3; font-family: sans-serif; padding: 40px; }
|
||
.container { max-width: 1000px; margin: 0 auto; }
|
||
h1 { color: #58a6ff; margin-top: 0; }
|
||
.header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
|
||
.btn-add { background: #238636; color: white; text-decoration: none; padding: 10px 20px; border-radius: 5px; font-weight: bold; }
|
||
.btn-add:hover { background: #2ea043; }
|
||
|
||
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
|
||
.card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 20px; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color 0.2s; }
|
||
.card:hover { border-color: #58a6ff; }
|
||
.card h3 { margin: 0 0 10px 0; color: #e6edf3; }
|
||
.card p { color: #8b949e; font-size: 0.9rem; flex-grow: 1; margin-bottom: 15px; }
|
||
|
||
.badges { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
|
||
.badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; }
|
||
.status-idea { background: #30363d; color: white; }
|
||
.status-in_progress { background: #1f6feb; 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; }
|
||
|
||
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; border-top: 1px solid #30363d; padding-top: 15px; font-size: 0.85rem; }
|
||
.repo-link { color: #58a6ff; text-decoration: none; }
|
||
.delete-btn { background: none; border: none; color: #da3633; cursor: pointer; font-size: 0.85rem; padding: 0; }
|
||
.delete-btn:hover { text-decoration: underline; }
|
||
.back-link { display: block; margin-bottom: 20px; color: #8b949e; text-decoration: none; }
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<a href="/" class="back-link">← На главную</a>
|
||
<div class="header-actions">
|
||
<h1>Каталог проектов</h1>
|
||
{% if role in ['admin', 'professor', 'lead'] %}
|
||
<a href="/projects/new" class="btn-add">+ Добавить проект</a>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div class="grid">
|
||
{% for proj in projects %}
|
||
<a href="/projects/{{ proj.id }}" class="card">
|
||
<div class="badges">
|
||
<span class="badge status-{{ proj.status }}">
|
||
{% if proj.status == 'idea' %}Идея
|
||
{% elif proj.status == 'in_progress' %}В работе
|
||
{% elif proj.status == 'completed' %}Завершён
|
||
{% else %}Заморожен{% endif %}
|
||
</span>
|
||
<span class="badge vis-{{ proj.visibility }}">
|
||
{% if proj.visibility == 'public' %}Публичный
|
||
{% elif proj.visibility == 'internal' %}Внутренний
|
||
{% else %}Приватный{% endif %}
|
||
</span>
|
||
</div>
|
||
<h3>{{ proj.title }}</h3>
|
||
<p>{{ proj.description or 'Описание отсутствует.' }}</p>
|
||
<div class="card-footer">
|
||
<span style="color: #8b949e;">Подробнее →</span>
|
||
{% if proj.gitea_url %}
|
||
<span class="repo-link">📦 Есть репозиторий</span>
|
||
{% endif %}
|
||
</div>
|
||
</a>
|
||
{% else %}
|
||
<p style="color: #8b949e;">Доступных проектов пока нет.</p>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html>
|