Merge branch 'feature/create_app' of http://sulaco.nodered.ru:5223/COD2/PORTAL_COD2 into feature/create_app
This commit is contained in:
commit
d30fea6ab0
6 files changed
+340
-194
No files matched your search
BIN
Binary file not shown.
@@ -1,8 +1,6 @@
|
||||
<template>
|
||||
<v-container class="py-1 newsVH px-0 bg-transparent overflow-auto">
|
||||
<!-- <my-helper
|
||||
:pretext ="newss"
|
||||
/> -->
|
||||
|
||||
<v-card
|
||||
class="mx-auto mb-0 "
|
||||
v-for="(x, i) in newss" :key= i
|
||||
@@ -105,13 +103,15 @@
|
||||
|
||||
class="d-flex align-center flex-column py-3"
|
||||
>
|
||||
|
||||
<div class="text-subtitle-2">{{dateformat(y.cdate)}}
|
||||
<v-btn
|
||||
|
||||
icon='mdi-thumb-down-outline'
|
||||
color="red-lighten-2"
|
||||
|
||||
/>
|
||||
variant="text"
|
||||
size="small"
|
||||
icon='mdi-delete'
|
||||
color="blue-grey-darken-1"
|
||||
@click="deletComment(y.id, x.id)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<v-card
|
||||
@@ -234,7 +234,15 @@ export default {
|
||||
}
|
||||
}, {deep:true})
|
||||
|
||||
const deletComment = (id, news) => {
|
||||
axiosApiInstance.post(`api/navigation/news/`, {delid: id, news: news}).then(result => {
|
||||
// dialogCommentShow.value=!dialogCommentShow.value
|
||||
newss.value[newss.value.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
|
||||
console.log(result.data, 'result.data-----------------')
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
@@ -249,7 +257,8 @@ export default {
|
||||
textcomment,
|
||||
openComent,
|
||||
addComment,
|
||||
idnews
|
||||
idnews,
|
||||
deletComment
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,31 @@
|
||||
|
||||
<template>
|
||||
<v-app>
|
||||
<v-app-bar :elevation="2" density="compact" color="teal-darken-4" class="pl-4">
|
||||
<v-app-bar
|
||||
:elevation="2"
|
||||
density="compact"
|
||||
color="teal-darken-4"
|
||||
class="pl-4"
|
||||
>
|
||||
|
||||
<v-icon class="px-3" size="20" :icon="rail ? 'mdi-chevron-right' : 'mdi-chevron-left'" @click="rail = !rail" />
|
||||
<v-card class="bg-transparent py" density="compact" :prepend-avatar="imageSrc" title="Портал МиФНС по ЦОД № 2"
|
||||
variant="text" :to="'/'" />
|
||||
<!-- @click="drawer = !drawer" -->
|
||||
<v-icon
|
||||
|
||||
class="px-3"
|
||||
size="20"
|
||||
:icon="`mdi-chevron${rail?'-right':'-left'}`"
|
||||
@click="rail = !rail"
|
||||
|
||||
/>
|
||||
<v-card
|
||||
|
||||
class="bg-transparent py"
|
||||
density="compact"
|
||||
:prepend-avatar="imageSrc"
|
||||
title="Портал МиФНС по ЦОД № 2"
|
||||
variant="text"
|
||||
:to="'/'"
|
||||
/>
|
||||
<!-- @click="drawer = !drawer" -->
|
||||
<!-- <v-app-bar-nav-icon
|
||||
:to="'/'"
|
||||
>
|
||||
@@ -24,127 +43,203 @@
|
||||
|
||||
</v-toolbar-title> -->
|
||||
<template v-slot:image>
|
||||
<v-img gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)" />
|
||||
<v-img
|
||||
gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:append>
|
||||
<template v-if="accountStore.cod2user">
|
||||
<v-card class="bg-transparent" density="compact" :prepend-avatar="accountStore.user.photo"
|
||||
:title="accountStore.user.fio" :subtitle="accountStore.user.post" variant="text" @click="getcard" />
|
||||
<v-card
|
||||
|
||||
class="bg-transparent"
|
||||
density="compact"
|
||||
:prepend-avatar="accountStore.user.photo"
|
||||
:title="accountStore.user.fio"
|
||||
:subtitle="accountStore.user.post"
|
||||
variant="text"
|
||||
@click="getcard"
|
||||
/>
|
||||
|
||||
|
||||
<v-dialog v-model="menuGetUserDialog" persistent width="600">
|
||||
<Card-users :menuGetUserDialog="menuGetUserDialog" :loging="accountStore.user.login"
|
||||
@menusClose="menuGetUserDialog = false" />
|
||||
<v-dialog
|
||||
v-model="menuGetUserDialog"
|
||||
persistent
|
||||
width="600"
|
||||
>
|
||||
<Card-users
|
||||
:menuGetUserDialog="menuGetUserDialog"
|
||||
:loging="accountStore.user.login"
|
||||
@menusClose="menuGetUserDialog=false"
|
||||
/>
|
||||
|
||||
|
||||
</v-dialog>
|
||||
</v-dialog>
|
||||
|
||||
|
||||
<v-tooltip location="bottom">
|
||||
<v-tooltip location="bottom">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-btn v-bind="props" dark to="/faq" icon="mdi-comment-question-outline" />
|
||||
<v-btn
|
||||
v-bind="props"
|
||||
dark
|
||||
to="/faq"
|
||||
icon="mdi-comment-question-outline"
|
||||
/>
|
||||
</template>
|
||||
<span>F.A.Q.</span>
|
||||
</v-tooltip>
|
||||
|
||||
<v-dialog v-model="LikeDialog" persistent width="800">
|
||||
<template v-slot:activator="{ props }">
|
||||
|
||||
<v-btn v-bind="props" dark icon="mdi-thumb-up-outline" />
|
||||
<v-dialog
|
||||
v-model="LikeDialog"
|
||||
persistent
|
||||
width="800"
|
||||
>
|
||||
<template v-slot:activator="{ props }">
|
||||
|
||||
<v-btn
|
||||
v-bind="props"
|
||||
dark
|
||||
|
||||
icon="mdi-thumb-up-outline"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
<Card-like
|
||||
:LikeDialog="LikeDialog"
|
||||
@menusClose="LikeDialog=false"
|
||||
/>
|
||||
</v-dialog>
|
||||
|
||||
|
||||
<Card-like :LikeDialog="LikeDialog" @menusClose="LikeDialog = false" />
|
||||
</v-dialog>
|
||||
|
||||
|
||||
<v-btn icon @click="toggleTheme">
|
||||
<v-icon class="mr-1" color="lampa">
|
||||
<v-btn
|
||||
icon
|
||||
@click="toggleTheme"
|
||||
>
|
||||
<v-icon
|
||||
class="mr-1"
|
||||
color="lampa"
|
||||
>
|
||||
mdi-lightbulb-outline
|
||||
</v-icon>
|
||||
</v-btn>
|
||||
<v-btn dark icon="mdi-magnify" />
|
||||
<v-btn dark icon="mdi-account-multiple-outline" @click="drawer_right = !drawer_right" />
|
||||
<v-btn dark icon="mdi-logout" @click="accountStore.logout" />
|
||||
<v-btn dark icon="mdi-magnify"/>
|
||||
<v-btn
|
||||
dark
|
||||
icon="mdi-account-multiple-outline"
|
||||
@click="drawer_right=!drawer_right"
|
||||
/>
|
||||
<v-btn
|
||||
dark
|
||||
icon="mdi-logout"
|
||||
@click="accountStore.logout"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-else>
|
||||
|
||||
|
||||
<v-row justify="center">
|
||||
<Auth-form />
|
||||
</v-row>
|
||||
<template v-else>
|
||||
|
||||
|
||||
<v-row justify="center">
|
||||
<Auth-form/>
|
||||
</v-row>
|
||||
|
||||
|
||||
</template>
|
||||
</template>
|
||||
</v-app-bar>
|
||||
<v-navigation-drawer
|
||||
:rail="rail"
|
||||
permanent
|
||||
v-model="drawer"
|
||||
|
||||
>
|
||||
<v-row class="my-0 h-100">
|
||||
<v-col class="flex-column d-flex">
|
||||
<v-row><v-col>
|
||||
<v-list
|
||||
nav
|
||||
density="compact">
|
||||
|
||||
<template v-for="(x, key) in navigations">
|
||||
<v-list-item
|
||||
v-if="!('submenu' in x)"
|
||||
:key="x.key"
|
||||
:title="x.name"
|
||||
:value="x.name"
|
||||
:href="x.link"
|
||||
:to="x.path"
|
||||
color="navigation"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<v-icon
|
||||
|
||||
:icon="x.ico"
|
||||
/>
|
||||
</template>
|
||||
</v-list-item>
|
||||
<v-list-group
|
||||
v-else
|
||||
:key="key"
|
||||
:value="x.name"
|
||||
>
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-list-item
|
||||
v-bind="props"
|
||||
:title="x.name"
|
||||
:prepend-icon="x.ico"
|
||||
/>
|
||||
</template>
|
||||
<v-list-item
|
||||
v-for="(child, k) in x.submenu"
|
||||
|
||||
:href="child.link"
|
||||
:key="k"
|
||||
:value="child.name"
|
||||
:title="child.name"
|
||||
:to="child.path"
|
||||
/>
|
||||
</v-list-group>
|
||||
</template>
|
||||
</template>
|
||||
</v-app-bar>
|
||||
<v-navigation-drawer :rail="rail" permanent v-model="drawer">
|
||||
<v-row class="my-0 h-100">
|
||||
<v-col class="flex-column d-flex">
|
||||
<v-row><v-col>
|
||||
<v-list nav density="compact">
|
||||
|
||||
<template v-for="(x, key) in navigations">
|
||||
<v-list-item v-if="!('submenu' in x)" :key="x.key" :title="x.name" :value="x.name" :href="x.link"
|
||||
:to="x.path" color="navigation">
|
||||
<template v-slot:prepend>
|
||||
<v-icon :icon="x.ico" />
|
||||
</template>
|
||||
</v-list-item>
|
||||
<v-list-group v-else :key="key" :value="x.name">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-list-item v-bind="props" :title="x.name" :prepend-icon="x.ico" />
|
||||
</template>
|
||||
<v-list-item v-for="(child, k) in x.submenu" :href="child.link" :key="k" :value="child.name"
|
||||
:title="child.name" :to="child.path">
|
||||
</v-list-item>
|
||||
</v-list-group>
|
||||
</template>
|
||||
</v-list>
|
||||
<v-list nav density="compact">
|
||||
<v-list-item v-for="x of mainmenuStore.portallinks" :key="x.name" :title="x.name" :value="x.name"
|
||||
:href="x.link" color="teal-darken-4">
|
||||
<template v-slot:prepend>
|
||||
<v-icon :icon="x.imagecode" />
|
||||
</template>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-col></v-row>
|
||||
<v-row class="flex-grow-0">
|
||||
<v-col class="py-0 pl-1">
|
||||
<v-list>
|
||||
|
||||
<v-list-item v-if="!rail" class="text-caption font-weight-bold text-truncate">
|
||||
<p>Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
|
||||
<v-divider />
|
||||
<p>Посещений сегодня: {{ appStore.countvisitor.visittoday }}</p>
|
||||
<v-divider />
|
||||
<p>Уникальных посещений: {{ appStore.countvisitor.uniqtoday }}</p>
|
||||
<v-divider />
|
||||
|
||||
</v-list-item>
|
||||
<v-list-item v-else>
|
||||
<v-tooltip v-model="showTooltip" location="top">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-icon v-bind="props">
|
||||
mdi-account-eye
|
||||
</v-icon>
|
||||
</template>
|
||||
<p>Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
|
||||
<v-divider />
|
||||
<p>Посещений сегодня: {{ appStore.countvisitor.visittoday }}</p>
|
||||
<v-divider />
|
||||
<p>Уникальных посещений: {{ appStore.countvisitor.uniqtoday }}</p>
|
||||
</v-tooltip>
|
||||
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list>
|
||||
<v-list
|
||||
nav
|
||||
density="compact"
|
||||
>
|
||||
<v-list-item v-for="x of mainmenuStore.portallinks"
|
||||
:key="x.name"
|
||||
:title="x.name"
|
||||
:value="x.name"
|
||||
:href="x.link"
|
||||
color="teal-darken-4"
|
||||
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<v-icon
|
||||
|
||||
:icon="x.imagecode"
|
||||
/>
|
||||
</template>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-col></v-row>
|
||||
<v-row class="flex-grow-0">
|
||||
<v-col class="py-0 pl-1">
|
||||
<v-list>
|
||||
|
||||
<v-list-item class="text-caption font-weight-bold text-truncate">
|
||||
<p >Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
|
||||
<v-divider/>
|
||||
<p>Посещений сегодня: {{ appStore.countvisitor.visittoday }}</p>
|
||||
<v-divider/>
|
||||
<p>Уникальных посещений: {{ appStore.countvisitor.uniqtoday }}</p>
|
||||
<v-divider/>
|
||||
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-col>
|
||||
<!-- <v-col class="pointer align-self-center flex-grow-0"
|
||||
</v-row>
|
||||
</v-col>
|
||||
<!-- <v-col class="pointer align-self-center flex-grow-0"
|
||||
|
||||
@click="rail = !rail">
|
||||
<v-icon
|
||||
@@ -155,8 +250,8 @@
|
||||
|
||||
/>
|
||||
</v-col> -->
|
||||
</v-row>
|
||||
<!-- <div class="d-flex flex-column h-100">
|
||||
</v-row>
|
||||
<!-- <div class="d-flex flex-column h-100">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-divider/>
|
||||
@@ -245,7 +340,7 @@
|
||||
</div> -->
|
||||
|
||||
</v-navigation-drawer>
|
||||
<!-- <v-navigation-drawer
|
||||
<!-- <v-navigation-drawer
|
||||
:width="8"
|
||||
|
||||
class="btnNav pointer"
|
||||
@@ -263,9 +358,11 @@
|
||||
|
||||
|
||||
</v-navigation-drawer> -->
|
||||
<v-main class="d-flex bg-main_theme">
|
||||
<router-view />
|
||||
<!-- <div class="mystat d-flex flex-column">
|
||||
<v-main class="d-flex bg-main_theme">
|
||||
|
||||
<router-view
|
||||
/>
|
||||
<!-- <div class="mystat d-flex flex-column">
|
||||
<v-btn
|
||||
class="mb-1"
|
||||
prepend-icon="mdi-wikipedia"
|
||||
@@ -284,13 +381,19 @@
|
||||
МС
|
||||
</v-btn>
|
||||
</div> -->
|
||||
</v-main>
|
||||
<v-navigation-drawer v-if="accountStore.cod2user" v-model="drawer_right" rail permanent location="right"
|
||||
@click="rail = false">
|
||||
|
||||
<Online-users />
|
||||
|
||||
<!-- <template v-slot:append>
|
||||
</v-main>
|
||||
<v-navigation-drawer
|
||||
v-if="accountStore.cod2user"
|
||||
v-model="drawer_right"
|
||||
rail
|
||||
permanent
|
||||
location="right"
|
||||
@click="rail = false"
|
||||
>
|
||||
|
||||
<Online-users/>
|
||||
|
||||
<!-- <template v-slot:append>
|
||||
<v-list lines="one">
|
||||
<v-list-item
|
||||
v-for="(val,key) in appStore.countvisitor"
|
||||
@@ -301,49 +404,48 @@
|
||||
</v-list>
|
||||
|
||||
</template> -->
|
||||
|
||||
</v-navigation-drawer>
|
||||
|
||||
|
||||
</v-navigation-drawer>
|
||||
</v-app>
|
||||
|
||||
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
import { ref, computed } from 'vue'
|
||||
import uf from '@/utils/universal_functions'
|
||||
import { useAccountStore } from '@/store/AccountStore'
|
||||
import { useMainmenuStore } from '@/store/MainmenuStore'
|
||||
import { useAppStore } from '@/store/app'
|
||||
import { useTheme } from "vuetify";
|
||||
import AuthForm from '@/components/UI/Auth-form.vue'
|
||||
import OnlineUsers from '@/components/onlineUsers.vue'
|
||||
import CardUsers from '@/components/cardUsers.vue'
|
||||
import CardLike from '@/components/cardLike.vue'
|
||||
import { pagecounter } from '@/utils/universal_functions'
|
||||
export default {
|
||||
import { ref,computed } from 'vue'
|
||||
import uf from '@/utils/universal_functions'
|
||||
import {useAccountStore} from '@/store/AccountStore'
|
||||
import {useMainmenuStore} from '@/store/MainmenuStore'
|
||||
import {useAppStore} from '@/store/app'
|
||||
import { useTheme } from "vuetify";
|
||||
import AuthForm from '@/components/UI/Auth-form.vue'
|
||||
import OnlineUsers from '@/components/onlineUsers.vue'
|
||||
import CardUsers from '@/components/cardUsers.vue'
|
||||
import CardLike from '@/components/cardLike.vue'
|
||||
import { pagecounter } from '@/utils/universal_functions'
|
||||
export default {
|
||||
|
||||
components: { AuthForm, OnlineUsers, CardUsers, CardLike },
|
||||
components: { AuthForm, OnlineUsers, CardUsers, CardLike},
|
||||
|
||||
mixins: [uf],
|
||||
mixins:[uf],
|
||||
|
||||
setup() {
|
||||
pagecounter()
|
||||
const appStore = useAppStore()
|
||||
setup(){
|
||||
pagecounter()
|
||||
const appStore = useAppStore()
|
||||
const theme = useTheme();
|
||||
const mainmenuStore = useMainmenuStore()
|
||||
const mainmenuStore= useMainmenuStore()
|
||||
const accountStore = useAccountStore()
|
||||
const drawer = ref(true)
|
||||
const drawer_right = ref(true)
|
||||
const menuGetUserDialog = ref(false)
|
||||
const LikeDialog = ref(false)
|
||||
const rail = ref(true)
|
||||
const showTooltip = ref(false)
|
||||
|
||||
const drawer_right=ref(true)
|
||||
const menuGetUserDialog=ref(false)
|
||||
const LikeDialog=ref(false)
|
||||
const rail = ref(false)
|
||||
|
||||
const toggleTheme = () => {
|
||||
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
|
||||
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
|
||||
}
|
||||
|
||||
mainmenuStore.loadlinks()
|
||||
@@ -358,74 +460,78 @@ export default {
|
||||
{
|
||||
name: 'Сотрудники',
|
||||
ico: 'mdi-account-multiple-outline',
|
||||
submenu: [
|
||||
{
|
||||
name: 'Справочник',
|
||||
link: 'http://10.252.44.33/accounting6/members.php'
|
||||
},
|
||||
]
|
||||
submenu:[
|
||||
{
|
||||
name: 'Справочник',
|
||||
link: 'http://10.252.44.33/accounting6/members.php'
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Деятельность',
|
||||
ico: 'mdi-bulletin-board',
|
||||
submenu: [
|
||||
{
|
||||
name: 'Обеспечивающая',
|
||||
path: "/providing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Безопасность',
|
||||
ico: 'mdi-routes',
|
||||
path: "/securyty"
|
||||
},
|
||||
{
|
||||
name: 'О портале',
|
||||
ico: 'mdi-information-variant',
|
||||
path: "/portal"
|
||||
},
|
||||
{
|
||||
name: 'Об инспекции',
|
||||
ico: 'mdi-city',
|
||||
path: "/inspection"
|
||||
}
|
||||
submenu:[
|
||||
{
|
||||
name: 'Обеспечивающая',
|
||||
path:"/providing"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Безопасность',
|
||||
ico: 'mdi-routes',
|
||||
path:"/securyty"
|
||||
},
|
||||
{
|
||||
name: 'Новости',
|
||||
ico: 'mdi-newspaper',
|
||||
path:"/news"
|
||||
},
|
||||
{
|
||||
name: 'О портале',
|
||||
ico: 'mdi-information-variant',
|
||||
path:"/portal"
|
||||
},
|
||||
{
|
||||
name: 'Об инспекции',
|
||||
ico: 'mdi-city',
|
||||
path:"/inspection"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
const imageSrc = computed(() => {
|
||||
|
||||
|
||||
const imageSrc=computed(()=> {
|
||||
return new URL(`@/assets/FNS-logo-xs.png`, import.meta.url).href;
|
||||
})
|
||||
|
||||
const getcard = async () => {
|
||||
const getcard = async() => {
|
||||
menuGetUserDialog.value = true
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
theme,
|
||||
mainmenuStore,
|
||||
accountStore,
|
||||
accountStore,
|
||||
drawer,
|
||||
drawer_right,
|
||||
toggleTheme,
|
||||
navigations,
|
||||
navigations,
|
||||
imageSrc,
|
||||
getcard,
|
||||
menuGetUserDialog,
|
||||
LikeDialog,
|
||||
LikeDialog,
|
||||
// userlinks,
|
||||
appStore,
|
||||
rail,
|
||||
showTooltip
|
||||
rail
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.mystat {
|
||||
|
||||
@@ -58,6 +58,11 @@ const routes = [
|
||||
name: 'AboutPortalPage',
|
||||
component: () => import('@/views/AboutPortalPage.vue'),
|
||||
},
|
||||
{
|
||||
path: '/news',
|
||||
name: 'AboutNewsPage',
|
||||
component: () => import('@/views/NewsPage.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col
|
||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
Новости
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
+9
-2
@@ -39,7 +39,8 @@ class NewsAPIView(ListAPIView):
|
||||
a['scores'] = [{"score":y.score, "user":y.author.username} for y in x.get_news.all()]
|
||||
a['comment'] = [{"author":model_to_dict(DictEmployee.objects.using('user_directory').get(login=k.author.username)),
|
||||
"cdate":k.cdate,
|
||||
"text":k.text
|
||||
"text":k.text,
|
||||
"id": k.pk
|
||||
} for k in x.get_comment_news.all()
|
||||
]
|
||||
|
||||
@@ -62,7 +63,13 @@ class NewsAPIView(ListAPIView):
|
||||
|
||||
if 'text' in request.data:
|
||||
CommentNews.objects.create(news_id=request.data['news'], author=self.request.user, text=request.data['text'])
|
||||
back = {'news': request.data['news'], 'comment': ({"text":y.text, "cdate":y.cdate,
|
||||
back = {'news': request.data['news'], 'comment': ({"text":y.text, "cdate":y.cdate, "id": y.pk,
|
||||
"author":model_to_dict(DictEmployee.objects.using('user_directory').get(login=y.author.username))
|
||||
} for y in CommentNews.objects.filter(news_id=request.data['news']))}
|
||||
if 'delid' in request.data:
|
||||
CommentNews.objects.filter(pk=request.data['delid']).delete()
|
||||
|
||||
back = {'news': request.data['news'], 'comment': ({"text":y.text, "cdate":y.cdate, "id": y.pk,
|
||||
"author":model_to_dict(DictEmployee.objects.using('user_directory').get(login=y.author.username))
|
||||
} for y in CommentNews.objects.filter(news_id=request.data['news']))}
|
||||
|
||||
|
||||
Reference in new issue
Block a user