fix
This commit is contained in:
parent
588793f66c
commit
42be861364
@ -145,7 +145,11 @@
|
|||||||
.c_la1ap { color: rgba(58, 58, 58, 0.75); font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; }
|
.c_la1ap { color: rgba(58, 58, 58, 0.75); font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; }
|
||||||
.c_w6ecf { -webkit-box-orient: vertical; -webkit-line-clamp: 1; align-self: stretch; color: #000; display: -webkit-box; font-family: Inter; font-size: 20px; font-style: normal; font-weight: 700; line-height: normal; overflow: hidden; text-overflow: ellipsis; }
|
.c_w6ecf { -webkit-box-orient: vertical; -webkit-line-clamp: 1; align-self: stretch; color: #000; display: -webkit-box; font-family: Inter; font-size: 20px; font-style: normal; font-weight: 700; line-height: normal; overflow: hidden; text-overflow: ellipsis; }
|
||||||
.c_m3jeo { align-content: flex-start; align-items: flex-start; background: #FFF; display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; width: 1600px; }
|
.c_m3jeo { align-content: flex-start; align-items: flex-start; background: #FFF; display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; width: 1600px; }
|
||||||
}</style>
|
}
|
||||||
|
.b_gagrr { align-items: center; align-self: stretch; display: flex; justify-content: space-between; }
|
||||||
|
.b_rhbo8 { color: #5F1798; font-family: Inter; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; }
|
||||||
|
.c_eiyz0{cursor: pointer;}
|
||||||
|
</style>
|
||||||
{{ footer.style() }}
|
{{ footer.style() }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@ -182,14 +186,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<p class="c_zlnpy b_7efyd">{{paint.description or ''}}</p>
|
<p class="c_zlnpy b_7efyd">{{paint.description or ''}}</p>
|
||||||
<p class="c_sbnel b_frv5u">{{ (paint._id.generation_time.strftime('%d.%m.%Y')) if paint._id else ''}}</p>
|
<p class="c_sbnel b_frv5u">{{ (paint._id.generation_time.strftime('%d.%m.%Y')) if paint._id else ''}}</p>
|
||||||
|
{% if user and user._id == post.user._id %}
|
||||||
|
<div class="c_ybfp2 b_gagrr">
|
||||||
|
<a class="c_eiyz0 b_rhbo8" href="/form/post/{{post._id}}">Редактировать</a>
|
||||||
|
<button class="c_eiyz0 b_rhbo8" onclick="deletePost('{{post._id}}')">Удалить</button>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
<a class="c_75ykb b_gk0ob" href="https://telegram.me/gennadiy0605"><span class="c_dlut5 b_v0d1u">Обсудить покупку картины </span></a>
|
<a class="c_75ykb b_gk0ob" href="https://telegram.me/gennadiy0605"><span class="c_dlut5 b_v0d1u">Обсудить покупку картины </span></a>
|
||||||
|
{% endif %}
|
||||||
<div class="c_sbnel b_frv5u">{{ share.share('/paintings/{}'.format(paint._id), paint.title, '/b/posts/{}'.format(paint.medias[0])) }}</div>
|
<div class="c_sbnel b_frv5u">{{ share.share('/paintings/{}'.format(paint._id), paint.title, '/b/posts/{}'.format(paint.medias[0])) }}</div>
|
||||||
<p class="c_sbnel b_frv5u">👁 {{total_watch_count}} (+{{today_watch_count}} Сегодня)</p>
|
<p class="c_sbnel b_frv5u">👁 {{total_watch_count}} (+{{today_watch_count}} Сегодня)</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
const images = [
|
const images = [
|
||||||
{% for media in paint.medias_original %}
|
{% for media in paint.medias_original %}
|
||||||
{ src: "/b/posts/{{media}}" },
|
{ src: "/b/posts/{{media}}" },
|
||||||
@ -296,9 +306,35 @@
|
|||||||
init();
|
init();
|
||||||
setTimeout(updateTransform, 100); // даём браузеру время на рендер
|
setTimeout(updateTransform, 100); // даём браузеру время на рендер
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
function deletePost(postId) {
|
||||||
|
fetch(`/api/post/${postId}`, {
|
||||||
|
method: 'DELETE'
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
if (response.ok) {
|
||||||
|
// Find and delete the parent figure
|
||||||
|
const postElement = document.querySelector(`figure[data-postId='${postId}']`);
|
||||||
|
if (postElement) {
|
||||||
|
postElement.remove();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showToast({
|
||||||
|
message: 'Ошибка соединения с сервером!',
|
||||||
|
status: 'error',
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
// Handle network errors
|
||||||
|
showToast({
|
||||||
|
message: 'Ошибка соединения с сервером!',
|
||||||
|
status: 'error',
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
{{ footer.section(user) }}
|
{{ footer.section(user) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user