cosmetic fixes

This commit is contained in:
F4ilji
2025-06-14 19:26:24 +05:00
parent ce5c73bc84
commit 4f6fcac02a
5 changed files with 75 additions and 63 deletions
+2 -4
View File
@@ -92,7 +92,7 @@ export default {
<BasicPageContainer breakpoint="md"> <BasicPageContainer breakpoint="md">
<div class="space-y-5 md:space-y-10"> <div class="space-y-5 md:space-y-10">
<div class="space-y-3"> <div class="space-y-3">
<BackButton link="client.post.index" title="Все новости"/> <BackButton :link="$page.props.urlPrev" title="Назад"/>
<BaseBreadcrumbs :breadcrumbs="breadcrumbs"> <BaseBreadcrumbs :breadcrumbs="breadcrumbs">
<BreadcrumbsItem title="Новости" :url="route('client.post.index')" /> <BreadcrumbsItem title="Новости" :url="route('client.post.index')" />
<BreadcrumbsItem :title="post.data.title" :url="$page.url" /> <BreadcrumbsItem :title="post.data.title" :url="$page.url" />
@@ -103,7 +103,6 @@ export default {
<div class="flex space-x-3 text-gray-500 "> <div class="flex space-x-3 text-gray-500 ">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<div class="md:flex md:items-center space-y-2 md:space-y-0 md:space-x-4 text-sm"> <div class="md:flex md:items-center space-y-2 md:space-y-0 md:space-x-4 text-sm">
<PostAuthorsList :authors="post.data.authors"/>
<time class="block text-gray-500">Опубликовано {{ post.data.created_post }} <time class="block text-gray-500">Опубликовано {{ post.data.created_post }}
</time> </time>
<PostTimeRead :time="post.data.reading_time"/> <PostTimeRead :time="post.data.reading_time"/>
@@ -111,8 +110,7 @@ export default {
</div> </div>
</div> </div>
<Builder :blocks="blocks"/> <Builder :blocks="blocks"/>
<PostAuthorsList :authors="post.data.authors"/>
<div> <div>
<PostGallery v-if="post.data.gallery.length > 1" :title="post.data.title" :images="post.data.gallery"/> <PostGallery v-if="post.data.gallery.length > 1" :title="post.data.title" :images="post.data.gallery"/>
</div> </div>
@@ -1,19 +1,25 @@
<template> <template>
<!-- List -->
<div class="col-start-2"> <dl v-if="authors[0] === 'Без автора' && null" class="flex flex-col sm:flex-row gap-1 items-baseline">
<div class="hs-tooltip inline-block"> <!-- items-baseline выравнивает по базовой линии -->
<button type="button" class="hs-tooltip-toggle underline hover:text-blue-400 duration-300"> <dt class="min-w-40">
Над статьей работали <h3 class="block text-sm text-gray-500 m-0 underline">Над статьей работали:</h3>
<span class="hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 transition-opacity inline-block absolute duration-300 invisible z-10 py-1 px-2 bg-gray-900 text-xs font-medium text-white rounded shadow-sm dark:bg-neutral-700" role="tooltip"> <!-- m-0 убирает margin -->
<template v-for="author in authors"> </dt>
{{ author }} <br> <dd class="m-0">
</template> <!-- m-0 для dd на всякий случай -->
</span> <ul class="m-0 inline-flex flex-wrap items-center">
</button> <!-- flex-wrap и items-center для красивого списка -->
</div> <li
</div> v-for="(author, index) in authors"
:key="index"
class="me-1 after:content-[','] last:after:content-none inline-flex items-center text-sm text-gray-800 dark:text-neutral-200"
>
{{ author }}
</li>
</ul>
</dd>
</dl>
</template> </template>
<script> <script>
@@ -1,13 +1,24 @@
<template> <template>
<div> <div class="relative rounded-md overflow-hidden">
<img @click="toggler = !toggler" loading="lazy" class="mx-auto object-cover rounded-md hover:opacity-95 hover:duration-200 transition" :src="'/storage/' + block.data.url" alt=""> <div
<div v-if="block.data.alt" class="mt-3 text-sm text-center text-gray-500 dark:text-neutral-500"> class="absolute inset-0 bg-cover bg-center blur-md brightness-75"
{{ block.data.alt }} :style="`background-image: url('${'/storage/' + block.data.url}')`"
</div> ></div>
</div>
<FsLightbox class="" :toggler="toggler" :sources="[domainPath + '/storage/' + block.data.url]"/> <div class="relative z-10 md:m-4"> <img
@click="toggler = !toggler"
loading="lazy"
class="mx-auto h-96 rounded-md object-cover md:object-contain hover:opacity-95 hover:duration-200 transition"
:src="'/storage/' + block.data.url"
alt=""
/>
<div v-if="block.data.alt" class="mt-3 text-sm text-center text-gray-500 dark:text-neutral-500">
{{ block.data.alt }}
</div>
</div>
</div>
<FsLightbox class="" :toggler="toggler" :sources="[domainPath + '/storage/' + block.data.url]"/>
</template> </template>
<script> <script>
@@ -1,6 +1,6 @@
<template> <template>
<div class="text-normal leading-7 font-light text-gray-600 md:text-[16px] md:text-[#374151] md:leading-8 md:font-normal paragraph-container" v-html="wrapTables(block).data.content" /> <div class="text-normal leading-7 md:leading-8 tracking-wide font-light text-gray-600 md:text-[15px] md:text-[#374151] md:font-normal paragraph-container" v-html="wrapTables(block).data.content" />
</template> </template>
<script> <script>
@@ -1,46 +1,43 @@
<template> <template>
<Link :href="resolvedLink" class="inline-flex items-center gap-x-1.5 text-sm text-gray-600 decoration-2 hover:underline dark:text-blue-500">
<Link :href="route(link)" class="inline-flex items-center gap-x-1.5 text-sm text-gray-600 decoration-2 hover:underline dark:text-blue-500"> <svg class="flex-shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>
<svg class="flex-shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg> {{ title }}
{{ title }} </Link>
</Link>
</template> </template>
<script> <script>
import {Link} from "@inertiajs/vue3"; import { Link } from "@inertiajs/vue3";
import slugify from "slugify";
export default { export default {
name: "BackButton", name: "BackButton",
components: {Link}, components: { Link },
data() { props: {
return {} title: {
}, type: String,
methods: { required: true, // Сделаем title обязательным
textLimit(text, symbols) { },
if (text.length > symbols) { link: {
let LimitedText type: String,
LimitedText = text.substring(0, symbols) required: true, // Сделаем link обязательным
return LimitedText + "..." }
} },
return text computed: {
}, resolvedLink() {
}, // Проверяем, является ли "link" полным URL
try {
props: { new URL(this.link);
title: { return this.link; // Если это валидный URL, возвращаем его
type: String, } catch (e) {
}, // Если это не валидный URL, предполагаем, что это название роута Inertia
link: { // Убедитесь, что функция route() доступна глобально или импортирована
type: String // (обычно она доступна в Laravel-приложениях через Inertia)
} return route(this.link);
}, }
} }
}
};
</script> </script>
<style scoped> <style scoped>
/* Ваши стили */
</style> </style>