feat
This commit is contained in:
parent
b3e9e521d1
commit
98dcb0bc84
@ -1750,7 +1750,7 @@
|
||||
" 'prod': PROD\n",
|
||||
" }).sort({'_id':-1}).limit(1000).to_list()\n",
|
||||
" return templates.TemplateResponse(\n",
|
||||
" request=request, name=\"exhibitions.html\", context={\"id\": 1, \"user\": user, \"exhibitions\": exhibitions}\n",
|
||||
" request=request, name=\"exhibitions.html\", context={\"id\": 1, \"user\": user, \"exhibitions\": exhibitions, 'now': datetime.now()}\n",
|
||||
" )"
|
||||
],
|
||||
"display_name": ".venv"
|
||||
|
||||
2
main.py
2
main.py
@ -1301,7 +1301,7 @@ async def exhibitions_all(
|
||||
'prod': PROD
|
||||
}).sort({'_id':-1}).limit(1000).to_list()
|
||||
return templates.TemplateResponse(
|
||||
request=request, name="exhibitions.html", context={"id": 1, "user": user, "exhibitions": exhibitions}
|
||||
request=request, name="exhibitions.html", context={"id": 1, "user": user, "exhibitions": exhibitions, 'now': datetime.now()}
|
||||
)
|
||||
|
||||
@app.get("/competitions", response_class=HTMLResponse)
|
||||
|
||||
@ -27,14 +27,16 @@
|
||||
</svg>
|
||||
<span class="b_ww2ac">Назад</span>
|
||||
</a>
|
||||
{% if exhibition.get('status',-1) == 2 %}
|
||||
<div class="b_thlt1_2">
|
||||
<span class="b_5dr47_2">Выставка закончилась</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="b_thlt1">
|
||||
<span class="b_5dr47">Идет выставка</span>
|
||||
<div class="{% if now > exhibition.date_finish %}b_vabj9_2{%else%}b_vabj9{% endif %}">
|
||||
{% if now > exhibition.date_finish %}
|
||||
<span class="c_95csi b_0jst1_2">Закончилась</span>
|
||||
{% elif now > exhibition.datetime_start %}
|
||||
<span class="c_95csi b_0jst1">Началась</span>
|
||||
{% else %}
|
||||
<span class="c_95csi b_0jst1">Формируется</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if now < exhibition.date_finish %}
|
||||
<span class="b_sdf">До {{ (exhibition.date_finish.strftime('%d.%m.%Y')) if exhibition.date_finish else ''}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@ -34,16 +34,15 @@
|
||||
{% if link %}
|
||||
<a href="{{link}}" class="b_73p10">
|
||||
{% endif %}
|
||||
{% if exhibition.get('status',-1) == 2 %}
|
||||
<div class="b_vabj9_2">
|
||||
<span class="b_0jst1_2">Выставка закончилась</span>
|
||||
<div class="{% if now > exhibition.date_finish %}b_vabj9_2{%else%}b_vabj9{% endif %}">
|
||||
{% if now > exhibition.date_finish %}
|
||||
<span class="c_95csi b_0jst1_2">Закончилась</span>
|
||||
{% elif now > exhibition.datetime_start %}
|
||||
<span class="c_95csi b_0jst1">Началась</span>
|
||||
{% else %}
|
||||
<span class="c_95csi b_0jst1">Формируется</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="b_vabj9">
|
||||
<span class="b_0jst1">Идет выставка</span>
|
||||
</div>
|
||||
<!-- <span class="b_sdf">До {{ (exhibition.date_finish.strftime('%d.%m.%Y')) if exhibition.date_finish else ''}}</span> -->
|
||||
{% endif %}
|
||||
<header class="c_m876y b_9xtz9">
|
||||
<h3 class="c_hysjg b_8f3uh">{{ exhibition.title }}</h3>
|
||||
</header>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user