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

This commit is contained in:
Vladislav 2026-06-30 19:13:53 -04:00
parent 19700b6700
commit ac436bd7dc

134
templates/profile/news.html Normal file
View File

@ -0,0 +1,134 @@
{% extends "base.html" %}
{% import "/components/header.html" as header %}
{% import "/components/footer.html" as footer %}
{% import "components/share.html" as share %}
{% import "components/profile_card.html" as profile_card %}
{% import "components/profile_nav.html" as profile_nav %}
{% 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, 'news') }}
<div class="c_3ihvi" id="main"><a class="c_ctfod b_289i1" href="/form/news"><span class="c_d2l0b b_al8e7">Добавить</span></a></div>
<div class="c_tihtk">
{% for new in news %}
<figure class="c_57hjd b_h57rq">
<div class="b_ya0t5">
<picture>
<img crossorigin="anonymous" fetchpriority="high" loading="eager" alt="{{ new.title }}" class="b_ya0t5"
src="/b/news/{{ new.media[0] }}">
</picture>
</div>
<figcaption class="c_jy9j2 b_kbsvf">
<!-- <a href="/news/{{new._id}}" class="b_kbsvf"> -->
<header class="c_27k59 b_s4cma">
<h2 class="c_dft7c b_6ggp7">{{new.title}}</h2>
</header>
<div class="c_opwlt b_cb3w5">
<p class="c_spnyn b_ol9su">{{new.short_description}}</p>
</div>
<div class="c_ybfp2 b_gagrr">
<p class="c_eiyz0 b_rhbo8">{% if user and user._id == new.user._id %}Опубликовать повторно{% endif %}</p>
<p class="c_5uh64 b_tbfd3">{{ (new._id.generation_time.strftime('%d.%m.%Y')) if new._id else ''}}</p>
</div>
<!-- </a> -->
{% if user and user._id == new.user._id %}
<div class="c_ybfp2 b_gagrr">
<a class="c_eiyz0 b_rhbo8" href="/form/news/{{new._id}}">Редактировать</a>
<p class="c_eiyz0 b_rhbo8">Удалить</p>
</div>
{% endif %}
{{ share.share('/news/{}'.format(new._id), new.title, '/b/news/{}'.format(new.media[0])) }}
</figcaption>
</figure>
{% endfor %}
</div>
</div>
</div>
</section>
{{ footer.section(user) }}
{% endblock %}
{% block head %}
{{ header.style() }}
{{ profile_nav.style() }}
<style type="text/css">
picture>img{ width: 100%; object-fit: scale-down; }
.b_ya0t5 { align-self: stretch; border-radius: 5px; height: 221px; }
.b_6ggp7 { -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #171717; display: -webkit-box; font-family: Inter; font-size: 24px; font-style: normal; font-weight: 700; line-height: normal; overflow: hidden; text-overflow: ellipsis; }
.b_s4cma { align-items: center; display: flex; }
.b_ol9su { -webkit-box-orient: vertical; -webkit-line-clamp: 1; color: #3A3A3A; display: -webkit-box; font-family: Inter; font-size: 16px; font-style: normal; font-weight: 400; line-height: normal; overflow: hidden; text-overflow: ellipsis; }
.b_cb3w5 { align-items: flex-start; display: flex; flex-direction: column; gap: 5px; }
.b_zywmd { color: #171717; font-family: Inter; font-size: 24px; font-style: normal; font-weight: 600; line-height: normal; }
.b_rhbo8 { color: #5F1798; font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; }
.b_tbfd3 { 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_gagrr { align-items: center; align-self: stretch; display: flex; justify-content: space-between; }
.b_kbsvf { align-items: flex-start; align-self: stretch; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.b_h57rq { align-items: flex-start; background: #FDFAFF; border-radius: 5px; border: 1px solid #5F1798; box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25), 0 4px 20px 0 rgba(0, 0, 0, 0.20); display: flex; flex-direction: column; width: 335px; }
.c_jy9j2{padding: 10px 20px; height: 226px;}
/* Mobile */
@media (max-width: 699px) {
}
/* Tablet */
@media (min-width: 700px) and (max-width: 900px) {
}
/* Desktop */
@media (min-width: 901px) {
.c_5uh64 { color: rgba(58, 58, 58, 0.75); font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; }
}</style>
<style type="text/css">
.b_rhmvx { border-radius: 1em; height: 140px; min-width: 140px; max-width: 100%; object-fit: cover; object-position: top;}
.b_lgvu4 { align-items: center; background: #5F1798; border-radius: 25px; bottom: 0; display: flex; height: 50px; justify-content: center; position: absolute; right: 0; width: 50px; }
.b_zo7wz { align-items: center; display: flex; justify-content: space-around; position: absolute; }
.b_jkzqx { flex-shrink: 0; height: 140px; width: 100%; visibility: hidden;}
.b_hjteq { align-items: center; display: flex; width: 100%; justify-content: center; padding: 0 15px; }
.b_yzw2z { align-items: center; background: #DC3545; border-radius: 5px; display: flex; justify-content: center; padding: 10px 33px; }
.b_2rmrs { align-items: center; align-self: stretch; background: #FFF; display: flex; flex-direction: column; gap: 15px; justify-content: center; padding: 20px 0; }
.b_440jc { color: #171717; font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; }
/* 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; }
.c_57hjd {width: 163px;}
.b_ya0t5 {height: auto;}
.c_dft7c {font-size: 14px;}
.c_spnyn {font-size: 12px;}
.c_l1ibo {font-size: 14px;}
.c_eiyz0 {font-size: 10px;}
.c_5uh64 {font-size: 8px;}
.c_tihtk {gap: 7px;}
}
/* 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 %}