@ozdao/prometheus-framework 0.2.221 → 0.2.222
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/builder.js +7 -4
- package/dist/builder.mjs +7 -4
- package/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/main.css +1 -1
- package/dist/organizations.server.js +39 -2
- package/dist/organizations.server.mjs +39 -2
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/layouts/Auth.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/layouts/Auth.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Invite.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ResetPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignUp.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignUp.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.cjs +33 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.js +33 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.js.map +1 -0
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +3 -1
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +3 -1
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +8 -7
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +9 -8
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +10 -12
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +10 -12
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs +11 -4
- package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/router/blogposts.js +11 -4
- package/dist/prometheus-framework/src/modules/community/router/blogposts.js.map +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockFilter.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockFilter.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/sections/SectionPageTitle.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/SectionGuide.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +759 -759
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +759 -759
- package/dist/prometheus-framework/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
- package/package.json +1 -1
- package/src/builder/webpack/webpack.config.client.js +7 -4
- package/src/modules/auth/views/middlewares/ownership.validation.js +45 -0
- package/src/modules/community/components/blocks/CardBlogpost.vue +3 -1
- package/src/modules/community/components/layouts/Community.vue +5 -7
- package/src/modules/community/components/pages/BlogPost.vue +7 -10
- package/src/modules/community/models/blogpost.model.js +1 -1
- package/src/modules/community/router/blogposts.js +10 -2
- package/src/modules/organizations/controllers/organizations.controller.js +26 -34
- package/src/modules/organizations/models/department.model.js +14 -0
- package/src/styles/base/all.scss +0 -2
- package/src/styles/config.scss +6 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
|
-
<div style="grid-template-columns: 2fr 4fr 2fr;" class="cols-3 gap-thin pd-thin">
|
2
|
+
<div style="grid-template-columns: 2fr 4fr 2fr;" class="cols-3 gap-thin pd-t-zero pd-thin">
|
3
3
|
|
4
|
-
<ul class="align-self-start pos-sticky pos-t-0 w-100 bg-light radius-big pd-medium p-medium gap-thin flex-column flex-nowrap flex">
|
4
|
+
<ul class="align-self-start pos-sticky pos-t-0 w-100 bg-light radius-big pd-medium p-medium gap-thin flex-column mobile:flex-row flex-nowrap flex z-index-2 o-scroll t-nowrap scroll-hide">
|
5
5
|
<li
|
6
6
|
:class="{'t-black bg-white': route.params.category === 'featured' }"
|
7
7
|
@click="() => { blog.state.sort.param = 'createdAt'; router.push({name: 'Blog', params: { category: 'featured' } })}"
|
@@ -37,10 +37,11 @@
|
|
37
37
|
</li>
|
38
38
|
|
39
39
|
<router-link
|
40
|
+
v-if="auth.state.user._id"
|
40
41
|
:to="{
|
41
42
|
name: 'Create BlogPost'
|
42
43
|
}"
|
43
|
-
class="button t-medium
|
44
|
+
class="button t-medium bg-main w-100"
|
44
45
|
>
|
45
46
|
Create Post
|
46
47
|
</router-link>
|
@@ -48,7 +49,7 @@
|
|
48
49
|
|
49
50
|
<section class="pos-relative">
|
50
51
|
|
51
|
-
<header class="bg-
|
52
|
+
<header class="bg-light t-black radius-big pd-medium pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex">
|
52
53
|
<h3 class="pos-relative flex-v-center flex-nowrap flex">
|
53
54
|
<span class="mn-r-thin">Topics for </span>
|
54
55
|
|
@@ -65,9 +66,6 @@
|
|
65
66
|
radius-medium
|
66
67
|
h3
|
67
68
|
t-center
|
68
|
-
br-solid
|
69
|
-
br-2px
|
70
|
-
br-black-transp-10
|
71
69
|
"
|
72
70
|
/>
|
73
71
|
</h3>
|
@@ -6,7 +6,6 @@
|
|
6
6
|
v-for="i in 3" :key="i"
|
7
7
|
/>
|
8
8
|
</TransitionGroup>
|
9
|
-
|
10
9
|
<transition
|
11
10
|
name="fade"
|
12
11
|
>
|
@@ -125,12 +124,10 @@
|
|
125
124
|
return blogpost.value?.content.find(block => block.type === 'ImageUpload');
|
126
125
|
});
|
127
126
|
|
128
|
-
const firstVideo = computed(() => {
|
129
|
-
return blogpost.value?.content.find(block => block.type === 'Video');
|
130
|
-
});
|
131
|
-
|
132
127
|
const firstText = computed(() => {
|
133
|
-
return blogpost.value?.content
|
128
|
+
return blogpost.value?.content.find(block =>
|
129
|
+
block.type === 'Textarea' && block.class !== 'h2'
|
130
|
+
);
|
134
131
|
});
|
135
132
|
|
136
133
|
const metadata = computed(() => {return {
|
@@ -141,12 +138,12 @@
|
|
141
138
|
// { hid: 'keywords', name: 'keywords', content: t('meta.keywords') },
|
142
139
|
{ hid: 'og:title', property: 'og:title', content: blogpost.value?.name },
|
143
140
|
{ hid: 'og:description', property: 'og:description', content: firstText.value?.content.slice(0,120) },
|
144
|
-
|
141
|
+
{ hid: 'og:image', property: 'og:image', content: firstImage.value?.content ? process.env.FILE_SERVER_URL + firstImage.value?.content : process.env.FILE_SERVER_URL + '/favicon/cover.jpg' },
|
145
142
|
// { hid: 'og:url', property: 'og:url', content: current_url.value },
|
146
143
|
{ hid: 'twitter:title', name: 'twitter:title', content: blogpost.value?.name },
|
147
|
-
{ hid: 'twitter:description', name: 'twitter:description', content: firstText.value },
|
148
|
-
|
149
|
-
|
144
|
+
{ hid: 'twitter:description', name: 'twitter:description', content: firstText.value?.content.slice(0,120) },
|
145
|
+
{ hid: 'twitter:image', name: 'twitter:image', content: firstImage.value?.content ? process.env.FILE_SERVER_URL + firstImage.value?.content : process.env.FILE_SERVER_URL + '/favicon/cover.jpg' },
|
146
|
+
{ hid: 'twitter:card', name: 'twitter:card', content: process.env.FILE_SERVER_URL + '/favicon/cover.jpg' },
|
150
147
|
],
|
151
148
|
}});
|
152
149
|
useHead(metadata.value)
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import layoutCommunity from '../components/layouts/Community.vue'
|
2
|
+
import * as validationAuth from '@pf/src/modules/auth/views/middlewares/auth.validation';
|
3
|
+
import * as validationOwnership from '@pf/src/modules/auth/views/middlewares/ownership.validation';
|
4
|
+
|
2
5
|
|
3
6
|
const community = [
|
4
7
|
{
|
@@ -35,8 +38,10 @@ const community = [
|
|
35
38
|
en: 'Create Post',
|
36
39
|
ru: 'Создать Пост'
|
37
40
|
},
|
38
|
-
authorize: []
|
39
41
|
},
|
42
|
+
beforeEnter: [
|
43
|
+
validationAuth.requiresAuth,
|
44
|
+
],
|
40
45
|
component: () => import(/* webpackChunkName: 'CreateBlogPost' */ '../components/pages/CreateBlogPost.vue')
|
41
46
|
},{
|
42
47
|
path: 'community/posts/:url',
|
@@ -56,8 +61,11 @@ const community = [
|
|
56
61
|
en: 'Edit Post',
|
57
62
|
ru: 'Редактировать пост'
|
58
63
|
},
|
59
|
-
authorize: []
|
60
64
|
},
|
65
|
+
beforeEnter: [
|
66
|
+
validationAuth.requiresAuth,
|
67
|
+
validationOwnership.requiresEditAccess
|
68
|
+
],
|
61
69
|
component: () => import(/* webpackChunkName: 'CreateBlogPost' */ '../components/pages/CreateBlogPost.vue')
|
62
70
|
}
|
63
71
|
|
@@ -29,7 +29,6 @@ const controllerFactory = (db) => {
|
|
29
29
|
[sortParam]: sortOrder === 'desc' ? -1 : 1,
|
30
30
|
"_id": 1
|
31
31
|
};
|
32
|
-
console.log(sort)
|
33
32
|
// if (sortParam === 'distance') sort.numberOfSpots = -1
|
34
33
|
//////////////////////////////////////
|
35
34
|
// 2. Pagination Condition
|
@@ -66,7 +65,32 @@ const controllerFactory = (db) => {
|
|
66
65
|
...(req.query.owner ? [{ owner: new ObjectId(req.query.owner) }] : []),
|
67
66
|
...(req.query.member ? [{"memberships.user": new ObjectId(req.query.member), "memberships.role": 'member' } ] : [] ),
|
68
67
|
...(req.query.subscriber ? [{"memberships.user": new ObjectId(req.query.subscriber), "memberships.role": 'subscriber'} ] : [] ),
|
69
|
-
...(
|
68
|
+
...(
|
69
|
+
req.query.postable ? [{
|
70
|
+
$or: [{
|
71
|
+
$and: [{
|
72
|
+
types: {
|
73
|
+
$elemMatch: { $eq: 'public' }
|
74
|
+
}
|
75
|
+
}, {
|
76
|
+
"memberships.user": new ObjectId(req.query.postable)
|
77
|
+
}]
|
78
|
+
}, {
|
79
|
+
$and: [{
|
80
|
+
types: {
|
81
|
+
$elemMatch: {
|
82
|
+
$in: ['exclusive', 'hidden']
|
83
|
+
} }
|
84
|
+
}, {
|
85
|
+
"memberships.user": new ObjectId(req.query.postable)
|
86
|
+
}, {
|
87
|
+
"memberships.role": {
|
88
|
+
$ne: 'subscriber'
|
89
|
+
}
|
90
|
+
}]
|
91
|
+
}]
|
92
|
+
}] : []
|
93
|
+
),
|
70
94
|
...(req.query.types ? [{ types: { $in: req.query.types } }] : []), // Если req.query.types - строка
|
71
95
|
// to remove
|
72
96
|
...(req.query.onlyuser ? [{ "memberships.user": new ObjectId(req.query.onlyuser) }] : []),
|
@@ -456,36 +480,4 @@ const controllerFactory = (db) => {
|
|
456
480
|
};
|
457
481
|
};
|
458
482
|
|
459
|
-
async function getGeoLocation(req, res) {
|
460
|
-
let { location, address, city, state, country } = req.query;
|
461
|
-
|
462
|
-
if (!location && (address || city || state || country)) {
|
463
|
-
let geoLocation;
|
464
|
-
|
465
|
-
try {
|
466
|
-
const geoResponse = await client.geocode({
|
467
|
-
params: {
|
468
|
-
address: `${state}, ${country}`,
|
469
|
-
key: 'AIzaSyDDR6WgYB7XMt7yTDDzQNEdF_gTdUiq8dI',
|
470
|
-
},
|
471
|
-
});
|
472
|
-
|
473
|
-
if (geoResponse.data.results && geoResponse.data.results.length > 0) {
|
474
|
-
return geoResponse.data.results[0].geometry.location;
|
475
|
-
} else {
|
476
|
-
return res.status(400).send({ message: 'Unable to geocode the provided location.' });
|
477
|
-
}
|
478
|
-
} catch (err) {
|
479
|
-
console.log(err)
|
480
|
-
return res.status(500).send({ message: 'Error occurred while geocoding.' });
|
481
|
-
}
|
482
|
-
} else if (location) {
|
483
|
-
if (typeof location === 'string') {
|
484
|
-
location = JSON.parse(location);
|
485
|
-
}
|
486
|
-
|
487
|
-
return { lat: location.coordinates[1], lng: location.coordinates[0] };
|
488
|
-
}
|
489
|
-
}
|
490
|
-
|
491
483
|
module.exports = controllerFactory;
|
@@ -42,6 +42,20 @@ module.exports = (mongoose) => {
|
|
42
42
|
default: false,
|
43
43
|
},
|
44
44
|
},
|
45
|
+
posts: {
|
46
|
+
read: {
|
47
|
+
type: Boolean,
|
48
|
+
default: false,
|
49
|
+
},
|
50
|
+
edit: {
|
51
|
+
type: Boolean,
|
52
|
+
default: false,
|
53
|
+
},
|
54
|
+
delete: {
|
55
|
+
type: Boolean,
|
56
|
+
default: false,
|
57
|
+
},
|
58
|
+
},
|
45
59
|
gallery: {
|
46
60
|
read: {
|
47
61
|
type: Boolean,
|
package/src/styles/base/all.scss
CHANGED
@@ -172,8 +172,6 @@ body {
|
|
172
172
|
// Flex
|
173
173
|
.flex {
|
174
174
|
display: flex;
|
175
|
-
&-row { flex-direction: row; }
|
176
|
-
&-column { flex-direction: column; }
|
177
175
|
&-nowrap { flex-wrap: nowrap; }
|
178
176
|
&-wrap { flex-wrap: wrap; }
|
179
177
|
&-center { align-items: center; justify-content: center; }
|
package/src/styles/config.scss
CHANGED
@@ -283,6 +283,11 @@ $align-items: (
|
|
283
283
|
'align-baseline': baseline,
|
284
284
|
);
|
285
285
|
|
286
|
+
$flex-direction: (
|
287
|
+
'row': row,
|
288
|
+
'column': column
|
289
|
+
);
|
290
|
+
|
286
291
|
body {
|
287
292
|
@include generate-utility-classes('pd', 'padding', $modifiers, $combined, $breakpoints);
|
288
293
|
@include generate-utility-classes('mn', 'margin', $modifiers, $combined, $breakpoints);
|
@@ -311,6 +316,7 @@ body {
|
|
311
316
|
@include generate-utility-classes('gap', 'gap', null, $combined, $breakpoints);
|
312
317
|
@include generate-utility-classes('flex', 'justify-content', null, $justify-content, $breakpoints);
|
313
318
|
@include generate-utility-classes('flex', 'align-items', null, $align-items, $breakpoints);
|
319
|
+
@include generate-utility-classes('flex', 'flex-direction', null, $flex-direction, $breakpoints);
|
314
320
|
|
315
321
|
@include generate-bg-classes('bg-main', 'main');
|
316
322
|
@include generate-bg-classes('bg-second', 'second');
|