This commit is contained in:
Vladislav 2026-07-20 21:09:57 -04:00
parent 7b5e49ba3c
commit 0fd1efa3c0
12 changed files with 35 additions and 18 deletions

View File

@ -4051,7 +4051,7 @@
" user: Dict = Security(get_current_user)\n",
"):\n",
" data = await invitations_collection.find({'prod': PROD,'user_id': user.get('_id')}).sort('_id', -1).to_list()\n",
" \n",
" await notify_collection.update_many({'user_id':user.get('_id')},{\"$set\":{'read':False}})\n",
" return templates.TemplateResponse(\n",
" request=request, name=\"profile/invitations.html\", context={ \"user\": user, \"data\": data}\n",
" )"

View File

@ -3155,7 +3155,7 @@ async def profile_invitation(
user: Dict = Security(get_current_user)
):
data = await invitations_collection.find({'prod': PROD,'user_id': user.get('_id')}).sort('_id', -1).to_list()
await notify_collection.update_many({'user_id':user.get('_id')},{"$set":{'read':False}})
return templates.TemplateResponse(
request=request, name="profile/invitations.html", context={ "user": user, "data": data}
)

View File

@ -770,7 +770,7 @@
" email_task.notify.delay(\n",
" user['email'],\n",
" email_data,\n",
" f'Приглашение на выставку {exhibition.title}',\n",
" f'Приглашение на выставку {exhibition.get('title')}',\n",
" 'main.html'\n",
" )\n",
" \n"

View File

@ -613,7 +613,7 @@ async def exhibition_send_invitations(exhibition_id):
email_task.notify.delay(
user['email'],
email_data,
f'Приглашение на выставку {exhibition.title}',
f'Приглашение на выставку {exhibition.get('title')}',
'main.html'
)

View File

