mirror of
https://github.com/ArthurDanjou/website-old.git
synced 2026-01-31 12:17:53 +01:00
Fix NaN bug + Move searching tag
This commit is contained in:
@@ -42,7 +42,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
const dateFormat = new Date(date)
|
const dateFormat = new Date(date)
|
||||||
return this.$t('month_' + dateFormat.getMonth()) + " " + dateFormat.getFullYear()
|
return date === 'Today' ? 'Today' : this.$t('month_' + dateFormat.getMonth()) + " " + dateFormat.getFullYear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,36 +8,36 @@
|
|||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" />
|
||||||
</svg>
|
</svg>
|
||||||
</PageTitle>
|
</PageTitle>
|
||||||
<h1 v-if="posts.length === 0" class="text-xl font-bold text-center my-8 w-full">{{ $t('blog_no_posts') }}</h1>
|
<div class="flex flex-col mt-8 w-full md:w-1/2">
|
||||||
<div class="w-full md:w-1/2" v-else>
|
<h1
|
||||||
<div class="flex flex-col mt-8 w-full">
|
v-if="current_tag === ''"
|
||||||
<h1
|
class="text-lg mb-2"
|
||||||
v-if="current_tag === ''"
|
>{{ $t('blog_tags_search') }}</h1>
|
||||||
class="text-lg mb-2"
|
<div
|
||||||
>{{ $t('blog_tags_search') }}</h1>
|
@click="resetPosts"
|
||||||
<div
|
v-if="current_tag !== ''"
|
||||||
@click="resetPosts"
|
class="w-full home-arrow flex cursor-pointer font-bold"
|
||||||
v-if="current_tag !== ''"
|
>
|
||||||
class="w-full home-arrow flex cursor-pointer font-bold"
|
<div class="arrow duration-300 mr-2">
|
||||||
>
|
<svg height="25" width="25" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<div class="arrow duration-300 mr-2">
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
|
||||||
<svg height="25" width="25" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
</svg>
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
{{ $t('blog_tags_search_back') }}
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="flex flex-row w-full overflow-x-scroll md:overflow-x-hidden md:flex-wrap space-x-3 md:space-x-0">
|
{{ $t('blog_tags_search_back') }}
|
||||||
<div v-for="tag in tags">
|
</div>
|
||||||
<div
|
<div v-else class="flex flex-row w-full overflow-x-scroll md:overflow-x-hidden md:flex-wrap space-x-3 md:space-x-0">
|
||||||
class="mb-3 md:mr-4 border-b-2 border-opacity-0 hover:border-opacity-100 border-green-400 border-solid duration-300 cursor-pointer font-black"
|
<div v-for="tag in tags">
|
||||||
@click="fetchPostsByTag(tag.label.code)"
|
<div
|
||||||
>
|
class="mb-3 md:mr-4 border-b-2 border-opacity-0 hover:border-opacity-100 border-green-400 border-solid duration-300 cursor-pointer font-black"
|
||||||
{{ $t(tag.label.code) }}
|
@click="fetchPostsByTag(tag.label.code)"
|
||||||
</div>
|
>
|
||||||
|
{{ $t(tag.label.code) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<h1 v-if="posts.length === 0" class="text-xl font-bold text-center my-8 w-full">{{ $t('blog_no_posts') }}</h1>
|
||||||
|
<div class="w-full md:w-1/2" v-else>
|
||||||
<div class="flex flex-col justify-around items-center py-8 w-full">
|
<div class="flex flex-col justify-around items-center py-8 w-full">
|
||||||
<div class="w-full" v-for="post in posts">
|
<div class="w-full" v-for="post in posts">
|
||||||
<nuxt-link :to="'/blog/' + post.id">
|
<nuxt-link :to="'/blog/' + post.id">
|
||||||
|
|||||||
Reference in New Issue
Block a user