Merge branch 'razrab' into feature/create_app
No files matched your search
@@ -5,34 +5,16 @@ from django.db.models import Avg
|
|||||||
class BaseCriteriaAdmin(admin.ModelAdmin):
|
class BaseCriteriaAdmin(admin.ModelAdmin):
|
||||||
list_display=('name', 'rating')
|
list_display=('name', 'rating')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RatingStatusInline(admin.TabularInline):
|
class RatingStatusInline(admin.TabularInline):
|
||||||
model = RatingStatus
|
model = RatingStatus
|
||||||
fields = ( 'crit', 'rating')
|
fields = ( 'crit', 'rating')
|
||||||
readonly_fields=( 'crit', 'rating')
|
readonly_fields=( 'crit', 'rating')
|
||||||
can_delete = False
|
can_delete = False
|
||||||
show_change_link = False
|
show_change_link = False
|
||||||
|
|
||||||
extra = 0
|
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):
|
class UserCommentAdmin(admin.ModelAdmin):
|
||||||
fields = ( 'comment', ('get_rat', 'user', 'time_create'))
|
fields = ( 'comment', ('get_rat', 'user', 'time_create'))
|
||||||
list_display=('user', 'time_create', 'comment', 'get_rat', 'utility')
|
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)
|
rating = models.IntegerField(verbose_name='Рейтинг', default=5, blank=True)
|
||||||
color = models.CharField(verbose_name='Цвет иконки', max_length=150, null=True, blank=True)
|
color = models.CharField(verbose_name='Цвет иконки', max_length=150, null=True, blank=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Критерии оценки"
|
verbose_name = "Справочник - Критерии оценки"
|
||||||
verbose_name_plural = "Критерии оценки"
|
verbose_name_plural = "Справочник - Критерии оценки"
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.name)
|
return str(self.name)
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.10",
|
"version": "0.0.12",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.10",
|
"version": "0.0.12",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fullcalendar/core": "^6.1.8",
|
"@fullcalendar/core": "^6.1.8",
|
||||||
"@fullcalendar/daygrid": "^6.1.8",
|
"@fullcalendar/daygrid": "^6.1.8",
|
||||||
"@fullcalendar/interaction": "^6.1.8",
|
"@fullcalendar/interaction": "^6.1.8",
|
||||||
"@fullcalendar/list": "^6.1.8",
|
"@fullcalendar/list": "^6.1.8",
|
||||||
|
"@fullcalendar/multimonth": "^6.1.9",
|
||||||
"@fullcalendar/timegrid": "^6.1.8",
|
"@fullcalendar/timegrid": "^6.1.8",
|
||||||
"@fullcalendar/vue3": "^6.1.8",
|
"@fullcalendar/vue3": "^6.1.8",
|
||||||
"@mdi/font": "7.0.96",
|
"@mdi/font": "7.0.96",
|
||||||
@@ -2695,19 +2696,19 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@fullcalendar/core": {
|
"node_modules/@fullcalendar/core": {
|
||||||
"version": "6.1.8",
|
"version": "6.1.9",
|
||||||
"resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.9.tgz",
|
||||||
"integrity": "sha512-i8JBIvZCWGO9dsMEDcx9bnsQZ9PtGSJdOXGgWbhLaGq2iq41OBdp9g9gM4b/Otv2oK8bL5Gl6CsMmb/HkDtA6Q==",
|
"integrity": "sha512-eeG+z9BWerdsU9Ac6j16rpYpPnE0wxtnEHiHrh/u/ADbGTR3hCOjCD9PxQOfhOTHbWOVs7JQunGcksSPu5WZBQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"preact": "~10.12.1"
|
"preact": "~10.12.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@fullcalendar/daygrid": {
|
"node_modules/@fullcalendar/daygrid": {
|
||||||
"version": "6.1.8",
|
"version": "6.1.9",
|
||||||
"resolved": "https://registry.npmjs.org/@fullcalendar/daygrid/-/daygrid-6.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/@fullcalendar/daygrid/-/daygrid-6.1.9.tgz",
|
||||||
"integrity": "sha512-kCZxQFKb9Vqa3CZRX0v7rMSJ2mlTt4gDpyLfiNJKxUAq7W51uKurPaFZWicaXy1ESHVBxKNlbx5uNjBpyu50JQ==",
|
"integrity": "sha512-o/6joH/7lmVHXAkbaa/tUbzWYnGp/LgfdiFyYPkqQbjKEeivNZWF1WhHqFbhx0zbFONSHtrvkjY2bjr+Ef2quQ==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@fullcalendar/core": "~6.1.8"
|
"@fullcalendar/core": "~6.1.9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@fullcalendar/interaction": {
|
"node_modules/@fullcalendar/interaction": {
|
||||||
@@ -2726,6 +2727,17 @@
|
|||||||
"@fullcalendar/core": "~6.1.8"
|
"@fullcalendar/core": "~6.1.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@fullcalendar/multimonth": {
|
||||||
|
"version": "6.1.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fullcalendar/multimonth/-/multimonth-6.1.9.tgz",
|
||||||
|
"integrity": "sha512-YpH1NL6RzdM1wO2nFJ3pNMo9xhd6i2WuE+e7SnGi7q1lO+ZZ77h5Fja5JKcpuIQUFHpi+m6vTzihIV8DT44NnQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@fullcalendar/daygrid": "~6.1.9"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@fullcalendar/core": "~6.1.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@fullcalendar/timegrid": {
|
"node_modules/@fullcalendar/timegrid": {
|
||||||
"version": "6.1.8",
|
"version": "6.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-6.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-6.1.8.tgz",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.10",
|
"version": "0.0.12",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
"@fullcalendar/daygrid": "^6.1.8",
|
"@fullcalendar/daygrid": "^6.1.8",
|
||||||
"@fullcalendar/interaction": "^6.1.8",
|
"@fullcalendar/interaction": "^6.1.8",
|
||||||
"@fullcalendar/list": "^6.1.8",
|
"@fullcalendar/list": "^6.1.8",
|
||||||
|
"@fullcalendar/multimonth": "^6.1.9",
|
||||||
"@fullcalendar/timegrid": "^6.1.8",
|
"@fullcalendar/timegrid": "^6.1.8",
|
||||||
"@fullcalendar/vue3": "^6.1.8",
|
"@fullcalendar/vue3": "^6.1.8",
|
||||||
"@mdi/font": "7.0.96",
|
"@mdi/font": "7.0.96",
|
||||||
|
|||||||
|
After Width: | Height: | Size: 593 KiB |
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 113 KiB |
@@ -0,0 +1,218 @@
|
|||||||
|
<template>
|
||||||
|
<full-calendar :options="calendarOptions" />
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {reactive, ref, onMounted} from 'vue'
|
||||||
|
// import '@fullcalendar/core/vdom'
|
||||||
|
import FullCalendar from '@fullcalendar/vue3'
|
||||||
|
import dayGridPlugin from '@fullcalendar/daygrid'
|
||||||
|
import interactionPlugin from '@fullcalendar/interaction'
|
||||||
|
import listPlugin from '@fullcalendar/list'
|
||||||
|
import timeGridPlugin from '@fullcalendar/interaction'
|
||||||
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
|
import multiMonthPlugin from '@fullcalendar/multimonth'
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'calendar-full',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
initial: {
|
||||||
|
type: String,
|
||||||
|
default: 'multiMonthYear'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
FullCalendar
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props) {
|
||||||
|
|
||||||
|
const calendarOptions = reactive({
|
||||||
|
plugins: [ dayGridPlugin, interactionPlugin, timeGridPlugin, listPlugin, multiMonthPlugin ],
|
||||||
|
initialView: props.initial,
|
||||||
|
dayMaxEventRows: 2,
|
||||||
|
locale: 'ru',
|
||||||
|
buttonText: {
|
||||||
|
today: 'Сегодня',
|
||||||
|
month: 'Месяц',
|
||||||
|
week: 'Неделя',
|
||||||
|
day: 'День',
|
||||||
|
list: 'Список',
|
||||||
|
year: 'Год'
|
||||||
|
},
|
||||||
|
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',
|
||||||
|
center: 'title',
|
||||||
|
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: {
|
||||||
|
|
||||||
|
moreLinkContent: function(arg) {
|
||||||
|
return arg.num
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
allDayText: 'Весь день',
|
||||||
|
noEventsContent: 'На сегодня событий нет',
|
||||||
|
selectable: true,
|
||||||
|
|
||||||
|
dateClick: (arg) => {
|
||||||
|
console.log(arg.date);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function f_generalvacation() {
|
||||||
|
axiosApiInstance.get('api/general_vacation/generalvacation/')
|
||||||
|
.then(data => {
|
||||||
|
|
||||||
|
for (let x in data.data) {
|
||||||
|
|
||||||
|
data.data[x].map(e=>{
|
||||||
|
let d = new Date(e.planned_date)
|
||||||
|
// console.log(, 'e---------d.addDays(e.count_days)--------e')
|
||||||
|
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]})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log(data.data , 'genvacation--------------------');
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
f_generalvacation()
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
// genvacation.value[0].planned_date
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return { calendarOptions }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#fc-dom-1:first-letter {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-toolbar {
|
||||||
|
/* padding: 0px; */
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
.fc-day-header {
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.fc-day {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.fc-time-grid-event {
|
||||||
|
background-color: #e6e6e6;
|
||||||
|
border: none;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.fc-event-title {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc .fc-toolbar.fc-header-toolbar {
|
||||||
|
padding-bottom: 0.2em;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* .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>
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
<template>
|
|
||||||
<full-calendar :options="calendarOptions" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {reactive, ref, onMounted} from 'vue'
|
|
||||||
// import '@fullcalendar/core/vdom'
|
|
||||||
import FullCalendar from '@fullcalendar/vue3'
|
|
||||||
import dayGridPlugin from '@fullcalendar/daygrid'
|
|
||||||
import interactionPlugin from '@fullcalendar/interaction'
|
|
||||||
import listPlugin from '@fullcalendar/list'
|
|
||||||
import timeGridPlugin from '@fullcalendar/interaction'
|
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'Calendar',
|
|
||||||
|
|
||||||
components: {
|
|
||||||
FullCalendar
|
|
||||||
},
|
|
||||||
|
|
||||||
setup() {
|
|
||||||
|
|
||||||
const calendarOptions = reactive({
|
|
||||||
plugins: [ dayGridPlugin, interactionPlugin, timeGridPlugin, listPlugin ],
|
|
||||||
initialView: 'dayGridMonth',
|
|
||||||
locale: 'ru',
|
|
||||||
buttonText: {
|
|
||||||
today: 'Сегодня',
|
|
||||||
month: 'Месяц',
|
|
||||||
week: 'Неделя',
|
|
||||||
day: 'День',
|
|
||||||
list: 'Список'
|
|
||||||
},
|
|
||||||
firstDay:'1',
|
|
||||||
events: [],
|
|
||||||
editable: true,
|
|
||||||
headerToolbar: {
|
|
||||||
left: 'prev, next, today',
|
|
||||||
center: 'title',
|
|
||||||
right: 'dayGridMonth, dayGridWeek, dayGridDay, listDay'
|
|
||||||
},
|
|
||||||
|
|
||||||
dateClick: (arg) => {
|
|
||||||
console.log(arg.date);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
function f_generalvacation() {
|
|
||||||
axiosApiInstance.get('api/general_vacation/generalvacation/')
|
|
||||||
.then(data => {
|
|
||||||
|
|
||||||
|
|
||||||
console.log(data.data , 'genvacation--------------------');
|
|
||||||
calendarOptions.events = [{ title: 'Отпуск', start: '2023-09-01', end: '2023-09-25'}]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
f_generalvacation()
|
|
||||||
console.log(typeof(huf), 'hu--------------');
|
|
||||||
|
|
||||||
})
|
|
||||||
// genvacation.value[0].planned_date
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return { calendarOptions }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.red {
|
|
||||||
background: rgb(235, 77, 77) !important;
|
|
||||||
color: whitesmoke !important;
|
|
||||||
}
|
|
||||||
.blue {
|
|
||||||
background: rgb(59, 59, 163) !important;
|
|
||||||
color: whitesmoke !important;
|
|
||||||
}
|
|
||||||
.orange {
|
|
||||||
background: orange !important;
|
|
||||||
color: white !important;
|
|
||||||
}
|
|
||||||
.green {
|
|
||||||
background: rgb(49, 155, 49) !important;
|
|
||||||
color: white !important;
|
|
||||||
}
|
|
||||||
.blue,
|
|
||||||
.orange,
|
|
||||||
.red,
|
|
||||||
.green {
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 500;
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
.event-item {
|
|
||||||
padding: 2px 0 2px 4px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
v-model="feedbackdata.nowrating[key].rating"
|
v-model="feedbackdata.nowrating[key].rating"
|
||||||
hover
|
hover
|
||||||
half-increments
|
half-increments
|
||||||
size="small"
|
|
||||||
color="yellow-darken-3"
|
color="yellow-darken-3"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- -->
|
||||||
<v-carousel
|
<v-carousel
|
||||||
|
|
||||||
|
interval="10000"
|
||||||
cover
|
cover
|
||||||
height="300"
|
height="450"
|
||||||
hide-delimiters
|
hide-delimiters
|
||||||
hide-delimiter-background
|
hide-delimiter-background
|
||||||
show-arrows="hover"
|
show-arrows="hover"
|
||||||
color="white"
|
color="white"
|
||||||
|
cycle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -15,13 +18,12 @@
|
|||||||
|
|
||||||
<v-carousel-item
|
<v-carousel-item
|
||||||
v-for="(x, i) in carous" :key="i"
|
v-for="(x, i) in carous" :key="i"
|
||||||
|
|
||||||
:src="`${burl}${x.link}`"
|
:src="`${burl}${x.link}`"
|
||||||
cover
|
cover
|
||||||
eager
|
eager
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<!-- <my-helper :pretext = 'x'/> -->
|
||||||
<v-container
|
<v-container
|
||||||
fill-height
|
fill-height
|
||||||
fluid
|
fluid
|
||||||
@@ -29,12 +31,39 @@
|
|||||||
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-6">
|
<v-card-title class="ma-2 text-h3 text-uppercase titles text-text_carous py-5 flex-column">
|
||||||
{{x.title}}
|
<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-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">
|
<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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
{{x.text}}
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
@@ -48,8 +77,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import {getfromserverfree} from '@/utils/universal_functions'
|
import {getfromserver} from '@/utils/universal_functions'
|
||||||
import { baseURL } from '@/utils/axios-api'
|
import { baseURL } from '@/utils/axios-api'
|
||||||
|
|
||||||
|
|
||||||
@@ -60,13 +89,15 @@ export default {
|
|||||||
setup() {
|
setup() {
|
||||||
const burl = baseURL.slice(0,-1)
|
const burl = baseURL.slice(0,-1)
|
||||||
const carous=ref([{link: ""}])
|
const carous=ref([{link: ""}])
|
||||||
|
const imageSrcgrupp=computed(()=> {
|
||||||
|
return new URL(`@/assets/mc.png`, import.meta.url).href;
|
||||||
|
})
|
||||||
|
|
||||||
|
getfromserver("api/navigation/carousels/", carous)
|
||||||
getfromserverfree("api/navigation/carousels/", carous)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return { burl, carous}
|
return { burl, carous, imageSrcgrupp}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -80,7 +111,7 @@ export default {
|
|||||||
|
|
||||||
.bgText {
|
.bgText {
|
||||||
background: #ffffffb0;
|
background: #ffffffb0;
|
||||||
line-height: 3.0rem!important;
|
line-height: 2.1rem!important;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,4 +119,9 @@ export default {
|
|||||||
font-family: cursive !important;
|
font-family: cursive !important;
|
||||||
background: #ffffff8c;
|
background: #ffffff8c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.textareas .v-field__input {
|
||||||
|
|
||||||
|
font-size: 1.3em!important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -30,12 +30,12 @@
|
|||||||
elevation="0"
|
elevation="0"
|
||||||
|
|
||||||
>
|
>
|
||||||
<v-img
|
<!-- <v-img
|
||||||
height="100"
|
height="100"
|
||||||
:src="`${burl}${n.img}`"
|
:src="`${burl}${n.img}`"
|
||||||
cover
|
cover
|
||||||
class="text-white"
|
class="text-white"
|
||||||
>
|
> -->
|
||||||
<v-card class="h-100 text-center g text-numeral">
|
<v-card class="h-100 text-center g text-numeral">
|
||||||
<v-card-title class="statstyle my-2 py-0 text-overline font-weight-bold">
|
<v-card-title class="statstyle my-2 py-0 text-overline font-weight-bold">
|
||||||
{{n.status}}
|
{{n.status}}
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
</v-img>
|
<!-- </v-img> -->
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ export default {
|
|||||||
<style>
|
<style>
|
||||||
.numstyle {
|
.numstyle {
|
||||||
font-size: 2.875rem!important;
|
font-size: 2.875rem!important;
|
||||||
line-height: 0.25rem!important;
|
line-height: 2.5rem!important;
|
||||||
font-family: cursive !important;
|
font-family: cursive !important;
|
||||||
background: #ffffffb0;
|
background: #ffffffb0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container class="py-1 newsVH bg-transparent overflow-auto">
|
<v-container class="py-1 newsVH px-0 bg-transparent overflow-auto">
|
||||||
|
<my-helper
|
||||||
|
:pretext ="newss"
|
||||||
|
/>
|
||||||
<v-card
|
<v-card
|
||||||
class="mx-auto mb-0 "
|
class="mx-auto mb-0 "
|
||||||
v-for="(x, i) in newss" :key= i
|
v-for="(x, i) in newss.newsqueryset" :key= i
|
||||||
>
|
>
|
||||||
<v-img
|
<v-img
|
||||||
:src="`${burl}${x.link}`"
|
:src="`${burl}${x.link}`"
|
||||||
@@ -37,16 +40,102 @@
|
|||||||
|
|
||||||
<v-expand-transition>
|
<v-expand-transition>
|
||||||
<div v-show="x.show">
|
<div v-show="x.show">
|
||||||
<v-divider></v-divider>
|
<v-divider/>
|
||||||
|
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
{{x.text}}
|
{{x.text}}
|
||||||
</v-card-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="commentShow=!commentShow"
|
||||||
|
/>
|
||||||
|
<!-- @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">
|
||||||
|
<!-- {{ x.commnet.text }} -->
|
||||||
</div>
|
</div>
|
||||||
</v-expand-transition>
|
</v-expand-transition>
|
||||||
</v-card>
|
</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>
|
</v-container>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -55,15 +144,52 @@ import { ref,computed,watch } from 'vue'
|
|||||||
import {useAccountStore} from '@/store/AccountStore'
|
import {useAccountStore} from '@/store/AccountStore'
|
||||||
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 myHelper from './UI/my-helper.vue'
|
||||||
|
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { myHelper },
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
|
|
||||||
const newss=ref([])
|
const newss=ref([])
|
||||||
const show=ref(false)
|
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)
|
const burl = baseURL.slice(0,-1)
|
||||||
|
|
||||||
@@ -74,18 +200,33 @@ export default {
|
|||||||
|
|
||||||
getfromserver("api/navigation/news/", newss)
|
getfromserver("api/navigation/news/", newss)
|
||||||
|
|
||||||
|
|
||||||
watch(()=>accountStore.cod2user ,(newValue,oldValue)=>{
|
watch(()=>accountStore.cod2user ,(newValue,oldValue)=>{
|
||||||
if(newValue){
|
if(newValue){
|
||||||
getfromserver("api/navigation/news/",newss)
|
getfromserver("api/navigation/news/",newss)
|
||||||
}
|
}
|
||||||
}, {deep:true})
|
}, {deep:true})
|
||||||
|
|
||||||
|
const commentadd = () => {
|
||||||
|
dialogCommentShow.value=!dialogCommentShow.value
|
||||||
|
// commentShow.value =!commentShow.value
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
newss,
|
newss,
|
||||||
show,
|
show,
|
||||||
burl,
|
burl,
|
||||||
limitText
|
limitText,
|
||||||
|
incrementLikes,
|
||||||
|
derementLikes,
|
||||||
|
message,
|
||||||
|
commentShow,
|
||||||
|
toggleIncrementLike,
|
||||||
|
toggleDecrementLike,
|
||||||
|
dialogCommentShow,
|
||||||
|
commentadd
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@
|
|||||||
|
|
||||||
<router-view
|
<router-view
|
||||||
/>
|
/>
|
||||||
<div class="mystat d-flex flex-column">
|
<!-- <div class="mystat d-flex flex-column">
|
||||||
<v-btn
|
<v-btn
|
||||||
class="mb-1"
|
class="mb-1"
|
||||||
prepend-icon="mdi-wikipedia"
|
prepend-icon="mdi-wikipedia"
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
>
|
>
|
||||||
МС
|
МС
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</div>
|
</div> -->
|
||||||
</v-main>
|
</v-main>
|
||||||
<v-navigation-drawer
|
<v-navigation-drawer
|
||||||
v-if="accountStore.cod2user"
|
v-if="accountStore.cod2user"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {useAppStore} from '@/store/app'
|
|||||||
import { baseURL } from '@/utils/axios-api'
|
import { baseURL } from '@/utils/axios-api'
|
||||||
import { axiosApiInstance, clearAxios } from '@/utils/axios-api'
|
import { axiosApiInstance, clearAxios } from '@/utils/axios-api'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
export function getfromserver(path, reactive){
|
export function getfromserver(path, reactive){
|
||||||
try{
|
try{
|
||||||
axiosApiInstance.get(path).then(result => {
|
axiosApiInstance.get(path).then(result => {
|
||||||
|
|||||||
@@ -3,100 +3,41 @@
|
|||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="d-flex flex-column" lg=7>
|
<v-col class="d-flex flex-column" lg=7>
|
||||||
<v-row class="flex-grow-0">
|
<v-row class="flex-grow-0">
|
||||||
<v-col class="pr-0">
|
<v-col class="pr-0 pb-0">
|
||||||
<Carousel-list/>
|
<Carousel-list/>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<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-col class="pt-1 pr-0 pb-0 flex-col">
|
<v-col class="pt-1 pr-0 pb-0 flex-col">
|
||||||
<calendar/>
|
<Calendar-full
|
||||||
<!-- <v-locale-provider > -->
|
:initial="'listYear'"
|
||||||
<!-- <v-date-picker
|
:head=true
|
||||||
v-model="date1"
|
|
||||||
class="d-flex pik"
|
|
||||||
color="teal-accent-4"
|
|
||||||
|
|
||||||
|
/>
|
||||||
/> -->
|
|
||||||
<!-- </v-locale-provider> -->
|
|
||||||
</v-col>
|
</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-col>
|
||||||
<v-btn
|
<v-btn
|
||||||
@click="proba">
|
@click="proba">
|
||||||
@@ -107,8 +48,67 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<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">
|
||||||
|
<v-col>
|
||||||
|
<v-card
|
||||||
|
|
||||||
<v-col class="d-flex flex-column justify-space-between px-0 py-2 pb-0" lg=3>
|
class="ma-2 d-flex flex-column"
|
||||||
|
height="100"
|
||||||
|
|
||||||
|
elevation="0"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<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='2'/>
|
||||||
|
</v-card-text>
|
||||||
|
</v-card>
|
||||||
|
|
||||||
|
<!-- </v-img> -->
|
||||||
|
</v-card>
|
||||||
|
</v-col>
|
||||||
|
<v-divider/>
|
||||||
|
</v-row>
|
||||||
|
</v-card>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row class="flex-grow-0 ma-0 mx-1">
|
||||||
|
<v-col class="py-0">
|
||||||
|
<v-card class="h-100 flex-colmn"
|
||||||
|
>
|
||||||
|
<v-row class="ma-3">
|
||||||
|
<v-col
|
||||||
|
v-for="x in 6"
|
||||||
|
:key="x"
|
||||||
|
lg=6
|
||||||
|
class="pa-1"
|
||||||
|
>
|
||||||
|
<v-btn
|
||||||
|
|
||||||
|
prepend-icon="mdi-wikipedia"
|
||||||
|
block
|
||||||
|
variant="outlined"
|
||||||
|
class="ma-1"
|
||||||
|
>
|
||||||
|
Wiki
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
</v-card>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
</v-col>
|
||||||
|
<v-col class="d-flex flex-column justify-space-between px-0 py-2 pr-3 pb-0" lg=3>
|
||||||
<v-card
|
<v-card
|
||||||
class="h-100 bg-transparent "
|
class="h-100 bg-transparent "
|
||||||
elevation="0"
|
elevation="0"
|
||||||
@@ -140,7 +140,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 { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
import Calendar from '@/components/UI/calendar.vue'
|
import CalendarFull from '@/components/UI/Calendar-full.vue'
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
NewsList,
|
NewsList,
|
||||||
CarouselList,
|
CarouselList,
|
||||||
CarouselNumbers,
|
CarouselNumbers,
|
||||||
Calendar
|
CalendarFull
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
|
|||||||
@@ -9,4 +9,6 @@ class GeneralVacationAdmin(admin.ModelAdmin):
|
|||||||
print(obj.user.fio(), '----------------obj.user.fio()')
|
print(obj.user.fio(), '----------------obj.user.fio()')
|
||||||
return obj.user.fio()
|
return obj.user.fio()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(GeneralVacation, GeneralVacationAdmin)
|
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.contrib import admin
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
@@ -12,13 +12,41 @@ class NewsAdmin(admin.ModelAdmin):
|
|||||||
super().save_model(request, obj, form, change)
|
super().save_model(request, obj, form, change)
|
||||||
|
|
||||||
class CarouselsAdmin(admin.ModelAdmin):
|
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):
|
def save_model(self, request, obj, form, change):
|
||||||
|
|
||||||
if (request.user.username != 'admin') :
|
if (request.user.username != 'admin') :
|
||||||
obj.author = request.user
|
obj.author = request.user
|
||||||
else :
|
else :
|
||||||
obj.author = User.objects.get(id=15)
|
obj.author = User.objects.get(id=15)
|
||||||
super().save_model(request, obj, form, change)
|
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(Links)
|
||||||
admin.site.register(News,NewsAdmin)
|
admin.site.register(News,NewsAdmin)
|
||||||
admin.site.register(Carousels,CarouselsAdmin)
|
admin.site.register(Carousels,CarouselsAdmin)
|
||||||
|
admin.site.register(BaseSender, BaseSenderAdmin)
|
||||||
|
|
||||||
|
|
||||||
@@ -4,3 +4,6 @@ from django.apps import AppConfig
|
|||||||
class NavigationConfig(AppConfig):
|
class NavigationConfig(AppConfig):
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
name = 'navigation'
|
name = 'navigation'
|
||||||
|
verbose_name = "Навигация"
|
||||||
|
|
||||||
|
|
||||||
@@ -3,13 +3,26 @@ from accounts.models import *
|
|||||||
# Create your models here.
|
# Create your models here.
|
||||||
from django.conf import settings
|
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):
|
class Links(models.Model):
|
||||||
name = models.CharField(db_index=True, max_length=255)
|
name = models.CharField(db_index=True, max_length=255, verbose_name='Заголовок')
|
||||||
link = models.CharField(db_index=True, max_length=255)
|
link = models.CharField(db_index=True, max_length=255, verbose_name='Ссылка')
|
||||||
imagecode = models.CharField(db_index=True, max_length=25)
|
imagecode = models.CharField(db_index=True, max_length=25, verbose_name='Иконка')
|
||||||
order = models.IntegerField()
|
order = models.IntegerField(verbose_name='Порядок сортировки')
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "Ссылка на ресурс"
|
||||||
|
verbose_name_plural = "Ссылки на ресурсы"
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.name)
|
return str(self.name)
|
||||||
@@ -17,25 +30,52 @@ class Links(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class News(models.Model):
|
class News(models.Model):
|
||||||
title=models.CharField( max_length=255)
|
title=models.CharField(max_length=255, verbose_name='Заголовок')
|
||||||
text= models.TextField(null=True)
|
text= models.TextField(null=True, verbose_name='Сообщение')
|
||||||
cdate =models.DateTimeField(auto_now_add=True)
|
cdate =models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')
|
||||||
author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT)
|
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")
|
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):
|
def __str__(self):
|
||||||
return str(self.title)
|
return str(self.title)
|
||||||
|
|
||||||
|
class ScoreNews(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):
|
class Carousels(models.Model):
|
||||||
title=models.CharField( max_length=255)
|
title=models.CharField( max_length=255, verbose_name='Заголовок')
|
||||||
text= models.TextField(null=True)
|
text= models.TextField(null=True, verbose_name='Сообщение')
|
||||||
cdate =models.DateTimeField(auto_now_add=True)
|
cdate =models.DateTimeField(default=datetime.now(), verbose_name='Дата создания')
|
||||||
author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT)
|
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")
|
link = models.ImageField(upload_to='newsimage/%Y/%m/%d', null=True, default="newsimage/default.jpg", verbose_name='Картинка')
|
||||||
published = models.BooleanField(default=False, verbose_name='Опубликован')
|
published = models.BooleanField(default=True, verbose_name='Опубликован')
|
||||||
order = models.IntegerField(default=False)
|
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):
|
def __str__(self):
|
||||||
return str(self.title)
|
return str(self.title)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -19,3 +19,9 @@ class CarouselsSerializer(serializers.ModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Carousels
|
model = Carousels
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
class ScoreNewsSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = ScoreNews
|
||||||
|
fields = '__all__'
|
||||||
@@ -6,6 +6,8 @@ from rest_framework.permissions import AllowAny, IsAuthenticated
|
|||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from .serializers import *
|
from .serializers import *
|
||||||
from userauth.models import *
|
from userauth.models import *
|
||||||
|
from general_vacation.models import *
|
||||||
|
from django.db.models import Q
|
||||||
|
|
||||||
class LinkAPIView(ListAPIView):
|
class LinkAPIView(ListAPIView):
|
||||||
permission_classes = (AllowAny,)
|
permission_classes = (AllowAny,)
|
||||||
@@ -21,24 +23,35 @@ class LinkAPIView(ListAPIView):
|
|||||||
|
|
||||||
class NewsAPIView(ListAPIView):
|
class NewsAPIView(ListAPIView):
|
||||||
permission_classes = (AllowAny,)
|
permission_classes = (AllowAny,)
|
||||||
serializer_class = NewsSerializer
|
|
||||||
|
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
|
||||||
queryset = News.objects.all().order_by('cdate')[:10]
|
newsqueryset = News.objects.all().order_by('cdate')[:10]
|
||||||
|
|
||||||
|
scorenews = ScoreNews.objects.all()
|
||||||
|
|
||||||
|
# Сериализуем извлечённый набор записей
|
||||||
|
# serializer_for_newsqueryset = NewsSerializer(
|
||||||
|
# instance=newsqueryset, # Передаём набор записей
|
||||||
|
# many=True # Указываем, что на вход подаётся именно набор записей
|
||||||
|
# )
|
||||||
|
# comment = CommnetNews.objects.filter(news=2).exists()
|
||||||
|
# print(comment, '==============')
|
||||||
# serializer = self.serializer_class(queryset, many=True)
|
# serializer = self.serializer_class(queryset, many=True)
|
||||||
# print(serializer.data)
|
# print(serializer.data)
|
||||||
result = []
|
result = []
|
||||||
for x in queryset:
|
for x in newsqueryset:
|
||||||
|
print(x.get_news.all())
|
||||||
a=model_to_dict(x)
|
a=model_to_dict(x)
|
||||||
a['link']= str(x.link.url)
|
a['link']= str(x.link.url)
|
||||||
a['show'] = False
|
a['show'] = False
|
||||||
a['author'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x.author.username))
|
a['author'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x.author.username))
|
||||||
|
a['scores'] = [{"score":y.score} for y in x.get_news.all()]
|
||||||
|
# if CommnetNews.objects.filter(news=x.pk).exists():
|
||||||
|
# a['commnet'] = model_to_dict(CommnetNews.objects.get(news=x.pk))
|
||||||
result.append(a)
|
result.append(a)
|
||||||
|
|
||||||
return Response(result)
|
return Response({"newsqueryset":result})
|
||||||
|
|
||||||
class CarouselsAPIView(ListAPIView):
|
class CarouselsAPIView(ListAPIView):
|
||||||
permission_classes = (AllowAny,)
|
permission_classes = (AllowAny,)
|
||||||
@@ -47,17 +60,30 @@ class CarouselsAPIView(ListAPIView):
|
|||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
|
||||||
queryset = Carousels.objects.filter(published=True).order_by('order')
|
|
||||||
# serializer = self.serializer_class(queryset, many=True)
|
queryset = Carousels.objects.filter(published=True, cdate__lte=datetime.now(), enddate__gte=datetime.now()).order_by('-cdate')
|
||||||
# print(serializer.data)
|
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 = []
|
result = []
|
||||||
for x in queryset:
|
for x in queryset:
|
||||||
|
|
||||||
a=model_to_dict(x)
|
a=model_to_dict(x)
|
||||||
a['link']= str(x.link.url)
|
a['link']= str(x.link.url)
|
||||||
a['show'] = False
|
a['show'] = False
|
||||||
a['author'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x.author.username))
|
a['author'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x.author.username))
|
||||||
|
if x.sender.img:
|
||||||
|
a['sender'] = str(x.sender.img.url)
|
||||||
|
else:
|
||||||
|
a['sender'] = None
|
||||||
result.append(a)
|
result.append(a)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Response(result)
|
return Response(result)
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ class Counter(ListAPIView):
|
|||||||
# return Response(qs)
|
# return Response(qs)
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
print(request.data['user__id'])
|
# print(request.data['user__id'])
|
||||||
if request.data['user__id'] is not None:
|
if request.data['user__id'] is not None:
|
||||||
# print("sdddddd")
|
# print("sdddddd")
|
||||||
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today())
|
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today())
|
||||||
|
|||||||