Merge branch 'razrab'
No files matched your search
@@ -5,34 +5,16 @@ from django.db.models import Avg
|
||||
class BaseCriteriaAdmin(admin.ModelAdmin):
|
||||
list_display=('name', 'rating')
|
||||
|
||||
|
||||
|
||||
class RatingStatusInline(admin.TabularInline):
|
||||
model = RatingStatus
|
||||
fields = ( 'crit', 'rating')
|
||||
readonly_fields=( 'crit', 'rating')
|
||||
can_delete = False
|
||||
show_change_link = False
|
||||
|
||||
extra = 0
|
||||
|
||||
# class GetRatFilter(admin.SimpleListFilter):
|
||||
# title = 'get_rat'
|
||||
# parameter_name = 'get_rat'
|
||||
|
||||
# def lookups(self, request, model_admin):
|
||||
# return (
|
||||
# ('Yes', 'Yes'),
|
||||
# ('No', 'No'),
|
||||
# )
|
||||
|
||||
# def queryset(self, request, queryset):
|
||||
# value = self.value()
|
||||
# print(self.value(), '---------------------------')
|
||||
|
||||
# if value < 5:
|
||||
# return queryset.filter(comment='Я усталь')
|
||||
# if value > 5:
|
||||
# return queryset.filter(comment='qqqq')
|
||||
|
||||
class UserCommentAdmin(admin.ModelAdmin):
|
||||
fields = ( 'comment', ('get_rat', 'user', 'time_create'))
|
||||
list_display=('user', 'time_create', 'comment', 'get_rat', 'utility')
|
||||
|
||||
@@ -8,8 +8,8 @@ class BaseCriteria(models.Model):
|
||||
rating = models.IntegerField(verbose_name='Рейтинг', default=5, blank=True)
|
||||
color = models.CharField(verbose_name='Цвет иконки', max_length=150, null=True, blank=True)
|
||||
class Meta:
|
||||
verbose_name = "Критерии оценки"
|
||||
verbose_name_plural = "Критерии оценки"
|
||||
verbose_name = "Справочник - Критерии оценки"
|
||||
verbose_name_plural = "Справочник - Критерии оценки"
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "front",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"dependencies": {
|
||||
"@fullcalendar/core": "^6.1.8",
|
||||
"@fullcalendar/daygrid": "^6.1.8",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
|
||||
|
After Width: | Height: | Size: 593 KiB |
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 113 KiB |
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<full-calendar :options="calendarOptions" />
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -15,18 +16,25 @@ import multiMonthPlugin from '@fullcalendar/multimonth'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'Calendar',
|
||||
name: 'calendar-full',
|
||||
|
||||
props: {
|
||||
initial: {
|
||||
type: String,
|
||||
default: 'multiMonthYear'
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
FullCalendar
|
||||
},
|
||||
|
||||
setup() {
|
||||
setup(props) {
|
||||
|
||||
const calendarOptions = reactive({
|
||||
plugins: [ dayGridPlugin, interactionPlugin, timeGridPlugin, listPlugin, multiMonthPlugin ],
|
||||
initialView: 'dayGridMonth',
|
||||
|
||||
initialView: props.initial,
|
||||
dayMaxEventRows: 2,
|
||||
locale: 'ru',
|
||||
buttonText: {
|
||||
today: 'Сегодня',
|
||||
@@ -38,37 +46,67 @@ export default {
|
||||
},
|
||||
firstDay:'1',
|
||||
events: [],
|
||||
// eventDidMount: function(info) {
|
||||
|
||||
|
||||
// const dayEl = info.el.closest('.fc-daygrid-day')
|
||||
// dayEl.style.backgroundColor = 'red'
|
||||
// },
|
||||
// datesRender: function(info) {
|
||||
|
||||
|
||||
// const start = info.view.activeStart
|
||||
// const end = info.view.activeEnd
|
||||
// let daysEls = document.querySelectorAll('.fc-daygrid-day')
|
||||
// console.log(daysEls , ' info-------------');
|
||||
// },
|
||||
|
||||
editable: true,
|
||||
headerToolbar: {
|
||||
left: 'prev next today multiMonthYear',
|
||||
headerToolbar: {
|
||||
left: 'prev',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth listDay listYear'
|
||||
},
|
||||
multiMonthMaxColumns: 2,
|
||||
buttonIcons: {
|
||||
prev:'chevron-left',
|
||||
},
|
||||
displayEventEnd: true,
|
||||
|
||||
right: 'next'
|
||||
}
|
||||
|
||||
,
|
||||
eventRender: function(eventObj, $el) {
|
||||
$el.popover({
|
||||
title: eventObj.title,
|
||||
content: eventObj.description,
|
||||
trigger: 'hover',
|
||||
placement: 'top',
|
||||
container: 'body'
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// eventDidMount: function(info) {
|
||||
// console.log(info.event.extendedProps);
|
||||
// {description: "Lecture", department: "BioChemistry"}
|
||||
// },
|
||||
aspectRatio: 1,
|
||||
multiMonthMaxColumns: 2,
|
||||
displayEventEnd: true,
|
||||
height: '100%',
|
||||
stickyHeaderDates: true,
|
||||
dayMaxEventRows: 2,
|
||||
moreLinkContent: function(arg) {
|
||||
return arg.shortText + ' события'
|
||||
},
|
||||
views: {
|
||||
multiMonthYear: {
|
||||
aspectRatio: 2,
|
||||
|
||||
moreLinkContent: function(arg) {
|
||||
return arg.num
|
||||
},
|
||||
// titleFormat: { year: 'numeric', month: '2-digit', day: '2-digit' }
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
// columnFormat: {
|
||||
|
||||
allDayText: 'Весь день',
|
||||
noEventsContent: 'На сегодня событий нет',
|
||||
selectable: true,
|
||||
aspectRatio: 2,
|
||||
|
||||
dateClick: (arg) => {
|
||||
console.log(arg.date);
|
||||
}
|
||||
@@ -83,7 +121,7 @@ export default {
|
||||
data.data[x].map(e=>{
|
||||
let d = new Date(e.planned_date)
|
||||
// console.log(, 'e---------d.addDays(e.count_days)--------e')
|
||||
calendarOptions.events.push({title: x, start: e.planned_date, end: new Date(d.setDate(d.getDate() + e.count_days)).toISOString().split('T')[0]})
|
||||
calendarOptions.events.push({ description: 'description for All Day Event', title: x, start: e.planned_date, end: new Date(d.setDate(d.getDate() + e.count_days)).toISOString().split('T')[0]})
|
||||
|
||||
}
|
||||
|
||||
@@ -115,7 +153,7 @@ export default {
|
||||
}
|
||||
|
||||
.fc-toolbar {
|
||||
padding: 0px;
|
||||
/* padding: 0px; */
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.fc-day-header {
|
||||
@@ -135,15 +173,46 @@ export default {
|
||||
}
|
||||
|
||||
.fc .fc-toolbar.fc-header-toolbar {
|
||||
padding-bottom: 1.2em;
|
||||
padding-bottom: 0.2em;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.fc .fc-daygrid-day-events {
|
||||
|
||||
|
||||
/* .fc .fc-daygrid-day-events {
|
||||
margin-top: -7px;
|
||||
}
|
||||
} */
|
||||
.fc {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.fc-button {
|
||||
|
||||
padding: 1px!important;
|
||||
border-radius: 1em!important;
|
||||
line-height: 0!important;
|
||||
background-color: transparent!important;
|
||||
border-color: transparent!important;
|
||||
|
||||
}
|
||||
|
||||
.fc-icon {
|
||||
color: #000;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.fc-button:focus, .fc-icon {
|
||||
outline: none!important;
|
||||
}
|
||||
|
||||
.fc-button,
|
||||
.fc-buttonactive,
|
||||
.fc-button:focus {
|
||||
border:none!important;
|
||||
}
|
||||
|
||||
.fc-header-toolbar {
|
||||
background: white !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -30,7 +30,7 @@
|
||||
v-model="feedbackdata.nowrating[key].rating"
|
||||
hover
|
||||
half-increments
|
||||
size="small"
|
||||
|
||||
color="yellow-darken-3"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
<template>
|
||||
|
||||
<!-- -->
|
||||
<v-carousel
|
||||
cover
|
||||
height="350"
|
||||
hide-delimiters
|
||||
hide-delimiter-background
|
||||
show-arrows="hover"
|
||||
color="white"
|
||||
|
||||
interval="10000"
|
||||
cover
|
||||
height="450"
|
||||
hide-delimiters
|
||||
hide-delimiter-background
|
||||
show-arrows="hover"
|
||||
color="white"
|
||||
cycle
|
||||
|
||||
|
||||
|
||||
@@ -15,13 +18,12 @@
|
||||
|
||||
<v-carousel-item
|
||||
v-for="(x, i) in carous" :key="i"
|
||||
|
||||
:src="`${burl}${x.link}`"
|
||||
cover
|
||||
eager
|
||||
>
|
||||
|
||||
|
||||
<!-- <my-helper :pretext = 'x'/> -->
|
||||
<v-container
|
||||
fill-height
|
||||
fluid
|
||||
@@ -29,12 +31,39 @@
|
||||
class="flex-column h-100 d-flex"
|
||||
>
|
||||
<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-6">
|
||||
{{x.title}}
|
||||
<v-card-title class="ma-2 text-h3 text-uppercase titles text-text_carous py-5 flex-column">
|
||||
<v-row>
|
||||
<v-col class="pa-0 pl-1 align-self-center">{{x.title}} </v-col>
|
||||
<!-- {{ burl }} {{ x.sender }} -->
|
||||
<v-col class="flex-grow-0 pa-0 pr-1">
|
||||
<v-img
|
||||
|
||||
width="50"
|
||||
:aspect-ratio="1"
|
||||
:src="`${burl}${x.sender}`"
|
||||
cover
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
</v-card-title>
|
||||
<v-card-text class="ml-2 mb-2 text-black w-50 flex-grow-0 py-3 text-text_carous text-h5 bgText overflow-auto font-weight-medium">
|
||||
|
||||
{{x.text}}
|
||||
<v-card-text class="ml-2 mb-0 mb-2 w-50 flex-grow-0 pb-3 text-h6 bgText overflow-auto ">
|
||||
<v-textarea
|
||||
class="text-text_carous mt-n3 text-black textareas pt-2 font-weight-medium"
|
||||
:model-value=x.text
|
||||
variant='plain'
|
||||
readonly
|
||||
auto-grow
|
||||
rows="1"
|
||||
|
||||
hide-details
|
||||
|
||||
|
||||
|
||||
|
||||
/>
|
||||
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
@@ -48,8 +77,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref } from 'vue'
|
||||
import {getfromserverfree} from '@/utils/universal_functions'
|
||||
import { ref, computed } from 'vue'
|
||||
import {getfromserver} from '@/utils/universal_functions'
|
||||
import { baseURL } from '@/utils/axios-api'
|
||||
|
||||
|
||||
@@ -60,13 +89,15 @@ export default {
|
||||
setup() {
|
||||
const burl = baseURL.slice(0,-1)
|
||||
const carous=ref([{link: ""}])
|
||||
|
||||
const imageSrcgrupp=computed(()=> {
|
||||
return new URL(`@/assets/mc.png`, import.meta.url).href;
|
||||
})
|
||||
|
||||
getfromserverfree("api/navigation/carousels/", carous)
|
||||
getfromserver("api/navigation/carousels/", carous)
|
||||
|
||||
|
||||
|
||||
return { burl, carous}
|
||||
return { burl, carous, imageSrcgrupp}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,7 +111,7 @@ export default {
|
||||
|
||||
.bgText {
|
||||
background: #ffffffb0;
|
||||
line-height: 3.0rem!important;
|
||||
line-height: 2.1rem!important;
|
||||
|
||||
}
|
||||
|
||||
@@ -88,4 +119,9 @@ export default {
|
||||
font-family: cursive !important;
|
||||
background: #ffffff8c;
|
||||
}
|
||||
|
||||
.textareas .v-field__input {
|
||||
|
||||
font-size: 1.3em!important;
|
||||
}
|
||||
</style>
|
||||
@@ -37,16 +37,101 @@
|
||||
|
||||
<v-expand-transition>
|
||||
<div v-show="x.show">
|
||||
<v-divider></v-divider>
|
||||
<v-divider/>
|
||||
|
||||
<v-card-text>
|
||||
{{x.text}}
|
||||
</v-card-text>
|
||||
<v-divider/>
|
||||
<v-card-actions >
|
||||
<v-row >
|
||||
<v-col>
|
||||
<v-btn
|
||||
variant="text"
|
||||
icon="mdi-thumb-up-outline"
|
||||
color="blue-darken-3"
|
||||
@click="toggleIncrementLike"
|
||||
/>
|
||||
{{ incrementLikes }}
|
||||
</v-col>
|
||||
<v-col class=" ml-8">
|
||||
<v-btn
|
||||
variant="text"
|
||||
icon="mdi-message-text-outline"
|
||||
color="teal"
|
||||
@click="commentadd"
|
||||
/>
|
||||
{{ message }}
|
||||
<v-btn
|
||||
:icon="x.show ? 'mdi-chevron-up' : 'mdi-chevron-down'"
|
||||
@click="x.show = !x.show"
|
||||
></v-btn>
|
||||
</v-col>
|
||||
<v-col class="text-center pr-0">
|
||||
<v-btn
|
||||
variant="text"
|
||||
icon="mdi-thumb-down-outline"
|
||||
color="red-lighten-2"
|
||||
@click="toggleDecrementLike"
|
||||
/>
|
||||
{{ derementLikes }}
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</v-card-actions>
|
||||
<v-divider class="mb-2"/>
|
||||
</div>
|
||||
|
||||
</v-expand-transition>
|
||||
<v-expand-transition>
|
||||
<div v-show="commentShow">
|
||||
Тут комменты
|
||||
</div>
|
||||
</v-expand-transition>
|
||||
</v-card>
|
||||
|
||||
<v-row justify="center">
|
||||
<v-dialog
|
||||
v-model="dialogCommentShow"
|
||||
persistent
|
||||
width="550"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title class="text-h5">
|
||||
Прокоментировать новость
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-textarea
|
||||
variant="solo"
|
||||
hide-details
|
||||
rows="5"
|
||||
|
||||
></v-textarea>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="blue-darken-1"
|
||||
variant="text"
|
||||
@click="dialogCommentShow = false"
|
||||
>
|
||||
Отмена
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="blue-darken-1"
|
||||
variant="text"
|
||||
@click="dialogCommentShow = false"
|
||||
>
|
||||
Отправить
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -64,6 +149,41 @@ export default {
|
||||
|
||||
const newss=ref([])
|
||||
const show=ref(false)
|
||||
const incrementLikes = ref(0)
|
||||
const derementLikes = ref(0)
|
||||
const likedI = ref(false)
|
||||
const likedD = ref(false)
|
||||
const message = ref(0)
|
||||
const commentShow = ref(false)
|
||||
const dialogCommentShow = ref(false)
|
||||
|
||||
const toggleIncrementLike = () => {
|
||||
if (likedI.value) {
|
||||
incrementLikes.value--
|
||||
}
|
||||
else {
|
||||
incrementLikes.value++
|
||||
if(likedD.value){
|
||||
derementLikes.value--
|
||||
likedD.value = false
|
||||
}
|
||||
}
|
||||
likedI.value=!likedI.value
|
||||
}
|
||||
|
||||
const toggleDecrementLike = () => {
|
||||
if (likedD.value) {
|
||||
derementLikes.value--
|
||||
}
|
||||
else {
|
||||
derementLikes.value++
|
||||
if(likedI.value){
|
||||
incrementLikes.value--
|
||||
likedI.value = false
|
||||
}
|
||||
}
|
||||
likedD.value=!likedD.value
|
||||
}
|
||||
|
||||
const burl = baseURL.slice(0,-1)
|
||||
|
||||
@@ -80,12 +200,26 @@ export default {
|
||||
}
|
||||
}, {deep:true})
|
||||
|
||||
const commentadd = () => {
|
||||
dialogCommentShow.value=!dialogCommentShow.value
|
||||
// commentShow.value =!commentShow.value
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
newss,
|
||||
show,
|
||||
burl,
|
||||
limitText
|
||||
limitText,
|
||||
incrementLikes,
|
||||
derementLikes,
|
||||
message,
|
||||
commentShow,
|
||||
toggleIncrementLike,
|
||||
toggleDecrementLike,
|
||||
dialogCommentShow,
|
||||
commentadd
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,101 +3,41 @@
|
||||
<v-row>
|
||||
<v-col class="d-flex flex-column" lg=7>
|
||||
<v-row class="flex-grow-0">
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 pb-0">
|
||||
<Carousel-list/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<!-- <v-col class="pt-1 flex-column d-flex mt-3" > -->
|
||||
<!-- <v-row class="flex-column flex-grow-0 mb-1">
|
||||
<Carousel-numbers
|
||||
:digitalData="stat"/>
|
||||
</v-row> -->
|
||||
<!-- <v-row class="pt-1 flex-column mt-0 mb-0 "> -->
|
||||
<!-- <v-card class="d-flex flex-column ml-3">
|
||||
<div class="fg">
|
||||
<v-banner
|
||||
lines="one"
|
||||
icon="mdi-lock"
|
||||
color="deep-purple-accent-4"
|
||||
class="my-4"
|
||||
>
|
||||
<v-banner-text>
|
||||
{{date1}}
|
||||
</v-banner-text>
|
||||
|
||||
<template v-slot:actions>
|
||||
<v-btn>Action</v-btn>
|
||||
</template>
|
||||
</v-banner>
|
||||
|
||||
<v-banner
|
||||
lines="two"
|
||||
icon="mdi-weather-hurricane"
|
||||
color="error"
|
||||
class="my-4"
|
||||
>
|
||||
<v-banner-text>
|
||||
Banner with two lines of text. If the text is too long to fit on two lines then an ellipsis will be used to hide the remaining content. So this next line will be hidden.
|
||||
</v-banner-text>
|
||||
|
||||
<template v-slot:actions>
|
||||
<v-btn>Action</v-btn>
|
||||
</template>
|
||||
</v-banner>
|
||||
|
||||
<v-banner
|
||||
lines="three"
|
||||
icon="$warning"
|
||||
color="warning"
|
||||
class="my-4"
|
||||
>
|
||||
<v-banner-text>
|
||||
Banner with three lines of text. One or two lines is preferable. Three lines should be considered the absolute maximum length on desktop in order to keep messages short and actionable.
|
||||
</v-banner-text>
|
||||
|
||||
<template v-slot:actions>
|
||||
<v-btn>Action</v-btn>
|
||||
</template>
|
||||
</v-banner>
|
||||
<v-banner
|
||||
lines="three"
|
||||
icon="$warning"
|
||||
color="warning"
|
||||
class="my-4"
|
||||
>
|
||||
<v-banner-text>
|
||||
Banner with three lines of text. One or two lines is preferable. Three lines should be considered the absolute maximum length on desktop in order to keep messages short and actionable.
|
||||
</v-banner-text>
|
||||
|
||||
<template v-slot:actions>
|
||||
<v-btn>Action</v-btn>
|
||||
</template>
|
||||
</v-banner>
|
||||
</div>
|
||||
</v-card> -->
|
||||
|
||||
<!-- <Carousel-numbers
|
||||
:digitalData="onlines"
|
||||
/> -->
|
||||
|
||||
<!-- </v-row> -->
|
||||
|
||||
|
||||
<!-- </v-col> -->
|
||||
<!-- <v-row>
|
||||
<v-col class="pt-1 pr-0 pb-0 flex-col">
|
||||
<calendar/>
|
||||
<!-- <v-locale-provider > -->
|
||||
<!-- <v-date-picker
|
||||
v-model="date1"
|
||||
class="d-flex pik"
|
||||
color="teal-accent-4"
|
||||
|
||||
|
||||
/> -->
|
||||
<!-- </v-locale-provider> -->
|
||||
<Calendar-full
|
||||
:initial="'listYear'"
|
||||
:head=true
|
||||
|
||||
/>
|
||||
</v-col>
|
||||
</v-row> -->
|
||||
<v-row>
|
||||
<v-col class="pr-0 pt-0 flex-column">
|
||||
<v-card class="h-100 bg-transparent pa-2 d-flex flex-column">
|
||||
<v-row class="d-flex">
|
||||
<v-col> <Calendar-full
|
||||
/></v-col>
|
||||
<v-col> <Calendar-full
|
||||
:initial="'listYear'"
|
||||
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</v-card>
|
||||
</v-col>
|
||||
<!-- </v-locale-provider> -->
|
||||
<!-- </v-col> -->
|
||||
<!-- <v-col>
|
||||
<v-btn
|
||||
@click="proba">
|
||||
@@ -108,8 +48,8 @@
|
||||
</v-row>
|
||||
|
||||
</v-col>
|
||||
<v-col class="flex-column d-flex px-0">
|
||||
<v-row class="flex-grow-1 ma-0">
|
||||
<v-col class="flex-column d-flex flex-grow-0 px-0" lg="2">
|
||||
<v-row class="flex-grow-1 ma-0 mx-1">
|
||||
<v-col class="pt-0">
|
||||
<v-card class="h-100 flex-column">
|
||||
<v-row v-for="x in stat" :key="x">
|
||||
@@ -122,18 +62,13 @@
|
||||
elevation="0"
|
||||
|
||||
>
|
||||
<!-- <v-img
|
||||
height="100"
|
||||
:src="`${burl}${n.img}`"
|
||||
cover
|
||||
class="text-white"
|
||||
> -->
|
||||
|
||||
<v-card class="h-100 text-center g text-numeral">
|
||||
<v-card-title class="statstyle py-0 text-overline font-weight-bold">
|
||||
{{x.status}}
|
||||
</v-card-title>
|
||||
<v-card-text class="numstyle mt-2 py-0 font-weight-bold">
|
||||
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='Number(x.num)' :duration='1'/>
|
||||
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='Number(x.num)' :duration='2'/>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
@@ -145,7 +80,7 @@
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="flex-grow-0 ma-0">
|
||||
<v-row class="flex-grow-0 ma-0 mx-1">
|
||||
<v-col class="py-0">
|
||||
<v-card class="h-100 flex-colmn"
|
||||
>
|
||||
@@ -173,7 +108,7 @@
|
||||
</v-row>
|
||||
|
||||
</v-col>
|
||||
<v-col class="d-flex flex-column justify-space-between px-0 py-2 pb-0" lg=3>
|
||||
<v-col class="d-flex flex-column justify-space-between px-0 py-2 pr-3 pb-0" lg=3>
|
||||
<v-card
|
||||
class="h-100 bg-transparent "
|
||||
elevation="0"
|
||||
@@ -205,7 +140,7 @@
|
||||
import CarouselList from '@/components/carousel-list.vue'
|
||||
import CarouselNumbers from '@/components/carousel-numbers.vue'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
import Calendar from '@/components/UI/calendar.vue'
|
||||
import CalendarFull from '@/components/UI/Calendar-full.vue'
|
||||
|
||||
|
||||
export default {
|
||||
@@ -214,7 +149,7 @@
|
||||
NewsList,
|
||||
CarouselList,
|
||||
CarouselNumbers,
|
||||
Calendar
|
||||
CalendarFull
|
||||
},
|
||||
|
||||
setup(){
|
||||
|
||||
@@ -8,5 +8,7 @@ class GeneralVacationAdmin(admin.ModelAdmin):
|
||||
def get_name(self, obj):
|
||||
print(obj.user.fio(), '----------------obj.user.fio()')
|
||||
return obj.user.fio()
|
||||
|
||||
|
||||
|
||||
admin.site.register(GeneralVacation, GeneralVacationAdmin)
|
||||
|
After Width: | Height: | Size: 593 KiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 346 KiB |
|
After Width: | Height: | Size: 346 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 346 KiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 227 KiB |
|
After Width: | Height: | Size: 345 KiB |
|
After Width: | Height: | Size: 207 KiB |
@@ -1,5 +1,5 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from .models import *
|
||||
|
||||
@@ -12,13 +12,39 @@ class NewsAdmin(admin.ModelAdmin):
|
||||
super().save_model(request, obj, form, change)
|
||||
|
||||
class CarouselsAdmin(admin.ModelAdmin):
|
||||
list_display=('title', 'cdate', 'enddate', 'get_html_photo', 'link','published', 'sender')
|
||||
readonly_fields=('get_html_photo',)
|
||||
list_editable=('link','published', 'cdate', 'enddate', 'sender')
|
||||
list_filter=('cdate', 'enddate','published')
|
||||
fields=(('title', 'sender'), 'published', 'text', ('cdate', 'enddate'), ('link','get_html_photo'))
|
||||
|
||||
def save_model(self, request, obj, form, change):
|
||||
|
||||
if (request.user.username != 'admin') :
|
||||
obj.author = request.user
|
||||
else :
|
||||
obj.author = User.objects.get(id=15)
|
||||
super().save_model(request, obj, form, change)
|
||||
|
||||
def get_html_photo(self, object):
|
||||
if object.link:
|
||||
return mark_safe(f"<img src='{object.link.url}' width=50>")
|
||||
|
||||
get_html_photo.short_description="Изображение"
|
||||
|
||||
class BaseSenderAdmin(admin.ModelAdmin):
|
||||
list_display=('name', 'get_html_photo', 'img')
|
||||
list_editable=('img',)
|
||||
fields=('name', ('img', 'get_html_photo'))
|
||||
readonly_fields=('get_html_photo',)
|
||||
|
||||
def get_html_photo(self, object):
|
||||
if object.img:
|
||||
return mark_safe(f"<img src='{object.img.url}' width=50>")
|
||||
|
||||
get_html_photo.short_description="Изображение"
|
||||
|
||||
admin.site.register(Links)
|
||||
admin.site.register(News,NewsAdmin)
|
||||
admin.site.register(Carousels,CarouselsAdmin)
|
||||
admin.site.register(BaseSender, BaseSenderAdmin)
|
||||
@@ -4,3 +4,6 @@ from django.apps import AppConfig
|
||||
class NavigationConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'navigation'
|
||||
verbose_name = "Навигация"
|
||||
|
||||
|
||||
@@ -3,39 +3,79 @@ from accounts.models import *
|
||||
# Create your models here.
|
||||
from django.conf import settings
|
||||
|
||||
class BaseSender(models.Model):
|
||||
name = models.CharField(verbose_name='Название', max_length=150, blank=True, db_index=True)
|
||||
img = models.ImageField(verbose_name='Картинка', null=True, blank=True, upload_to='senderimage')
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Справочник - Тематика"
|
||||
verbose_name_plural = "Справочник - Тематика"
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
class Links(models.Model):
|
||||
name = models.CharField(db_index=True, max_length=255)
|
||||
link = models.CharField(db_index=True, max_length=255)
|
||||
imagecode = models.CharField(db_index=True, max_length=25)
|
||||
order = models.IntegerField()
|
||||
|
||||
name = models.CharField(db_index=True, max_length=255, verbose_name='Заголовок')
|
||||
link = models.CharField(db_index=True, max_length=255, verbose_name='Ссылка')
|
||||
imagecode = models.CharField(db_index=True, max_length=25, verbose_name='Иконка')
|
||||
order = models.IntegerField(verbose_name='Порядок сортировки')
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Ссылка на ресурс"
|
||||
verbose_name_plural = "Ссылки на ресурсы"
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
|
||||
|
||||
class News(models.Model):
|
||||
title=models.CharField( max_length=255)
|
||||
text= models.TextField(null=True)
|
||||
cdate =models.DateTimeField(auto_now_add=True)
|
||||
author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT)
|
||||
link = models.ImageField(upload_to='newsimage/%Y/%m/%d', null=True, default="newsimage/default.jpg")
|
||||
title=models.CharField(max_length=255, verbose_name='Заголовок')
|
||||
text= models.TextField(null=True, verbose_name='Сообщение')
|
||||
cdate =models.DateTimeField(auto_now_add=True, 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='Изображение')
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Новостная лента"
|
||||
verbose_name_plural = "Новостная лента"
|
||||
|
||||
def __str__(self):
|
||||
return str(self.title)
|
||||
|
||||
class CommnetNews(models.Model):
|
||||
author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT, verbose_name='Автор')
|
||||
score = models.BooleanField(default=None, null=True, verbose_name='Оценка лайк/дизлайк')
|
||||
text= models.TextField(null=True, verbose_name='Сообщение')
|
||||
cdate =models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')
|
||||
news = models.ForeignKey(News, on_delete=models.PROTECT, related_name='get_news', verbose_name='Новость')
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Коммантарий новости"
|
||||
verbose_name_plural = "Коммантарии новостей"
|
||||
|
||||
def __str__(self):
|
||||
return str(self.author)
|
||||
|
||||
|
||||
class Carousels(models.Model):
|
||||
title=models.CharField( max_length=255)
|
||||
text= models.TextField(null=True)
|
||||
cdate =models.DateTimeField(auto_now_add=True)
|
||||
author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT)
|
||||
link = models.ImageField(upload_to='newsimage/%Y/%m/%d', null=True, default="newsimage/default.jpg")
|
||||
published = models.BooleanField(default=False, verbose_name='Опубликован')
|
||||
order = models.IntegerField(default=False)
|
||||
|
||||
title=models.CharField( max_length=255, verbose_name='Заголовок')
|
||||
text= models.TextField(null=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='Картинка')
|
||||
published = models.BooleanField(default=True, verbose_name='Опубликован')
|
||||
enddate = models.DateTimeField(default=datetime.now().replace(hour=23,minute=0,second=0,microsecond=0) + timedelta(days=7), verbose_name='Дата снятия с публикации')
|
||||
sender = models.ForeignKey(BaseSender, on_delete=models.PROTECT, related_name='get_sender', verbose_name='Тематика')
|
||||
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Карусель новостей"
|
||||
verbose_name_plural = "Карусель новостей"
|
||||
|
||||
def __str__(self):
|
||||
return str(self.title)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ class NewsSerializer(serializers.ModelSerializer):
|
||||
model = News
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
|
||||
class CarouselsSerializer(serializers.ModelSerializer):
|
||||
|
||||
class Meta:
|
||||
|
||||
@@ -6,6 +6,8 @@ from rest_framework.permissions import AllowAny, IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from .serializers import *
|
||||
from userauth.models import *
|
||||
from general_vacation.models import *
|
||||
from django.db.models import Q
|
||||
|
||||
class LinkAPIView(ListAPIView):
|
||||
permission_classes = (AllowAny,)
|
||||
@@ -46,18 +48,32 @@ class CarouselsAPIView(ListAPIView):
|
||||
|
||||
|
||||
def get(self, request):
|
||||
|
||||
queryset = Carousels.objects.filter(published=True).order_by('order')
|
||||
# serializer = self.serializer_class(queryset, many=True)
|
||||
# print(serializer.data)
|
||||
|
||||
|
||||
queryset = Carousels.objects.filter(published=True, cdate__lte=datetime.now(), enddate__gte=datetime.now()).order_by('-cdate')
|
||||
|
||||
vacation = GeneralVacation.objects.filter(user_id=request.user.id, planned_date__lte=datetime.now() + timedelta(days=7))
|
||||
# print(vacation, '-----------------')
|
||||
# if vacation:
|
||||
# Carousels.objects.update(published=True)
|
||||
# else:
|
||||
# Carousels.objects.filter().update(published=False)
|
||||
# Carousels.objects.update_or_create(id=request.data['nowcomment']['id'],user_id=15, defaults={'comment':request.data['nowcomment']['comment'], 'time_create':datetime.datetime.now()})
|
||||
|
||||
|
||||
result = []
|
||||
for x in queryset:
|
||||
|
||||
for x in queryset:
|
||||
a=model_to_dict(x)
|
||||
a['link']= str(x.link.url)
|
||||
a['show'] = False
|
||||
a['author'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x.author.username))
|
||||
result.append(a)
|
||||
if x.sender.img:
|
||||
a['sender'] = str(x.sender.img.url)
|
||||
else:
|
||||
a['sender'] = None
|
||||
result.append(a)
|
||||
print(request.user.id, '-------------------------------------------')
|
||||
|
||||
|
||||
return Response(result)
|
||||
|
||||
@@ -19,7 +19,7 @@ class Counter(ListAPIView):
|
||||
# return Response(qs)
|
||||
|
||||
def post(self, request):
|
||||
print(request.data['user__id'])
|
||||
# print(request.data['user__id'])
|
||||
if request.data['user__id'] is not None:
|
||||
# print("sdddddd")
|
||||
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today())
|
||||
|
||||