v
This commit is contained in:
1 parent
8a9a19f136
commit
cf662895e5
12 files changed
+81
-175
No files matched your search
Binary file not shown.
@@ -187,6 +187,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
|
const t_baseCriteria = ref([])
|
||||||
const t_daily = ref('')
|
const t_daily = ref('')
|
||||||
const idpos = ref('')
|
const idpos = ref('')
|
||||||
const dialogDetailRound = ref(false)
|
const dialogDetailRound = ref(false)
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const onPickFile = () => {
|
const onPickFile = () => {
|
||||||
|
|
||||||
const sdata = new FormData()
|
const sdata = new FormData()
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
<v-list-item-title>{{x.author.fio}}</v-list-item-title>
|
<v-list-item-title>{{x.author.fio}}</v-list-item-title>
|
||||||
|
|
||||||
<v-list-item-subtitle>Участник</v-list-item-subtitle>
|
<v-list-item-subtitle>Участник</v-list-item-subtitle>
|
||||||
|
<!-- <my-helper :pretext="route.path == '/news' && 'id' in route.query"/> -->
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
<v-card-title class="pt-0 pb-1">
|
<v-card-title class="pt-0 pb-1">
|
||||||
@@ -140,7 +141,7 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="flex-grow-0">
|
<v-row class="flex-grow-0" v-show="route.path == '/news' && 'id' in route.query?false:true">
|
||||||
<v-col class="ma-0 pa-0 pt-2">
|
<v-col class="ma-0 pa-0 pt-2">
|
||||||
<v-pagination
|
<v-pagination
|
||||||
v-model="page"
|
v-model="page"
|
||||||
@@ -199,148 +200,6 @@
|
|||||||
</v-dialog>
|
</v-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <v-row>
|
|
||||||
<v-col class="pa-0 overflow-auto">
|
|
||||||
<v-card
|
|
||||||
class=" rounded-0"
|
|
||||||
|
|
||||||
|
|
||||||
v-for="(x, i) in newss.result" :key=i>
|
|
||||||
|
|
||||||
<v-list-item class="w-100 pl-4 py-2 pt-3">
|
|
||||||
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<v-avatar
|
|
||||||
|
|
||||||
color="loading_avatar"
|
|
||||||
:image="checkremote( `${spravURL}${x.author.login}.jpg`)"></v-avatar>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<v-list-item-title>{{x.author.fio}}</v-list-item-title>
|
|
||||||
|
|
||||||
<v-list-item-subtitle>Участник</v-list-item-subtitle>
|
|
||||||
</v-list-item>
|
|
||||||
|
|
||||||
<v-card-title class="pt-0 pb-1">
|
|
||||||
{{x.title}}
|
|
||||||
</v-card-title>
|
|
||||||
<v-img
|
|
||||||
:src="`${burl}${x.link}`"
|
|
||||||
height="350px"
|
|
||||||
width="96%"
|
|
||||||
class="mx-auto"
|
|
||||||
cover
|
|
||||||
/>
|
|
||||||
|
|
||||||
<v-list-item class="w-100">
|
|
||||||
|
|
||||||
<template v-slot:append>
|
|
||||||
<div class="justify-self-end">
|
|
||||||
<v-icon class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == true).length>0?'mdi-thumb-up':'mdi-thumb-up-outline'" @click="toggleIncrementLike(x.id, true)"></v-icon>
|
|
||||||
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
|
|
||||||
<span class="me-1">·</span>
|
|
||||||
<v-icon class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == false).length>0?'mdi-thumb-down':'mdi-thumb-down-outline'" @click="toggleIncrementLike(x.id, false)"/>
|
|
||||||
<span class="subheading me-2">{{x.scores.filter(e=> e.score==false).length}}</span>
|
|
||||||
<span class="me-1">·</span>
|
|
||||||
<v-icon class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
|
|
||||||
<span @click="x.showComment=!x.showComment" class="pointer subheading">{{ x.comment.length }}</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</v-list-item>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div >
|
|
||||||
<v-divider/>
|
|
||||||
|
|
||||||
<v-card-text>
|
|
||||||
{{x.text}}
|
|
||||||
</v-card-text>
|
|
||||||
<v-divider/>
|
|
||||||
|
|
||||||
<v-expand-transition>
|
|
||||||
|
|
||||||
<div v-show="x.showComment" v-if="x.comment.length>0">
|
|
||||||
<div
|
|
||||||
v-for = "(y, key) in x.comment"
|
|
||||||
:key="key"
|
|
||||||
class="d-flex flex-column pa-3"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<v-row
|
|
||||||
class="justify-space-between ma-0 align-center bgchat mr-7"
|
|
||||||
:class="accountStore.user.login==y.author.login?'bgchatnot':'bgchat'"
|
|
||||||
|
|
||||||
>
|
|
||||||
<v-col class="flex-grow-1 text-subtitle-2 pl-2 pa-0 "
|
|
||||||
|
|
||||||
>
|
|
||||||
{{ accountStore.user.login==y.author.login?'':splitname(y.author) }}
|
|
||||||
</v-col>
|
|
||||||
<v-col class="pa-0 text-center text-subtitle-2 ">
|
|
||||||
|
|
||||||
{{dateformat(y.cdate)}}
|
|
||||||
</v-col>
|
|
||||||
<v-col class="pa-0 pr-2 text-end text-subtitle-2 ">
|
|
||||||
{{ accountStore.user.login!=y.author.login?'':splitname(y.author) }}
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
<div class="text-subtitle-2">
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<v-row>
|
|
||||||
<v-col class="pr-0">
|
|
||||||
<v-alert
|
|
||||||
|
|
||||||
|
|
||||||
color="bg_comments"
|
|
||||||
rounded=0
|
|
||||||
:border="accountStore.user.login==y.author.login?'end':'start'"
|
|
||||||
:border-color="accountStore.user.login==y.author.login?'success':'deep-purple accent-4'"
|
|
||||||
elevation=0
|
|
||||||
>
|
|
||||||
|
|
||||||
{{ y.text }}
|
|
||||||
|
|
||||||
</v-alert>
|
|
||||||
</v-col>
|
|
||||||
<v-col class="flex-grow-0 d-flex pa-0 align-center"
|
|
||||||
:class="accountStore.user.login==y.author.login?'pa-0':'pa-5'"
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
v-if="accountStore.user.login==y.author.login"
|
|
||||||
variant="text"
|
|
||||||
size="small"
|
|
||||||
icon='mdi-delete'
|
|
||||||
color="delete_btn"
|
|
||||||
@click="deletComment(y.id, x.id)"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</v-expand-transition>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</v-card>
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
color="black_and_white"
|
color="black_and_white"
|
||||||
density="compact"
|
density="compact"
|
||||||
:prepend-avatar="imageSrc"
|
:prepend-avatar="imageSrc"
|
||||||
title="Портал МИ ФНС по ЦОД № 2"
|
title="Портал МИ ФНС России по ЦОД № 2"
|
||||||
variant="text"
|
variant="text"
|
||||||
:to="'/'"
|
:to="'/'"
|
||||||
/>
|
/>
|
||||||
@@ -221,12 +221,13 @@
|
|||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
<!-- <v-navigation-drawer
|
<!-- <v-navigation-drawer
|
||||||
:width="8"
|
:width="8"
|
||||||
@@ -314,7 +315,7 @@ import OnlineUsers from '@/components/onlineUsers.vue'
|
|||||||
import CardUsers from '@/components/cardUsers.vue'
|
import CardUsers from '@/components/cardUsers.vue'
|
||||||
import CardLike from '@/components/cardLike.vue'
|
import CardLike from '@/components/cardLike.vue'
|
||||||
import { pagecounter } from '@/utils/universal_functions'
|
import { pagecounter } from '@/utils/universal_functions'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: { AuthForm, OnlineUsers, CardUsers, CardLike },
|
components: { AuthForm, OnlineUsers, CardUsers, CardLike },
|
||||||
@@ -323,6 +324,7 @@ export default {
|
|||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
pagecounter()
|
pagecounter()
|
||||||
|
const router = useRouter()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const mainmenuStore = useMainmenuStore()
|
const mainmenuStore = useMainmenuStore()
|
||||||
@@ -425,7 +427,8 @@ export default {
|
|||||||
appStore,
|
appStore,
|
||||||
rail,
|
rail,
|
||||||
showTooltip,
|
showTooltip,
|
||||||
menuTruncated
|
menuTruncated,
|
||||||
|
router
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const routes = [
|
|||||||
name: 'HomePage',
|
name: 'HomePage',
|
||||||
component: () => import('@/views/HomePage.vue'),
|
component: () => import('@/views/HomePage.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Портал МиФНС по ЦОД №2"
|
title:"Портал МИ ФНС России по ЦОД №2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -20,7 +20,8 @@ const routes = [
|
|||||||
name: 'OKiBPage',
|
name: 'OKiBPage',
|
||||||
component: () => import('@/views/nested_view/o_OKiB.vue'),
|
component: () => import('@/views/nested_view/o_OKiB.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Отдел кадров и безопасности"
|
title:"Отдел кадров и безопасности",
|
||||||
|
ico: "mdi-contact-mail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -28,7 +29,8 @@ const routes = [
|
|||||||
name: 'ProvidingActivitiesPage',
|
name: 'ProvidingActivitiesPage',
|
||||||
component: () => import('@/views/ProvidingActivitiesPage.vue'),
|
component: () => import('@/views/ProvidingActivitiesPage.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Обеспечивающая деятельность"
|
title:"Обеспечивающая деятельность",
|
||||||
|
ico: "mdi-contact-mail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -36,7 +38,8 @@ const routes = [
|
|||||||
name: 'FAQPage',
|
name: 'FAQPage',
|
||||||
component: () => import('@/views/FAQPage.vue'),
|
component: () => import('@/views/FAQPage.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Часто задаваемые вопросы"
|
title:"Часто задаваемые вопросы",
|
||||||
|
ico: "mdi-contact-mail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -44,7 +47,8 @@ const routes = [
|
|||||||
name: 'FeedbackPage',
|
name: 'FeedbackPage',
|
||||||
component: () => import('@/views/FeedbackPage.vue'),
|
component: () => import('@/views/FeedbackPage.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Обратная связь"
|
title:"Обратная связь",
|
||||||
|
ico: "mdi-contact-mail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -52,7 +56,8 @@ const routes = [
|
|||||||
name: 'LaborProtection',
|
name: 'LaborProtection',
|
||||||
component: () => import('@/views/LaborProtection.vue'),
|
component: () => import('@/views/LaborProtection.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Безопасность"
|
title:"Безопасность",
|
||||||
|
ico: "mdi-contact-mail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -60,7 +65,8 @@ const routes = [
|
|||||||
name: 'SecurityPage',
|
name: 'SecurityPage',
|
||||||
component: () => import('@/views/SecurityPage.vue'),
|
component: () => import('@/views/SecurityPage.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Охрана труда"
|
title:"Охрана труда",
|
||||||
|
ico: "mdi-contact-mail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -68,7 +74,8 @@ const routes = [
|
|||||||
name: 'AboutInspectionPage',
|
name: 'AboutInspectionPage',
|
||||||
component: () => import('@/views/AboutInspectionPage.vue'),
|
component: () => import('@/views/AboutInspectionPage.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Об инспекции"
|
title:"Об инспекции",
|
||||||
|
ico: "mdi-contact-mail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -84,7 +91,8 @@ const routes = [
|
|||||||
name: 'AboutNewsPage',
|
name: 'AboutNewsPage',
|
||||||
component: () => import('@/views/NewsPage.vue'),
|
component: () => import('@/views/NewsPage.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Лента новостей"
|
title:"Лента новостей",
|
||||||
|
ico: "mdi-contact-mail"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export function pagecounter(){
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
console.log(router.currentRoute.value.fullPath, '-------------ttt------------------');
|
console.log(router.currentRoute.value.meta, '-------------ttt------------------');
|
||||||
let postdata = {user__id: "user" in accountStore &&"id" in accountStore.user? accountStore.user.id: null,
|
let postdata = {user__id: "user" in accountStore &&"id" in accountStore.user? accountStore.user.id: null,
|
||||||
page: router.currentRoute.value.meta.title,
|
page: router.currentRoute.value.meta.title,
|
||||||
fullPath: router.currentRoute.value.fullPath
|
fullPath: router.currentRoute.value.fullPath
|
||||||
|
|||||||
@@ -37,23 +37,23 @@
|
|||||||
>
|
>
|
||||||
<v-row class="ma-3">
|
<v-row class="ma-3">
|
||||||
<v-col
|
<v-col
|
||||||
v-for="x in 6"
|
v-for="x in favorit"
|
||||||
:key="x"
|
:key="x"
|
||||||
lg=6
|
lg=6
|
||||||
class="pa-1"
|
class="pa-1"
|
||||||
>
|
>
|
||||||
<v-btn
|
<v-btn
|
||||||
prepend-icon="mdi-wikipedia"
|
|
||||||
block
|
block
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
class="ma-1"
|
class="ma-1"
|
||||||
to="/news"
|
:to="x.fullPath"
|
||||||
>
|
>
|
||||||
Wiki
|
{{menuTruncated(x.page)}}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<!-- <my-helper :pretext="t_daily"/> -->
|
<!-- <my-helper :pretext="favorit"/> -->
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { ref, onMounted } from 'vue'
|
||||||
import {useAppStore} from '@/store/app'
|
import {useAppStore} from '@/store/app'
|
||||||
import {useAccountStore} from '@/store/AccountStore'
|
import {useAccountStore} from '@/store/AccountStore'
|
||||||
import {pagecounter} from '@/utils/universal_functions'
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
import NewsListHome from '@/components/news-list-home.vue'
|
import NewsListHome from '@/components/news-list-home.vue'
|
||||||
import LoadRound from '@/components/load-round.vue'
|
import LoadRound from '@/components/load-round.vue'
|
||||||
import DigitalLetna from '@/components/digital-letna.vue'
|
import DigitalLetna from '@/components/digital-letna.vue'
|
||||||
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
@@ -112,14 +112,41 @@
|
|||||||
DigitalLetna
|
DigitalLetna
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
const favorit = ref([])
|
||||||
pagecounter()
|
pagecounter()
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
|
onMounted(() => {
|
||||||
|
favoritLinks()
|
||||||
|
})
|
||||||
|
const favoritLinks = () => {
|
||||||
|
|
||||||
|
axiosApiInstance.get(`api/watcher/selectedlinks/`)
|
||||||
|
.then(data => {
|
||||||
|
favorit.value = data.data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const menuTruncated = (menus) => {
|
||||||
|
return menus.slice(0,7).toUpperCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accountStore,
|
accountStore,
|
||||||
appStore
|
appStore,
|
||||||
|
favoritLinks,
|
||||||
|
favorit,
|
||||||
|
menuTruncated
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ class GeneralVacationAdmin(admin.ModelAdmin):
|
|||||||
list_display=('get_name', 'user', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period')
|
list_display=('get_name', 'user', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period')
|
||||||
readonly_fields=('get_name',)
|
readonly_fields=('get_name',)
|
||||||
def get_name(self, obj):
|
def get_name(self, obj):
|
||||||
|
|
||||||
print(obj.user.fio(), '----------------obj.user.fio()')
|
|
||||||
return obj.user.fio()
|
return obj.user.fio()
|
||||||
|
|
||||||
class PlanCalendarAdmin(admin.ModelAdmin):
|
class PlanCalendarAdmin(admin.ModelAdmin):
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
|
|
||||||
|
|
||||||
ws['I1'] = 'На '+ date.today().strftime("%d.%m.%Y")
|
ws['I1'] = 'На '+ date.today().strftime("%d.%m.%Y")
|
||||||
print(date.today().strftime("%d.%m.%Y"))
|
|
||||||
numb = 1
|
numb = 1
|
||||||
|
|
||||||
column_widths = [29, 53, 96, 96, 112, 28, 222, 29, 148, 28, 145, 33]
|
column_widths = [29, 53, 96, 96, 112, 28, 222, 29, 148, 28, 145, 33]
|
||||||
@@ -293,7 +293,7 @@ class DailyloadAPIView(APIView):
|
|||||||
df = pd.merge(df_user, df_daily, left_on= 'login', right_on="login")
|
df = pd.merge(df_user, df_daily, left_on= 'login', right_on="login")
|
||||||
|
|
||||||
result={}
|
result={}
|
||||||
print(dailyr, '33333333333333333333333333333333333333333333333')
|
|
||||||
pos=dailyr[0][1]
|
pos=dailyr[0][1]
|
||||||
|
|
||||||
if request.GET.__contains__('id'):
|
if request.GET.__contains__('id'):
|
||||||
|
|||||||
+3
-2
@@ -2,8 +2,9 @@ from django.urls import path
|
|||||||
from .views import *
|
from .views import *
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('counter/', Counter.as_view(),name="CountVisitors")
|
path('counter/', Counter.as_view(),name="CountVisitors"),
|
||||||
# path('', views.Watchuser.as_view()),
|
path('selectedlinks/', SelectedLinksAPIView.as_view(),name="SelectedLinks")
|
||||||
|
# path('', views.Watchuser.as_view()), selectedlinks
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
+10
-4
@@ -23,9 +23,6 @@ class Counter(ListAPIView):
|
|||||||
pUser = pd.DataFrame.from_records(users)
|
pUser = pd.DataFrame.from_records(users)
|
||||||
pOutUser = pd.DataFrame.from_records(outuser)
|
pOutUser = pd.DataFrame.from_records(outuser)
|
||||||
h = pUser.merge(pOutUser, how="left", left_on="user__username", right_on="login")
|
h = pUser.merge(pOutUser, how="left", left_on="user__username", right_on="login")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for x in users:
|
for x in users:
|
||||||
if x['user__username'] is not None:
|
if x['user__username'] is not None:
|
||||||
@@ -37,7 +34,6 @@ class Counter(ListAPIView):
|
|||||||
|
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
print('hernjaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
|
|
||||||
if request.data['user__id'] is not None:
|
if request.data['user__id'] is not None:
|
||||||
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today(), fullPath=request.data['fullPath'])
|
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today(), fullPath=request.data['fullPath'])
|
||||||
else:
|
else:
|
||||||
@@ -51,4 +47,14 @@ class Counter(ListAPIView):
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
|
class SelectedLinksAPIView(ListAPIView):
|
||||||
|
|
||||||
|
def get(self, request):
|
||||||
|
user = User.objects.get(username=self.request.user)
|
||||||
|
res = CountVisitor.objects.values('page','fullPath').filter(user_id=user).annotate(Sum('count')).exclude(fullPath='/')
|
||||||
|
sort = res.order_by('-count__sum')[:6]
|
||||||
|
|
||||||
|
|
||||||
|
return Response(sort)
|
||||||
|
|
||||||
Reference in new issue
Block a user