Праздник
This commit is contained in:
1 parent
1cd46574a9
commit
2df44d13eb
15 files changed
+103
-63
No files matched your search
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- -->
|
|
||||||
<v-carousel
|
<v-carousel
|
||||||
|
|
||||||
cover
|
cover
|
||||||
@@ -21,8 +21,7 @@
|
|||||||
cover
|
cover
|
||||||
eager
|
eager
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
<v-container
|
<v-container
|
||||||
fill-height
|
fill-height
|
||||||
fluid
|
fluid
|
||||||
@@ -30,41 +29,62 @@
|
|||||||
class="flex-column h-100 d-flex"
|
class="flex-column h-100 d-flex"
|
||||||
>
|
>
|
||||||
<v-card class="bgCard h-100 d-flex flex-column">
|
<v-card class="bgCard h-100 d-flex flex-column">
|
||||||
<v-card-title class="ma-2 text-h3 text-uppercase titles text-text_carous py-5 flex-column">
|
<v-card-title class="ma-2 text-h3 text-uppercase titles text-text_carous py-5 flex-column">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="pa-0 pl-1 align-self-center">{{x.title}}
|
<v-col class="pa-0 pl-1 align-self-center">{{x.title}}
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col class="flex-grow-0 pa-0 pr-1">
|
<v-col class="flex-grow-0 pa-0 pr-1">
|
||||||
<v-img
|
<v-img
|
||||||
|
|
||||||
width="50"
|
width="50"
|
||||||
:aspect-ratio="1"
|
:aspect-ratio="1"
|
||||||
:src="`${burl}${x.sender}`"
|
:src="`${burl}${x.sender}`"
|
||||||
cover
|
cover
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-text class="ml-2 mb-0 mb-2 w-50 flex-grow-0 pb-3 text-h6 bgText overflow-auto ">
|
<v-card-text v-if="'text' in x && x.text.length>0" class="ml-2 mb-0 mb-2 flex-grow-0 pb-3 text-h6 overflow-auto ">
|
||||||
|
<v-row>
|
||||||
|
|
||||||
|
|
||||||
|
<v-col cols=6 class=" bgText">
|
||||||
<v-textarea
|
<v-textarea
|
||||||
class="text-text_carous mt-n3 text-black textareas pt-2 font-weight-medium"
|
class="text-text_carous mt-n3 text-black textareas pt-2 font-weight-medium"
|
||||||
:model-value=x.text
|
:model-value=x.text
|
||||||
variant='plain'
|
variant='plain'
|
||||||
readonly
|
readonly
|
||||||
auto-grow
|
auto-grow
|
||||||
rows="1"
|
rows="1"
|
||||||
|
|
||||||
hide-details
|
hide-details
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</v-card-text>
|
</v-col>
|
||||||
|
|
||||||
|
|
||||||
|
<v-col cols=6 class=" bgText">
|
||||||
|
<v-img
|
||||||
|
|
||||||
|
|
||||||
|
:aspect-ratio="1"
|
||||||
|
:src="`${burl}${x.link2}`"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
|
|
||||||
@@ -80,7 +100,7 @@
|
|||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import {getfromserver} from '@/utils/universal_functions'
|
import {getfromserver} from '@/utils/universal_functions'
|
||||||
import { baseURL } from '@/utils/axios-api'
|
import { baseURL } from '@/utils/axios-api'
|
||||||
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -90,8 +110,15 @@
|
|||||||
const burl = baseURL.slice(0,-1)
|
const burl = baseURL.slice(0,-1)
|
||||||
const carous=ref([{link: ""}])
|
const carous=ref([{link: ""}])
|
||||||
|
|
||||||
|
axiosApiInstance.get(`api/fns/links/`).then(data => {
|
||||||
getfromserver("api/navigation/carousels/", carous)
|
carous.value= data.data
|
||||||
|
|
||||||
|
// t_dailyRound.value = data.data
|
||||||
|
|
||||||
|
// result.value=JSON.parse(JSON.stringify(data.data.daily))
|
||||||
|
|
||||||
|
})
|
||||||
|
// getfromserver("api/fns/links/", carous)
|
||||||
|
|
||||||
const carushi = computed(()=> {
|
const carushi = computed(()=> {
|
||||||
console.log(window.innerHeight, window.innerHeight-50);
|
console.log(window.innerHeight, window.innerHeight-50);
|
||||||
@@ -116,7 +143,7 @@
|
|||||||
|
|
||||||
.bgText {
|
.bgText {
|
||||||
background: #ffffffb0;
|
background: #ffffffb0;
|
||||||
line-height: 2.1rem!important;
|
line-height: 3.1rem!important;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,6 +154,6 @@
|
|||||||
|
|
||||||
.textareas .v-field__input {
|
.textareas .v-field__input {
|
||||||
|
|
||||||
font-size: 1.3em!important;
|
font-size: 3.3em!important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -32,4 +32,4 @@ class MultiDBModelAdmin(admin.ModelAdmin):
|
|||||||
db_field, request, using=self.using, **kwargs
|
db_field, request, using=self.using, **kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
# admin.site.register(Carousels, MultiDBModelAdmin)
|
admin.site.register(Carousels, MultiDBModelAdmin)
|
||||||
+10
-7
@@ -8,11 +8,14 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
# class Carousels(models.Model):
|
|
||||||
# title = models.CharField(max_length=255)
|
|
||||||
# text = models.TextField(blank=True, null=True)
|
|
||||||
# link = models.ImageField(upload_to='fns/%Y/%m/%d', null=True, verbose_name='Изображение', db_comment = 'Картинка к новости')
|
|
||||||
|
|
||||||
# class Meta:
|
|
||||||
# managed = False
|
class Carousels(models.Model):
|
||||||
# db_table = 'carousels'
|
title = models.CharField(max_length=255)
|
||||||
|
text = models.TextField(blank=True, null=True)
|
||||||
|
link = models.ImageField(upload_to='fns/%Y/%m/%d', default="newsimage/default.jpg", null=True, verbose_name='Картинка')
|
||||||
|
order = models.IntegerField(blank=True, null=True)
|
||||||
|
link2 = models.ImageField(upload_to='fns/%Y/%m/%d', default="newsimage/default.jpg", null=True, verbose_name='Картинка2')
|
||||||
|
class Meta:
|
||||||
|
managed = False
|
||||||
|
db_table = 'carousels'
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
from rest_framework import serializers
|
||||||
|
from .models import *
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class CarouselsSerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
|
||||||
|
model = Carousels
|
||||||
|
fields = '__all__'
|
||||||
+1
-1
@@ -10,7 +10,7 @@ from rest_framework_simplejwt.views import (
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
|
||||||
# path('links/', CaorusAPIView.as_view(), name='LinkAPIView'),
|
path('links/', CaorusAPIView.as_view(), name='CaorusAPIView'),
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
@@ -1,3 +1,11 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
from rest_framework.generics import ListAPIView
|
||||||
|
from .models import *
|
||||||
|
from rest_framework.response import Response
|
||||||
|
from .serializers import *
|
||||||
|
|
||||||
# class CaorusAPIView(CarouselsAPIView(ListAPIView):)
|
class CaorusAPIView(ListAPIView):
|
||||||
|
def get(self, request):
|
||||||
|
queryset = Carousels.objects.using('add_base').all().order_by('order')
|
||||||
|
print(queryset, '----------------queryset')
|
||||||
|
return Response(CarouselsSerializer(queryset, many=True).data)
|
||||||
@@ -70,16 +70,7 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
mess = 'Файл не найден'
|
mess = 'Файл не найден'
|
||||||
try:
|
try:
|
||||||
getattr(re, request.GET.get("excel"))()
|
getattr(re, request.GET.get("excel"))()
|
||||||
print(request.GET.get("excel"), 'request.GET.get("excel")----------------')
|
|
||||||
# if request.GET.get("excel") == 'round':
|
|
||||||
|
|
||||||
# re.roundfilse()
|
|
||||||
# mess = "Файл загружен"
|
|
||||||
# if request.GET.get("excel") == 'vacation':
|
|
||||||
# re.vacationsExcel()
|
|
||||||
# print(request.data['dailyfiles'], 'request.data[dailyfiles]--------------------')
|
|
||||||
# mess = 'Файл в обраотке'
|
|
||||||
# pos=''
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e, '-----------------------------')
|
print(e, '-----------------------------')
|
||||||
pass
|
pass
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 414 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 414 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 413 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 413 KiB |
@@ -123,7 +123,7 @@ class CarouselsAPIView(ListAPIView):
|
|||||||
for k in nowday:
|
for k in nowday:
|
||||||
|
|
||||||
birthday.append({
|
birthday.append({
|
||||||
"title":'Поздравляем!',
|
"title":'Сегодня поздравляем!',
|
||||||
"text": f"{k.fio}!"+"\n"+ f"{brdtext[0].text}",
|
"text": f"{k.fio}!"+"\n"+ f"{brdtext[0].text}",
|
||||||
"link": "/media/"+str(brdimage[0].img),
|
"link": "/media/"+str(brdimage[0].img),
|
||||||
"published": 'true',
|
"published": 'true',
|
||||||
|
|||||||
Reference in new issue
Block a user