Переключатель
This commit is contained in:
1 parent
faf08cd391
commit
a3f44e04c6
3 files changed
+49
-7
No files matched your search
@@ -16,6 +16,7 @@
|
||||
>
|
||||
<v-card-title class="pt-0 pb-1">
|
||||
{{x.title}}
|
||||
|
||||
</v-card-title>
|
||||
<v-img
|
||||
:src="`${burl}${x.link}`"
|
||||
@@ -159,7 +160,7 @@
|
||||
density="compact"
|
||||
v-model="selecnews"
|
||||
variant="underlined"
|
||||
:items="['1', '2', '3', '4', '5', '6']"/>
|
||||
:items="['10', '20', '30', '40', '100']"/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -180,9 +181,39 @@
|
||||
class="rounded-b-0"
|
||||
|
||||
>
|
||||
<v-card-title class="pt-0 pb-1">
|
||||
<v-card-title class="pt-0 pb-1 flex-column d-flex">
|
||||
<v-row>
|
||||
<v-col lg=10 class="pt-4"> {{x.title}}</v-col>
|
||||
|
||||
<v-col class="pa-0 pr-3 pt-1 flex-grow-1 d-flex flex-column flex-wrap " >
|
||||
<v-switch v-model="gallery"
|
||||
class="align-self-end comgal"
|
||||
|
||||
|
||||
color='teal-darken-2'
|
||||
|
||||
|
||||
hide-details
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<v-icon
|
||||
:icon="gallery?'mdi-image':'mdi-message-text-outline'"
|
||||
:color="gallery?'teal-darken-2':'pink-darken-4'"
|
||||
|
||||
/>
|
||||
<!-- :color="gallery?'teal-darken-2':'pink-darken-4'" -->
|
||||
<v-tooltip
|
||||
|
||||
activator="parent"
|
||||
location="top">
|
||||
пушкни
|
||||
</v-tooltip>
|
||||
</template>
|
||||
</v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
{{x.title}}
|
||||
|
||||
</v-card-title>
|
||||
<v-img
|
||||
:src="`${burl}${x.link}`"
|
||||
@@ -606,6 +637,7 @@ export default {
|
||||
const selecnews = ref(6)
|
||||
const route = useRoute()
|
||||
const colors = []
|
||||
const switchComGal =ref(false)
|
||||
|
||||
let str = `api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}`
|
||||
|
||||
@@ -819,7 +851,8 @@ export default {
|
||||
heartIco,
|
||||
heartIcoAll,
|
||||
toggleLikeAll,
|
||||
imagesIn
|
||||
imagesIn,
|
||||
switchComGal
|
||||
|
||||
|
||||
}
|
||||
@@ -827,7 +860,12 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style >
|
||||
.comgal .v-selection-control, .comgal .v-switch__thumb {
|
||||
|
||||
color: #b86e95;
|
||||
|
||||
}
|
||||
.posFooter {
|
||||
position: sticky;
|
||||
margin-top: 12px;
|
||||
@@ -867,6 +905,9 @@ export default {
|
||||
|
||||
height: 86vh;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.place-it{
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,9 @@ class GalleryInline(admin.TabularInline):
|
||||
class NewsAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'author', 'text', 'cdate', 'link', 'get_html_photo')
|
||||
readonly_fields=('get_html_photo',)
|
||||
list_editable = ('link',)
|
||||
list_editable = ('link', 'cdate')
|
||||
list_filter = ('cdate',)
|
||||
ordering=('-cdate',)
|
||||
def save_model(self, request, obj, form, change):
|
||||
if (request.user.username != 'admin') :
|
||||
obj.author = request.user
|
||||
|
||||
@@ -37,7 +37,7 @@ class Links(models.Model):
|
||||
class News(models.Model):
|
||||
title=models.CharField(max_length=255, verbose_name='Заголовок')
|
||||
text= RichTextUploadingField(null=True, blank= True, verbose_name='Текст новости')
|
||||
cdate =models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')
|
||||
cdate =models.DateTimeField(default=datetime.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='Изображение')
|
||||
|
||||
|
||||
Reference in new issue
Block a user