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