feat: add ci cd files dont edit those files
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<section class="graphic-details">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="view-date">
|
||||
<p class="date">{{ jalali(info.customDate || info.created_at) }}</p>
|
||||
<p class="date">{{ jDate(info.customDate || info.created_at) }}</p>
|
||||
</div>
|
||||
<div v-if="info.summaryTitle" class="col-12 col-md-6">
|
||||
<h2 class="summry-title mt-3">
|
||||
{{ info.summaryTitle }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<h1 class="title">
|
||||
{{ info.title }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div v-if="info.leadTitle" class="col-12">
|
||||
<p class="summry-title mb-4">
|
||||
{{ info.leadTitle }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 img-graphic">
|
||||
<img style="width : 100%" :src="info.graphic" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="s2" v-if="related.length">
|
||||
<h3>مطالب مرتبط</h3>
|
||||
|
||||
<div id="slides">
|
||||
<div class="slide" v-for="item in related" :key="item._id">
|
||||
<div class="view-txt">
|
||||
<div>
|
||||
<p class="h3">{{ item.title }}</p>
|
||||
<p>{{ item.summaryTitle }}</p>
|
||||
<div class="date">
|
||||
<span>{{ jalali(item.customDate || item.created_at) }}</span>
|
||||
<span>توسط {{ item._creator.firstName + ' ' + item._creator.lastName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment-jalaali'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
info: null,
|
||||
galleryShown: false,
|
||||
initialIndex: 0,
|
||||
related: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
$(document).ready(() => {
|
||||
new SimpleLightbox('.graphic-details .img-graphic a')
|
||||
$("#slides").slick({
|
||||
dots: true,
|
||||
slidesToShow: this.related.length === 1 ? 1 : 2,
|
||||
rtl: true,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 960,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: true
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 720,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 540,
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
jalali(date) {
|
||||
return moment(date).locale('fa').fromNow()
|
||||
},
|
||||
jDate(date) {
|
||||
return moment(date).locale('fa').format('LL')
|
||||
}
|
||||
},
|
||||
head() {
|
||||
return {
|
||||
title: 'جزئیات گرافیک',
|
||||
meta: [
|
||||
{
|
||||
hid: 'description',
|
||||
name: 'description',
|
||||
content: this.info.summaryTitle
|
||||
},
|
||||
{
|
||||
hid: 'keywords',
|
||||
name: 'keywords',
|
||||
content: this.info.keywords
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
async asyncData({params, error, $axios}) {
|
||||
try {
|
||||
let data = await $axios.get(`/api/public/getGallery/${encodeURIComponent(params.graphic)}`)
|
||||
let related = await $axios.get(`/api/public/getRelatedGallery`, {
|
||||
params: {
|
||||
type: 'graphic',
|
||||
title: params.graphic
|
||||
}
|
||||
})
|
||||
return {
|
||||
info: data.data,
|
||||
related: related.data
|
||||
}
|
||||
} catch (err) {
|
||||
error({status: 404, message: 'دریافت اطلاعات با مشکل مواجه شده است!'})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<div class="graphic-page">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-9">
|
||||
<h3 class="graphic-title">گرافیگ</h3>
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-5 sectionStyle" v-if="graphic.all.docs.length">
|
||||
<div class="graphic-item1">
|
||||
<nuxt-link :to="{name: 'portal-graphics-graphic', params: {portal: currentPortal, graphic: graphic.all.docs[0]._id}}" class="graphic-img-box1">
|
||||
<img :src="graphic.all.docs[0].thumbCover" alt="" class="graphic-img1">
|
||||
<div class="graphic-detail-item1">
|
||||
<h3 class="graphic-detail-title1">{{ graphic.all.docs[0].title }}</h3>
|
||||
<p class="graphic-detail-date1" id="graphic-detail-date1">{{ jDate(graphic.all.docs[0].customDate || graphic.all.docs[0].created_at) }}</p>
|
||||
</div>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="not-found" v-if="!graphic.all.docs.length">
|
||||
<p>موردی وجود ندارد!</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3 mb-3 sectionStyle" v-for="(item, index) in graphic.all.docs" :key="item.id" v-if="index > 0 && graphic.all.docs.length">
|
||||
<div class="graphic-item">
|
||||
<nuxt-link :to="{name: 'portal-graphics-graphic', params: {portal: currentPortal, graphic: item._id}}" class="graphic-img-box">
|
||||
<img :src="item.thumbCover" alt="" class="graphic-img">
|
||||
</nuxt-link>
|
||||
<div class="graphic-detail-item">
|
||||
<h3 class="graphic-detail-title">{{ item.title }}</h3>
|
||||
<p class="graphic-detail-date" id="graphic-detail-date">{{ jDate(item.customDate || item.created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-3">
|
||||
<h3 class="graphic-side">برگزیده ها</h3>
|
||||
<div class="sectionStyle" v-if="graphic.favorites.length">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-6 col-md-12 mb-3" v-for="(item, index) in graphic.favorites" :key="item.id" v-if="index < 5">
|
||||
<div class="graphic-item ">
|
||||
<nuxt-link :to="{name: 'portal-graphics-graphic', params: {portal: currentPortal, graphic: item._id}}" class="graphic-img-box">
|
||||
<img :src="item.thumbCover" alt="" class="graphic-img">
|
||||
</nuxt-link>
|
||||
<div class="graphic-detail-item">
|
||||
<h3 class="graphic-detail-title">{{ item.title }}</h3>
|
||||
<p class="graphic-detail-date" id="graphic-detail-date2">{{ jDate(item.customDate || item.created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="not-found" v-if="!graphic.favorites.length">
|
||||
<p>موردی وجود ندارد!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paginate">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<el-pagination
|
||||
layout="next, pager, prev"
|
||||
v-if="graphic.all.totalPages > 1"
|
||||
class="el-pagination"
|
||||
@current-change="pageNumber"
|
||||
:current-page="Number($route.query.page)"
|
||||
:page-count="Number(graphic.all.totalPages)"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment-jalaali"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
graphic: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentPortal() {
|
||||
return this.$route.params.portal
|
||||
},
|
||||
pageQuery() {
|
||||
return this.$route.query.page
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
pageQuery(newVal, oldVal) {
|
||||
this.$nuxt.refresh()
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
jDate(date) {
|
||||
return moment(date).locale('fa').format('LL')
|
||||
},
|
||||
pageNumber(val) {
|
||||
this.$router.push({
|
||||
name: 'portal-graphics',
|
||||
params: {portal: this.currentPortal},
|
||||
query: {type: 'graphic', page: val}
|
||||
})
|
||||
$(window).scrollTop(0)
|
||||
},
|
||||
},
|
||||
async asyncData({params, query, error, $axios}) {
|
||||
// return error({status: 404})
|
||||
try {
|
||||
const portalQuery = params.portal
|
||||
// const data = await $axios.get(`/api/public/getgraphicCat/${query.category}`, {
|
||||
const data = await $axios.get(`/api/public/getAllGallery?portal=${portalQuery}&type=${query.type}&page=${query.page}`)
|
||||
// console.log('data.data', data.data.all)
|
||||
return {
|
||||
graphic: data.data
|
||||
}
|
||||
} catch (e) {
|
||||
error({status: 404})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user