208 lines
9.9 KiB
HTML
208 lines
9.9 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 "/components/contacts.html" as contacts %}
|
||
|
||
{% 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, 'invitation') }}
|
||
<div class="c_tihtk" id="main">
|
||
{% for doc in data %}
|
||
<article class="c_9fgdh b_ax8vz" id="l{{doc._id}}">
|
||
<div class="c_z3dpx b_73p10">
|
||
<div class="b_vabj9_2">
|
||
<span class="b_0jst1_2">{{doc.type}}</span>
|
||
</div>
|
||
<header class="c_m876y b_9xtz9">
|
||
<h3 class="c_hysjg b_8f3uh">{{ doc.title }}</h3>
|
||
</header>
|
||
{% if doc.get('type_')=='paint' %}
|
||
<a class="btn ba" href="/profile/invitation/{{doc._id}}#main" style="width: 100%;">Открыть</a>
|
||
{% endif %}
|
||
{% if doc.get('type') == 'Выставка' %}
|
||
<img src="/b/exhibition/{{doc.get('exhibition').get('poster_orig_id')}}"
|
||
style="max-width: 100%;">
|
||
<p class="c_2fr39 b_tfnz2">{{doc.get('exhibition').title }}</p>
|
||
<p>Место проведения: {{ doc.get('exhibition').get('place') }}</p>
|
||
<div class="b_otttb">
|
||
<span class="c_2fr39 b_tfnz2">С {{ ( doc.get('exhibition').datetime_start.strftime('%d.%m.%Y')) if
|
||
doc.get('exhibition').datetime_start
|
||
else ''}}</span>
|
||
<span class="c_2fr39 b_tfnz2">По {{ ( doc.get('exhibition').date_finish.strftime('%d.%m.%Y')) if
|
||
doc.get('exhibition').date_finish else
|
||
''}}</span>
|
||
</div>
|
||
|
||
{% if doc.get('exhibition').get('tizer_file_id') or doc.get('exhibition').get('tizer_link') %}
|
||
<a class="btn ba"
|
||
href="{% if doc.get('exhibition') and doc.get('exhibition').get('tizer_link') %}{{doc.get('exhibition').tizer_link}}{% else %}/b/exhibition/{{ doc.get('exhibition').tizer_file_id }}{% endif %}"
|
||
style="width: 100%;">Релиз выставки</a>
|
||
{% endif %}
|
||
<p class="c_2fr39 b_tfnz2">Принять условия нужно до {{doc.get('exhibition').datetime_start.strftime('%d.%m.%Y')}}</p>
|
||
{% if doc.get('accept') == False and now < doc.get('exhibition').datetime_start %}
|
||
<a class="btn ba" href="/profile/invitation/{{doc._id}}#main" style="width: 100%;">Открыть</a>
|
||
<!-- <button onclick="accept_inv('{{doc._id}}')" class="btn" href="/profile/delivery#main" style="width: 100%; box-sizing: border-box;">Принять условия</button> -->
|
||
{% else %}
|
||
<a class="btn ba"
|
||
href="{% if doc.get('exhibition') and doc.get('exhibition').get('rules_link') %}{{doc.get('exhibition').rules_link}}{% else %}/b/exhibition/{{ doc.get('exhibition').rules_file_id }}{% endif %}"
|
||
style="width: 100%;">Условия выставки</a>
|
||
{% endif %}
|
||
{% else %}
|
||
{% if doc.get('type_')=='paint' %}
|
||
<p class="c_2fr39 b_tfnz2">"{{ doc.get('item') }}"</p>
|
||
{%else%}
|
||
<p class="c_2fr39 b_tfnz2">"{{ doc.get('item') }}" просьба связаться с организатором для обсуждения
|
||
дальнейших действий</p>
|
||
{% endif %}
|
||
{% endif %}
|
||
<!-- <p class="c_sihck b_s6ool">От</p> -->
|
||
{% set user_contact = doc.get('user') %}
|
||
{{render_user_contacts(user_contact)}}
|
||
<p class="c_drpqj b_mp1wb">{{ (doc._id.generation_time.strftime('%d.%m.%Y')) if doc._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 accept_inv(inv_id) {
|
||
try {
|
||
const res = await fetch(`/api/invitation/accept/${inv_id}`, {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
});
|
||
|
||
if (res.ok) {
|
||
showToast({ message: 'Приглашение принято. Перенаправляем на страницу доставки' });
|
||
setTimeout(() => {
|
||
window.location.href = '/profile/delivery#main';
|
||
}, 800);
|
||
} else {
|
||
showToast({ message: 'Не удалось принять приглашение', status: 'error' });
|
||
}
|
||
} catch (e) {
|
||
showToast({ message: 'Ошибка сети/сервера', status: 'error' });
|
||
}
|
||
}
|
||
// @license-end
|
||
</script>
|
||
|
||
{{ footer.section(user) }}
|
||
{% endblock %}
|
||
{% macro render_user_contacts(user) %}
|
||
{% if user %}
|
||
<div class="c_dbbe4 b_otttb">
|
||
<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>
|
||
</div>
|
||
{{ contacts.details(user) }}
|
||
{% endif %}
|
||
{% endmacro %}
|
||
{% block head %}
|
||
{{ header.style() }}
|
||
{{ profile_nav.style() }}
|
||
{{ contacts.style() }}
|
||
<style>
|
||
/* 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; height: 400px; 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; }
|
||
.b_s6ool { 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>
|
||
<style>
|
||
.menua{width: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 7px;
|
||
margin: 10px 20px;}
|
||
.icona{display: flex;
|
||
gap: 10px;
|
||
align-items: center;}
|
||
.icona>span{color: #5F1798;}
|
||
.c_hysjg {
|
||
color: #0ED646;
|
||
font-family: Inter;
|
||
/* font-size: 12px; */
|
||
font-style: normal;
|
||
font-weight: 700;
|
||
line-height: normal;
|
||
}
|
||
/* .c_m876y{align-items: center;
|
||
background: rgba(14, 214, 70, 0.20);
|
||
border-radius: 30px;
|
||
display: flex;
|
||
justify-content: center;
|
||
padding: 1.5px 10px;} */
|
||
/* 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;}
|
||
|
||
}
|
||
|
||
/* 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 %} |