avtopost.kultmost.ru/templates/profile/partner/exhibitions.html
2026-09-04 05:10:12 -04:00

113 lines
4.8 KiB
HTML

{% extends "base.html" %}
{% import "/components/header.html" as header %}
{% import "/components/footer.html" as footer %}
{% import "components/profile_card.html" as profile_card %}
{% import "components/profile_nav.html" as profile_nav %}
{% import "competition/list.html" as competition %}
{% block title %}Мои выставки{% endblock %}
{% block content %}
{{ header.section(user) }}
<section class="c_dg3k4">
<div class="c_gtoe9">
{{ profile_card.profile_card(user) }}
<div class="c_ru432">
{{ profile_nav.profile_nav(user, 'exhibitions') }}
<div class="c_3ihvi" id="main"><a class="c_ctfod b_289i1 ba" href="/form/exhibition"><span class="c_d2l0b b_al8e7">Добавить</span></a></div>
<div class="c_tihtk">
{% for i in data %}
<article class="c_9fgdh b_ax8vz">
<a href="/profile/partner/exhibition/{{i._id}}{% if i.status == 0 %}/catalog{%endif%}#main">
<div class="b_ornr9">
<picture>
<img src="/b/exhibition/{{i.poster_file_id}}" data-src="/b/exhibition/{{i.poster_orig_id}}" id="preview_poster" crossorigin="anonymous" fetchpriority="high" loading="eager" alt="Загрузите афишу" class="b_ornr9">
</picture>
</div>
</a>
<div class="c_z3dpx b_73p10">
<a class="b_73p10" href="/profile/partner/exhibition/{{i._id}}{% if i.status == 0 %}/catalog{%endif%}#main">
<div class="c_c4wam b_vabj9">
{% if now > i.date_finish %}
<span class="c_95csi b_0jst1">Закончилась</span>
{% elif now > i.datetime_start %}
<span class="c_95csi b_0jst1">Началась</span>
{% else %}
<span class="c_95csi b_0jst1">Формируется</span>
{% endif %}
</div>
<header class="c_m876y b_9xtz9">
<h3 class="c_hysjg b_8f3uh" id="preview_title">{{i.title}}</h3>
</header>
<p class="c_2fr39 b_tfnz2" id="preview_topic">{{i.topic}}</p>
{% if i.user %}
<div class="c_dbbe4 b_otttb">
<img crossorigin="anonymous" fetchpriority="high" loading="eager" class="c_pm80w b_a68fq" src="/a/{{i.user._id}}" alt="{{ i.user.username | e }}">
<div class="c_4402p b_ntazj">
<p class="c_kvah4 b_ghosy">{{ i.user.username }}</p>
</div>
</div>
{% endif %}
<p class="c_2fr39 b_tfnz2">Подробнее</p>
</a>
<div class="b_otttb"><a class="c_2fr39 b_tfnz2" href="/form/exhibition/{{i._id}}">Редактировать</a><span onclick="deleteExhibition(this, '{{i._id}}')" class="c_2fr39 b_tfnz2">Удалить</span></div>
<p class="c_drpqj b_mp1wb">{{ ( i._id.generation_time.strftime('%d.%m.%Y')) if i._id else ''}}</p>
</div>
</article>
{% endfor %}
</div>
</div>
</div>
</section>
<script>
// @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause
async function deleteExhibition(btn, _id) {
const article = btn.closest('article');
try {
const res = await fetch('/api/partner/exhibition/delete', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ exhibition_id: _id })
});
if (!res.ok) throw new Error(await res.text());
if (article) article.remove();
} catch (err) {
console.error('Delete failed:', err);
}
}
// @license-end
</script>
{{ footer.section(user) }}
{% endblock %}
{% block head %}
{{ header.style() }}
{{ profile_nav.style() }}
{{ competition.style() }}
<style>
body{background: #F6EBFF;}
#preview_poster{min-height: 456px;}
/* Mobile */
@media (max-width: 699px) {
.c_mrl59 { align-items: center; background: #5F1798; border-radius: 25px; bottom: -15px; display: flex; height: 50px; justify-content: center; position: absolute; right: -15px; width: 50px; }
}
/* Tablet */
@media (min-width: 700px) and (max-width: 900px) {
.c_iiehk { align-items: center; border-radius: 5px; display: flex; flex-direction: column; gap: 20px; width: 335px; }
.c_nnsh6>a>img{display: none;}
}
.b_ornr9 { align-self: stretch; height: auto; overflow: hidden;}
/* Desktop */
@media (min-width: 901px) {
.c_iiehk { align-items: flex-end; border-radius: 5px; display: flex; flex-direction: column; gap: 20px; width: 310px; }
.c_nnsh6>a>img{display: none;}
}</style>
{{ footer.style() }}
{% endblock %}