Bot commit: Добавлен файл templates/competition/card.html

This commit is contained in:
Vladislav 2026-06-30 19:13:51 -04:00
parent 7764ce4c01
commit ac4fc8309e

View File

@ -0,0 +1,154 @@
{% import "components/share.html" as share %}
{% macro section(competition, profile=False, link=False) -%}
<article class="c_9fgdh b_ax8vz" id="l{{competition._id}}">
{% if link %}
<a href="{{link}}">
{% endif %}
<div class="b_ornr9">
<picture>
<img crossorigin="anonymous" fetchpriority="high" loading="eager" alt="{{ competition.title }}" class="b_ornr9"
src="/b/competition/{{ competition.poster_file_id }}">
</picture>
</div>
{% if link %}
</a>
{% endif %}
<div class="c_z3dpx b_73p10">
{% if link %}
<a href="{{link}}" class="b_73p10">
{% endif %}
{% if competition.get('status',-1) == 2 %}
<div class="b_vabj9_2">
<span class="b_0jst1_2">Закончился</span>
</div>
{% elif competition.get('status',-1) == 1 %}
<div class="b_vabj9_2">
<span class="b_0jst1_2">Идет отбор</span>
</div>
{% else %}
<div class="b_vabj9">
<span class="b_0jst1">{{ {-1:'Формируется',0:'Прием заявок',1:'Идет отбор',2:'Закончился'}[competition.get('status',-1)] }}</span>
</div>
{% endif %}
<header class="c_m876y b_9xtz9">
<h3 class="c_hysjg b_8f3uh">{{ competition.title }}</h3>
</header>
<p class="c_2fr39 b_tfnz2">{{ competition.topic }}</p>
{% if profile %}
<button class="c_aq9et">
<span class="c_som9s">Посмотреть заявки</span>
</button>
{% else %}
{% set user = competition.get('user') %}
<div class="c_dbbe4 b_otttb">
{% if user %}
<img class="c_pm80w b_a68fq" src="/a/{{user._id}}" alt="{{ user.username | e }}" crossorigin="anonymous" fetchpriority="high" loading="eager">
<div class="c_4402p b_ntazj">
<p class="c_kvah4 b_ghosy">{{ user.username | e }}</p>
</div>
{% endif %}
</div>
<p class="c_sihck b_s6ool">{{ competition.short_desc }}</p>
{% endif %}
{% if link %}
</a>
{% endif %}
<div class="fl">
<span class="c_2fr39 b_tfnz2" style="z-index: 2;">
{{ share.share('/competition/{}'.format(competition._id), competition.title, '/b/competition/{}'.format(competition.poster_file_id), "Приглашаю на конкурс 🎨") }}
</span>
</div>
{% if profile %}
<!-- {% if competition.get('publish') is none %}
<div class="fl">
<span class="c_2fr39 b_tfnz2">Публикация запланирована на</span>
</div>
{{ (competition.datetime_start.strftime('%Y.%m.%d %H:%M' )) if competition.datetime_start else ''}}
{% endif %} -->
<label class="offer-label">
<input type="checkbox" id="emailsNotify" class="offer-checkbox">
<span class="offer-text">Рассылка художникам приглашения на почту</span>
</label>
<label class="offer-label">
<input type="checkbox" id="serviceSocial" class="offer-checkbox">
<span class="offer-text">Публикация в соц. сетях сервиса</span>
</label>
<label class="offer-label">
<input type="checkbox" id="userSocial" class="offer-checkbox">
<span class="offer-text">Публикация в личных соц. сетях</span>
</label>
<label class="offer-label">
<input type="checkbox" id="usersSocial" class="offer-checkbox">
<span class="offer-text">Публикация в соц. сетях Художников</span>
</label>
<button class="c_aq9et" id="rePublishCompetition" data-competition_id="{{competition._id}}">
<span class="c_som9s">{% if competition.get('publish') is none %}Опубликовать{% else %}Опубликовать повторно{% endif %}</span>
</button>
<div class="fl">
<a class="c_2fr39 b_tfnz2" href="/form/competition/{{competition._id}}">Редактировать</a>
<span class="c_2fr39 b_tfnz2" id="deleteBtn" data-competition_id="{{competition._id}}">Удалить</span>
</div>
{% else %}
<a class="c_aq9et" href="{% if competition.get('rules_link') %}{{competition.rules_link}}{% else %}/b/competition/{{ competition.rules_file_id }}{% endif %}" rel="noopener noreferrer">
<span class="c_som9s">Условия конкурса</span>
</a>
{% if competition.user._id == '681684390000000000000000'%}
<a class="c_aq9et" href="https://vk.ru/im?sel=25126640" rel="noopener noreferrer">
<span class="c_som9s">Задать вопрос</span>
</a>
{% endif %}
<!-- TODO -->
<a class="c_aq9et" href="/profile/competition/{{competition._id}}#main">
<span class="c_som9s">Подать заявку</span>
</a>
{% endif %}
<p class="c_drpqj b_mp1wb">{{ (competition.datetime_start.strftime('%d.%m.%Y')) if competition.datetime_start else ''}}</p>
</div>
</article>
{%- endmacro %}
{% macro style() -%}
<style type="text/css">/* Base (common) styles */
.c_aq9et {
cursor: pointer;
transition: transform 0.1s linear, box‑shadow 0.1s linear;
box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.c_aq9et:active {
transform: scale(0.9);
box-shadow: 5px 5px 5px rgba(95, 23, 152, 0.32);
}
article>a{width: 100%;}
picture>img{ width: 100%; object-fit: scale-down; }
.fl{display: flex;justify-content: space-between;width: 100%;}
.c_som9s { color: #FFF; font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; }
.c_aq9et { display: flex; padding: 19px 33px; justify-content: center; align-items: center; align-self: stretch; border-radius: 5px; background: #5F1798; }
.b_ornr9 { align-self: stretch; overflow: hidden;}
.b_0jst1 { color: #0ED646; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 700; line-height: normal; }
.b_vabj9 { align-items: center; background: rgba(14, 214, 70, 0.20); border-radius: 30px; display: flex; justify-content: center; padding: 1.5px 10px; }
.b_0jst1_2 { color: #5F1798; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 700; line-height: normal; }
.b_vabj9_2 { align-items: center; background: #5e17982f; border-radius: 30px; display: flex; justify-content: center; padding: 1.5px 10px; }
.b_8f3uh { -webkit-box-orient: vertical; -webkit-line-clamp: 1; color: #000; display: -webkit-box; flex: 1 0 0; font-family: Inter; font-size: 24px; font-style: normal; font-weight: 700; line-height: normal; overflow: hidden; text-overflow: ellipsis; }
.b_9xtz9 { align-items: center; align-self: stretch; display: flex; justify-content: center; }
.b_tfnz2 { align-self: stretch; color: #5F1798; font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; cursor: pointer; }
.b_a68fq { aspect-ratio: 1/1; border-radius: 50px; height: 50px; width: 50px; object-fit: cover; }
.b_ghosy { align-self: stretch; color: #000; font-family: Inter; font-size: 16px; font-style: normal; font-weight: 400; line-height: normal; }
.b_ntazj { align-items: flex-start; display: flex; flex-direction: column; flex: 1 0 0; justify-content: center; }
.b_otttb { align-items: center; align-self: stretch; display: flex; gap: 13px; height: 50px; }
.b_s6ool { height: 51px; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 3; align-self: stretch; color: rgba(58, 58, 58, 0.75); display: -webkit-box; font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; overflow: hidden; text-overflow: ellipsis; }
.b_mp1wb { align-self: stretch; color: rgba(58, 58, 58, 0.75); font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; text-align: right; }
.b_73p10 { align-items: flex-start; align-self: stretch; background: #FFF; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.c_z3dpx{ padding: 10px 20px;}
.b_ax8vz { align-items: flex-start; border-radius: 10px; border: 1px solid #5F1798; box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.30), 0 4px 20px 0 rgba(0, 0, 0, 0.20); display: flex; flex-direction: column; width: 335px; overflow: hidden;}
@media (min-width: 901px) {
.c_9fgdh { align-items: flex-start; border-radius: 10px; border: 1px solid #5F1798; box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.30), 0 4px 20px 0 rgba(0, 0, 0, 0.20); display: flex; flex-direction: column; flex-shrink: 0; width: 335px; }
}
@media (max-width: 699px) {
.b_ornr9{height: auto;}
}
</style>
{%- endmacro %}