Merge remote-tracking branch 'origin/Vit' into Alex
This commit is contained in:
commit
34361e3a78
9 files changed
+85
-42
No files matched your search
@@ -136,7 +136,7 @@ class Carousels(models.Model):
|
|||||||
text= models.TextField(max_length=260, blank=True, null=True, verbose_name='Сообщение')
|
text= models.TextField(max_length=260, blank=True, null=True, verbose_name='Сообщение')
|
||||||
cdate =models.DateTimeField(default=now, verbose_name='Дата создания')
|
cdate =models.DateTimeField(default=now, verbose_name='Дата создания')
|
||||||
author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT, verbose_name='Автор новости')
|
author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT, verbose_name='Автор новости')
|
||||||
link = models.ImageField(upload_to='newsimage/%Y/%m/%d', null=True, default="newsimage/default.jpg", verbose_name='Картинка')
|
link = models.FileField(upload_to='newsimage/%Y/%m/%d', null=True, default="newsimage/default.jpg", verbose_name='Картинка')
|
||||||
published = models.BooleanField(default=True, verbose_name='Опубликован')
|
published = models.BooleanField(default=True, verbose_name='Опубликован')
|
||||||
enddate = models.DateTimeField(default=default_end_date, verbose_name='Дата снятия с публикации')
|
enddate = models.DateTimeField(default=default_end_date, verbose_name='Дата снятия с публикации')
|
||||||
sender = models.ForeignKey(BaseSender, on_delete=models.PROTECT, related_name='get_base_sender', verbose_name='Тематика')
|
sender = models.ForeignKey(BaseSender, on_delete=models.PROTECT, related_name='get_base_sender', verbose_name='Тематика')
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-card
|
<v-card
|
||||||
class="rounded-0 h-100 flex-column d-flex"
|
class="rounded-0 h-100 flex-column d-flex"
|
||||||
min-height="410"
|
min-height="400"
|
||||||
max-height="410"
|
max-height="400"
|
||||||
|
|
||||||
>
|
>
|
||||||
<v-card-title class="pb-1">
|
<v-card-title class="">
|
||||||
{{news.title}}
|
{{news.title}}
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-row class="flex-grow-0">
|
<v-row class="flex-grow-0">
|
||||||
<v-col class="d-flex flex-column ">
|
<v-col class="d-flex flex-column ">
|
||||||
<v-img
|
<v-img
|
||||||
:src="`${burl}${news.link}`"
|
:src="`${burl}${news.link}`"
|
||||||
height="175px"
|
height="170px"
|
||||||
width="92%"
|
width="92%"
|
||||||
class="mx-auto"
|
class="mx-auto"
|
||||||
cover
|
cover
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-divider/>
|
|
||||||
<v-row class="ma-0 flex-grow-0">
|
<v-row class="ma-0 flex-grow-0">
|
||||||
<v-col
|
<v-col
|
||||||
class="py-1 pl-4"
|
class="py-1 pl-4"
|
||||||
@@ -84,7 +85,7 @@
|
|||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-divider/>
|
<v-divider class="mx-4"/>
|
||||||
<v-row class="ma-0 overflow-auto">
|
<v-row class="ma-0 overflow-auto">
|
||||||
<v-col
|
<v-col
|
||||||
class="py-0"
|
class="py-0"
|
||||||
@@ -97,14 +98,15 @@
|
|||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-divider/>
|
<v-divider class="mx-4"/>
|
||||||
<v-row class="flex-grow-0 ma-0">
|
<v-row class="flex-grow-0 ma-0">
|
||||||
<v-col class="d-flex justify-space-between">
|
<v-col class="d-flex justify-space-between">
|
||||||
<v-btn
|
<v-btn
|
||||||
color="more_details_btn"
|
color="more_details_btn"
|
||||||
variant="text"
|
|
||||||
:to='`/newsfull?id=${news.id}`'
|
:to='`/newsfull?id=${news.id}`'
|
||||||
size="small"
|
size="small"
|
||||||
|
rounded="xl"
|
||||||
append-icon="mdi-step-forward-2"
|
append-icon="mdi-step-forward-2"
|
||||||
>
|
>
|
||||||
Подробнее
|
Подробнее
|
||||||
@@ -130,7 +132,7 @@ const accountStore = useAccountStore()
|
|||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: { icoUser },
|
components: { icoUser },
|
||||||
|
name:'NewsCard',
|
||||||
props: {
|
props: {
|
||||||
news: {
|
news: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -65,8 +65,8 @@
|
|||||||
<v-divider/>
|
<v-divider/>
|
||||||
<v-card-actions class="align-self-end py-0">
|
<v-card-actions class="align-self-end py-0">
|
||||||
<v-btn
|
<v-btn
|
||||||
color="modal_btn"
|
rounded="xl"
|
||||||
variant="text"
|
color="more_details_btn"
|
||||||
@click= "$emit('update:opendialog', false)"
|
@click= "$emit('update:opendialog', false)"
|
||||||
>
|
>
|
||||||
Закрыть
|
Закрыть
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<v-spacer/>
|
<v-spacer/>
|
||||||
<v-btn
|
<v-btn
|
||||||
color="modal_btn"
|
color="modal_btn"
|
||||||
variant="text"
|
rounded="xl"
|
||||||
text="Закрыть"
|
text="Закрыть"
|
||||||
@click="menusCloses"
|
@click="menusCloses"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-carousel
|
<v-carousel
|
||||||
cycle
|
|
||||||
interval="10000"
|
interval="10000"
|
||||||
cover
|
cover
|
||||||
height="450"
|
height="450"
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
:show-arrows="carous.length<2?false:'hover'"
|
:show-arrows="carous.length<2?false:'hover'"
|
||||||
color="white"
|
color="white"
|
||||||
>
|
>
|
||||||
|
|
||||||
<v-carousel-item
|
<template v-for="(x, i) in carous" :key="i">
|
||||||
v-for="(x, i) in carous"
|
<v-carousel-item
|
||||||
:key="i"
|
v-if="!x.link.endsWith('mp4')"
|
||||||
:src="`${burl}${x.link}`"
|
:src="`${burl}${x.link}`"
|
||||||
cover
|
cover
|
||||||
eager
|
eager
|
||||||
@@ -67,6 +67,21 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-container>
|
</v-container>
|
||||||
</v-carousel-item>
|
</v-carousel-item>
|
||||||
|
<v-carousel-item v-else >
|
||||||
|
|
||||||
|
<div class="d-flex justify-center">
|
||||||
|
<video
|
||||||
|
style="height: 450px;"
|
||||||
|
controls
|
||||||
|
>
|
||||||
|
<source :src="`${burl}${x.link}`" type="video/mp4" />
|
||||||
|
Текущий браузер не поддерживает воспроизведение этого видео.
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</v-carousel-item>
|
||||||
|
</template>
|
||||||
</v-carousel>
|
</v-carousel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -77,7 +92,9 @@ import { axiosApiInstance } from "@/utils/axios-api";
|
|||||||
import { useAlertStore } from "@/store/useAlertStore";
|
import { useAlertStore } from "@/store/useAlertStore";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
|
|
||||||
const burl = baseURL.slice(0, -1);
|
const burl = baseURL.slice(0, -1);
|
||||||
|
|
||||||
const carous = ref([{ link: `/media/newsimage/scales.jpg`, "title": null, "text": "" }]);
|
const carous = ref([{ link: `/media/newsimage/scales.jpg`, "title": null, "text": "" }]);
|
||||||
@@ -92,6 +109,7 @@ export default {
|
|||||||
feedalert.ico = "mdi-alert-outline";
|
feedalert.ico = "mdi-alert-outline";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(result.data);
|
||||||
if (result.data.result.length > 0) {
|
if (result.data.result.length > 0) {
|
||||||
carous.value = result.data.result;
|
carous.value = result.data.result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,8 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
<v-divider class="" />
|
<v-divider class="" />
|
||||||
<v-card-actions class="pb-0" style="place-content: end">
|
<v-card-actions class="pb-0" style="place-content: end">
|
||||||
<v-btn color="more_details_btn" variant="text" @click="onSubmit">
|
<v-btn
|
||||||
|
color="more_details_btn" rounded="xl" @click="onSubmit">
|
||||||
Закрыть
|
Закрыть
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row>
|
<v-row class="py-2">
|
||||||
<v-col class="d-flex flex-column">
|
<v-col class="d-flex flex-column">
|
||||||
<v-row class=" flex-grow-1 pa-1 d-flex h-0 overflow-auto">
|
<v-row class="h-0 overflow-auto">
|
||||||
<v-col
|
<v-col
|
||||||
v-for="(x, key) in newsAll"
|
v-for="(x, key) in newsAll"
|
||||||
:key="key"
|
:key="key"
|
||||||
@@ -11,27 +11,40 @@
|
|||||||
sm=12
|
sm=12
|
||||||
xs=12
|
xs=12
|
||||||
cols=12
|
cols=12
|
||||||
class="d-flex pa-1 flex-column "
|
class="d-flex pa-0 flex-column "
|
||||||
>
|
>
|
||||||
<NewsCard :news="x"/>
|
<NewsCard :news="x" class="ma-1"/>
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<v-row class="flex-grow-0 ">
|
<v-row class="flex-grow-0 ">
|
||||||
<v-col class="pa-0" >
|
<v-col class="pa-0" >
|
||||||
<v-pagination
|
<v-pagination
|
||||||
|
density="compact"
|
||||||
v-model="page"
|
v-model="page"
|
||||||
:length="visiblePage"
|
:length="visiblePage"
|
||||||
:total-visible="7"
|
:total-visible="7"
|
||||||
@update:modelValue="loadNewsAll"
|
@update:modelValue="loadNewsAll"
|
||||||
/>
|
>
|
||||||
|
<template v-slot:item="item">
|
||||||
|
|
||||||
|
<v-btn icon density="compact"
|
||||||
|
:color="item.isActive?'more_details_btn':'grey-ligten-3'"
|
||||||
|
@click="pager(item.page)"
|
||||||
|
>{{ item.page }}</v-btn>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
</v-pagination>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="flex-grow-0 py-0">
|
<v-col class="flex-grow-0 py-0 " >
|
||||||
<v-select
|
<v-select
|
||||||
style="width:53px"
|
style="width:53px"
|
||||||
hide-details
|
hide-details
|
||||||
|
density="compact"
|
||||||
hide-selected
|
hide-selected
|
||||||
|
|
||||||
v-model="countpage"
|
v-model="countpage"
|
||||||
rounded
|
rounded
|
||||||
variant="underlined"
|
variant="underlined"
|
||||||
@@ -50,12 +63,12 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import newsCard from './UI/NewsCard.vue'
|
import NewsCard from './UI/NewsCard.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
newsCard
|
NewsCard
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
@@ -73,17 +86,22 @@ export default {
|
|||||||
|
|
||||||
newsAll.value= result.data.result
|
newsAll.value= result.data.result
|
||||||
countetnews.value = result.data.countpage/countpage.value
|
countetnews.value = result.data.countpage/countpage.value
|
||||||
visiblePage.value = countetnews.value <= 1 ? 1 : Math.ceil(countetnews.value+1)
|
visiblePage.value = countetnews.value <= 1 ? 1 : Math.ceil(countetnews.value)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
loadNewsAll()
|
loadNewsAll()
|
||||||
|
const pager=(val)=>{
|
||||||
|
page.value=Number(val)
|
||||||
|
loadNewsAll()
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
newsAll,
|
newsAll,
|
||||||
|
|
||||||
|
pager,
|
||||||
page,
|
page,
|
||||||
countpage,
|
countpage,
|
||||||
visiblePage,
|
visiblePage,
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row>
|
<v-row class="">
|
||||||
<v-col class="flex-column d-flex">
|
<v-col class="flex-column d-flex pa-0">
|
||||||
<v-row class="mt-0 h-0 overflow-auto ">
|
<v-row class="mt-0 mx-3 h-0 overflow-auto ">
|
||||||
<v-col
|
<v-col
|
||||||
v-for="(x, key) in newsAll"
|
v-for="(x, key) in newsAll"
|
||||||
:key="key"
|
:key="key"
|
||||||
class="pb-1 pt-0"
|
class="py-1"
|
||||||
lg=12
|
lg=12
|
||||||
md=6
|
md=6
|
||||||
sm=6
|
sm=6
|
||||||
>
|
>
|
||||||
<news-card :news="x"/>
|
<NewsCard :news="x"/>
|
||||||
|
|
||||||
|
|
||||||
<v-dialog
|
<v-dialog
|
||||||
v-model="dialogfotoOne"
|
v-model="dialogfotoOne"
|
||||||
@@ -73,12 +73,12 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import newsCard from './UI/news-card.vue'
|
import NewsCard from './UI/NewsCard.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
newsCard
|
NewsCard
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
|
|||||||
@@ -13,8 +13,9 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row style="height:250px">
|
<v-row style="height:250px">
|
||||||
<v-col class="d-flex flex-column pa-1">
|
<v-col class="d-flex flex-column flex-grow-0 pa-1">
|
||||||
<!-- <event-calendar/> -->
|
<!-- <event-calendar/> -->
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -65,6 +66,8 @@
|
|||||||
<v-slide-group
|
<v-slide-group
|
||||||
show-arrows
|
show-arrows
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
<v-slide-group-item
|
<v-slide-group-item
|
||||||
v-for="x in favorit"
|
v-for="x in favorit"
|
||||||
:key="x"
|
:key="x"
|
||||||
@@ -95,6 +98,7 @@
|
|||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -109,7 +113,7 @@
|
|||||||
|
|
||||||
import CarouselList from '@/components/carousel-list.vue'
|
import CarouselList from '@/components/carousel-list.vue'
|
||||||
import CarouselNumbers from '@/components/carousel-numbers.vue'
|
import CarouselNumbers from '@/components/carousel-numbers.vue'
|
||||||
|
|
||||||
|
|
||||||
import NewsHome from '@/components/news-home.vue'
|
import NewsHome from '@/components/news-home.vue'
|
||||||
import LoadRound from '@/components/load-round.vue'
|
import LoadRound from '@/components/load-round.vue'
|
||||||
@@ -121,7 +125,7 @@
|
|||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|
||||||
CarouselList,
|
CarouselList,
|
||||||
CarouselNumbers,
|
CarouselNumbers,
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user