@ -789,6 +789,16 @@ shareBtns.forEach(btn => {
</div>
<style>
.b {
cursor: pointer;
transition: transform 0.1s linear, box‑shadow 0.1s linear;
box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.b:active {
transform: scale(0.9);
box-shadow: 5px 5px 5px rgba(95, 23, 152, 0.32);
}
.some-class{ display: flex;
height: 24px;
gap: 7px;

View File

@ -15,11 +15,11 @@
{% if 'admin' not in user.get('roles', []) %}
{% if 'partner' in user.get('roles', [])%}
{% if 'partner' in user.get('profile', '') %}
<button class="c_6cfr8 b_m2ah9" id="switch-profile">
<button class="c_6cfr8 b_m2ah9 b" id="switch-profile">
<span class="c_d2l0b b_al8e7">Личный кабинет галериста</span>
</button>
{% else %}
<button class="c_6cfr8 b_m2ah9" id="switch-profile">
<button class="c_6cfr8 b_m2ah9 b" id="switch-profile">
<span class="c_d2l0b b_al8e7">Личный кабинет партнера</span>
</button>
{% endif %}

View File

@ -1,10 +1,10 @@
{% macro profile_nav(user, nav) -%}
<div class="c_nnsh6">
{% set delivery_read_cnt = user.notify | selectattr('type', 'equalto', 'delivery') | selectattr('read', 'false') | list | length %}
{% set competition_read_cnt = user.notify | selectattr('type', 'equalto', 'competition') | selectattr('read', 'false') | list | length %}
{% set exhibitions_read_cnt = user.notify | selectattr('type', 'equalto', 'exhibitions') | selectattr('read', 'false') | list | length %}
{% set invation_read_cnt = user.notify | selectattr('type', 'equalto', 'invation') | selectattr('read', 'false') | list | length %}
{% set competition_req_read_cnt = user.notify | selectattr('type', 'equalto', 'competition_req') | selectattr('read', 'false') | list | length %}
{% set delivery_read_cnt = user.notify | selectattr('type', 'equalto', 'delivery') | selectattr('read') | list | length %}
{% set competition_read_cnt = user.notify | selectattr('type', 'equalto', 'competition') | selectattr('read') | list | length %}
{% set exhibitions_read_cnt = user.notify | selectattr('type', 'equalto', 'exhibitions') | selectattr('read') | list | length %}
{% set invation_read_cnt = user.notify | selectattr('type', 'equalto', 'invitation') | selectattr('read') | list | length %}
{% set competition_req_read_cnt = user.notify | selectattr('type', 'equalto', 'competition_req') | selectattr('read') | list | length %}
{% if 'partner' in user.get('profile', '') %}
<a class="{% if nav =='competitions' %}b_ny6vg{%else%}b_cros1{%endif%}" href="/profile/partner/competitions#main">
<span class="{% if nav =='competitions' %}b_ld219{%else%}b_v15gw{%endif%}">Мои конкурсы

View File

@ -43,9 +43,11 @@
</div>
<header class="c_77wsp b_qx462">
<h2 class="c_aiv78 b_6jj0l">{{exhibition.title}}</h2>
{% if exhibition.get('tizer_file_id') or exhibition.get('tizer_link') %}
<a class="c_wcdb7 b_ofiw3" href="{% if exhibition.get('tizer_link') %}{{exhibition.tizer_link}}{% else %}/b/exhibition/{{ exhibition.tizer_file_id }}{% endif %}" rel="noopener noreferrer" style="width: 100%;margin: 10px 0;">
<span class="b_j2ln2">Релиз выставки</span>
</a>
{%endif%}
<p>Место проведения: {{ exhibition.get('place') }}</p>
{% if posts|length > 0 %}
<p>Картины: {{posts|length}}</p>

View File

@ -60,9 +60,11 @@
</div>
{% endif %}
</div>
{% if exhibition.get('tizer_file_id') or exhibition.get('tizer_link') %}
<a class="c_aq9et" href="{% if exhibition.get('tizer_link') %}{{exhibition.tizer_link}}{% else %}/b/exhibition/{{ exhibition.tizer_file_id }}{% endif %}" rel="noopener noreferrer">
<span class="c_som9s">Релиз выставки</span>
</a>
{%endif%}
<a class="c_aq9et" href="{{link}}" rel="noopener noreferrer">
<span class="c_som9s">Открыть</span>
</a>
@ -99,7 +101,7 @@
}
.c_aq9et:active {
transform: scale(0.9);
transform: scale(0.9);
box-shadow: 5px 5px 5px rgba(95, 23, 152, 0.32);
}

View File

@ -181,13 +181,12 @@
showToast({ message: 'Приглашение принято. Перенаправляем на страницу доставки' });
// на всякий случай: не удаляем localStorage сразу (если вдруг навигация сорвётся),
// но можно закомментировать следующую строку при необходимости
// localStorage.removeItem(LS_KEY);
setTimeout(() => {
localStorage.removeItem(LS_KEY);
window.location.href = '/profile/delivery#main';
}, 800);
}, 5000);
} catch (e) {
showToast({ message: 'Ошибка сети/сервера', status: 'error' });
@ -250,7 +249,9 @@
</div>
{% endmacro %}
{% macro render_links(doc) %}
{% if doc.get('exhibition').get('tizer_file_id') or doc.get('exhibition').get('tizer_link') %}
<a class="btn" href="{% if doc.get('exhibition') and doc.get('exhibition').get('tizer_link') %}{{doc.get('exhibition').tizer_link}}{% else %}/b/competition/{{ doc.get('exhibition').tizer_file_id }}{% endif %}" style="width: 100%;">Релиз выставки</a>
{%endif%}
<a class="btn" href="{% if doc.get('exhibition') and doc.get('exhibition').get('rules_link') %}{{doc.get('exhibition').rules_link}}{% else %}/b/competition/{{ doc.get('exhibition').rules_file_id }}{% endif %}" style="width: 100%;">Условия выставки</a>
{% endmacro %}

View File

@ -36,9 +36,11 @@
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"
href="{% if doc.get('exhibition') and doc.get('exhibition').get('tizer_link') %}{{doc.get('exhibition').tizer_link}}{% else %}/b/competition/{{ doc.get('exhibition').tizer_file_id }}{% endif %}"
style="width: 100%;">Релиз выставки</a>
{% endif %}
{% if doc.get('accept') == False %}
<a class="btn" 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> -->

View File

@ -49,7 +49,7 @@
<input type="text" id="filter-author" name="filter-author" class="c_xhd5k">
<label for="filter-author" class="c_z3ybu floating-label">Автор (ФИО)</label>
</div>
<button id="apply-filters" class="btn">Применить фильтры</button>
<button id="apply-filters" class="btn b">Применить фильтры</button>
</div>
<article class="c_9fgdh b_ax8vz">
<!-- Poster -->