@ozdao/prometheus-framework 0.2.118 → 0.2.120
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/gallery.server.js +13 -3
- package/dist/gallery.server.mjs +13 -3
- package/dist/main-DL3vRQCi.js +92 -0
- package/dist/main-Ds3Z5x5d.mjs +14206 -0
- package/dist/main.css +1 -1
- package/dist/orders.server.js +1 -1
- package/dist/orders.server.mjs +1 -1
- package/dist/organizations.server.js +1 -1
- package/dist/organizations.server.mjs +1 -1
- package/dist/products.server.js +1 -1
- package/dist/products.server.mjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
- package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.js +116 -117
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +123 -109
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
- 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/components/FieldTags/BlockTags.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +32 -26
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +30 -26
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +16 -17
- 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/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.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 +2 -2
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +44 -69
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.js +64 -0
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +101 -14
- 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 +166 -103
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.js +38 -1
- package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +21 -21
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.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 +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- 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 +2 -2
- 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/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- 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/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.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 +2 -2
- 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/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- 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 +2 -2
- 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 +31 -32
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/queryProcessor-g8208K6g.mjs +178 -0
- package/dist/queryProcessor-haY_gPGg.js +177 -0
- package/dist/style.css +1 -1
- package/dist/wallet.server.js +1 -1
- package/dist/wallet.server.mjs +1 -1
- package/dist/web-B8tq3Fda.mjs +54 -0
- package/dist/web-ByJkgGrt.js +1 -0
- package/package.json +1 -1
- package/src/components/DatePicker/Calendar.vue +82 -55
- package/src/components/Feed/Feed.vue +45 -16
- package/src/components/FieldTags/BlockTags.vue +30 -23
- package/src/components/Popup/Popup.vue +2 -2
- package/src/modules/events/components/pages/Events.vue +2 -48
- package/src/modules/gallery/components/blocks/PhotoViewer.vue +115 -0
- package/src/modules/gallery/components/pages/Gallery.vue +103 -6
- package/src/modules/gallery/components/sections/BackofficeGallery.vue +100 -32
- package/src/modules/gallery/controllers/gallery.controller.js +45 -38
- package/src/modules/gallery/models/photo.model.js +4 -0
- package/src/modules/globals/components/blocks/CardHeader.vue +1 -1
- package/src/modules/globals/components/elements/ButtonDate.vue +37 -43
- package/src/modules/globals/components/layouts/Client.vue +1 -1
- package/src/modules/globals/components/sections/SectionPageTitle.vue +1 -1
- package/src/modules/globals/controllers/utils/queryProcessor.js +21 -2
- package/src/modules/globals/services/globals.store.js +13 -17
- package/src/modules/icons/skeletons/SkeletonBlogpost.vue +1 -1
- package/src/modules/icons/skeletons/SkeletonEvent.vue +1 -1
- package/src/modules/icons/skeletons/SkeletonEventShort.vue +1 -1
- package/src/modules/icons/skeletons/SkeletonOrganization.vue +1 -1
- package/src/modules/products/components/sections/FilterProducts.vue +2 -1
- package/src/modules/gallery/components/sections/GalleryWithCategories.vue +0 -176
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="cols-1 gap-thin pd-thin">
|
3
3
|
<SectionPageTitle
|
4
|
-
title="
|
4
|
+
title="Gallery"
|
5
5
|
@update:tabs_current="(update) => tab = update"
|
6
6
|
:tabs_current="tab"
|
7
7
|
:tabs="[
|
@@ -19,8 +19,8 @@
|
|
19
19
|
|
20
20
|
<Feed
|
21
21
|
v-model:items="photos"
|
22
|
-
v-model:sort="
|
23
|
-
:
|
22
|
+
v-model:sort="sort"
|
23
|
+
v-model:date="date"
|
24
24
|
:states="{
|
25
25
|
empty: {
|
26
26
|
title: 'No Photos Found',
|
@@ -50,12 +50,26 @@
|
|
50
50
|
:creator="item.creator"
|
51
51
|
:date="item.createdAt"
|
52
52
|
:actions="[
|
53
|
-
{ method: () => deletePhoto(item
|
53
|
+
{ method: () => deletePhoto(item), label: 'Delete' },
|
54
|
+
{ method: () => changeStatus(item,'archived'), label: 'Archive' },
|
55
|
+
item.status === 'draft' ?
|
56
|
+
{ method: () => changeStatus(item,'published'), label: 'Publish' } :
|
57
|
+
{ method: () => changeStatus(item,'draft'), label: 'Draft' }
|
54
58
|
]"
|
55
59
|
class="pd-small mn-b-small"
|
56
60
|
/>
|
57
61
|
|
58
|
-
<
|
62
|
+
<div class="pos-relative">
|
63
|
+
<img
|
64
|
+
:src="(FILE_SERVER_URL || '') + item.cover"
|
65
|
+
class="w-100 h-20r object-fit-contain bg-black " @click="openPreviewPopup(item)"
|
66
|
+
/>
|
67
|
+
<div
|
68
|
+
class="pos-absolute pos-t-0 pos-r-0 pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-r-small mn-t-small w-min bg-second radius-extra"
|
69
|
+
>
|
70
|
+
{{item.status}}
|
71
|
+
</div>
|
72
|
+
</div>
|
59
73
|
|
60
74
|
<div class="pd-small">
|
61
75
|
<Chips
|
@@ -67,7 +81,17 @@
|
|
67
81
|
</Feed>
|
68
82
|
|
69
83
|
<Popup
|
70
|
-
|
84
|
+
@close-popup="closePreviewPopup"
|
85
|
+
:isPopupOpen="isOpenPreviewPopup"
|
86
|
+
class="bg-black o-hidden w-100 h-100 radius-big"
|
87
|
+
>
|
88
|
+
<PhotoViewer
|
89
|
+
:photoUrl="selectedPhoto.image"
|
90
|
+
/>
|
91
|
+
</Popup>
|
92
|
+
|
93
|
+
<Popup
|
94
|
+
title="Add Photo"
|
71
95
|
@close-popup="closePhotoPopup"
|
72
96
|
:isPopupOpen="isOpenPhotoPopup"
|
73
97
|
class="bg-white w-max-30r radius-big pd-big"
|
@@ -88,15 +112,33 @@
|
|
88
112
|
<BlockTags
|
89
113
|
@tags-changed="newTags => selectedImage.tags = newTags"
|
90
114
|
:tags="selectedImage.tags"
|
115
|
+
:tagsSuggested="[
|
116
|
+
{text: 'people' },
|
117
|
+
{text: 'events' },
|
118
|
+
{text: 'place' },
|
119
|
+
{text: 'food' },
|
120
|
+
{text: 'drinks' },
|
121
|
+
{text: 'special' },
|
122
|
+
]"
|
123
|
+
class="mn-b-semi"
|
91
124
|
/>
|
92
125
|
|
93
|
-
<
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
126
|
+
<div class="flex-nowrap flex gap-thin">
|
127
|
+
<Button
|
128
|
+
:submit="() => createPhoto('draft')"
|
129
|
+
:callback="closePhotoPopup"
|
130
|
+
class="t-nowrap bg-second w-100"
|
131
|
+
>
|
132
|
+
To drafts
|
133
|
+
</Button>
|
134
|
+
<Button
|
135
|
+
:submit="() => createPhoto('published')"
|
136
|
+
:callback="closePhotoPopup"
|
137
|
+
class="bg-main w-100"
|
138
|
+
>
|
139
|
+
Publish
|
140
|
+
</Button>
|
141
|
+
</div>
|
100
142
|
</Popup>
|
101
143
|
</div>
|
102
144
|
</template>
|
@@ -122,14 +164,47 @@ import gallery from '@pf/src/modules/gallery/store/gallery';
|
|
122
164
|
import CardHeader from '@pf/src/modules/globals/components/blocks/CardHeader.vue'
|
123
165
|
import SectionPageTitle from '@pf/src/modules/globals/components/sections/SectionPageTitle.vue'
|
124
166
|
|
167
|
+
import PhotoViewer from '@pf/src/modules/gallery/components/blocks/PhotoViewer.vue'
|
168
|
+
|
125
169
|
import EditImages from '@pf/src/components/EditImages/EditImages.vue';
|
126
170
|
import BlockTags from '@pf/src/components/FieldTags/BlockTags.vue';
|
127
171
|
|
128
172
|
const route = useRoute();
|
129
173
|
|
130
|
-
//
|
174
|
+
// Tabs
|
131
175
|
const tab = ref('all')
|
176
|
+
// Sort
|
177
|
+
let sort = ref({
|
178
|
+
param: 'createdAt',
|
179
|
+
order: 'desc',
|
180
|
+
options: [{
|
181
|
+
label: 'Date',
|
182
|
+
value: 'createdAt'
|
183
|
+
},{
|
184
|
+
label: 'Popularity',
|
185
|
+
value: 'views'
|
186
|
+
},{
|
187
|
+
label: 'Creator',
|
188
|
+
value: 'creator'
|
189
|
+
}]
|
190
|
+
})
|
191
|
+
// Date
|
192
|
+
let date = ref({
|
193
|
+
start: null,
|
194
|
+
end: null
|
195
|
+
})
|
132
196
|
// Popup
|
197
|
+
// Preview Photo
|
198
|
+
const isOpenPreviewPopup = ref(false);
|
199
|
+
function openPreviewPopup(photo) {
|
200
|
+
isOpenPreviewPopup.value = true;
|
201
|
+
selectedPhoto.value = photo;
|
202
|
+
}
|
203
|
+
function closePreviewPopup() {
|
204
|
+
isOpenPreviewPopup.value = false;
|
205
|
+
selectedPhoto.value = null;
|
206
|
+
}
|
207
|
+
// Add Photo
|
133
208
|
const isOpenPhotoPopup = ref(false);
|
134
209
|
function openPhotoPopup(photo) {
|
135
210
|
isOpenPhotoPopup.value = true;
|
@@ -138,6 +213,8 @@ function openPhotoPopup(photo) {
|
|
138
213
|
function closePhotoPopup() {
|
139
214
|
isOpenPhotoPopup.value = false;
|
140
215
|
selectedPhoto.value = null;
|
216
|
+
uploadedImages.value = [];
|
217
|
+
selectedImage.value = { tags: null, image: null };
|
141
218
|
}
|
142
219
|
// Selected Photo
|
143
220
|
const selectedPhoto = ref(null);
|
@@ -151,26 +228,20 @@ const onUpdatedImages = (newImages) => {
|
|
151
228
|
uploadedImages.value = newImages
|
152
229
|
}
|
153
230
|
// Gallery Grid
|
154
|
-
const grid = ref(null)
|
155
231
|
const photos = ref([])
|
156
|
-
const categories = ['all', 'place', 'drinks', 'people', 'events']
|
157
232
|
|
158
|
-
const
|
159
|
-
|
160
|
-
|
161
|
-
loading.value = false
|
162
|
-
}
|
163
|
-
|
164
|
-
const deletePhoto = async (id) => {
|
165
|
-
await gallery.delete(id);
|
233
|
+
const deletePhoto = async (item) => {
|
234
|
+
await gallery.delete(item._id);
|
235
|
+
gallery.removeItem(item, photos.value)
|
166
236
|
};
|
167
237
|
|
168
|
-
const
|
169
|
-
|
170
|
-
|
238
|
+
const changeStatus = async (item, status) => {
|
239
|
+
item.status = status
|
240
|
+
await gallery.update(item)
|
241
|
+
gallery.updateItem(item, photos.value)
|
171
242
|
}
|
172
243
|
|
173
|
-
const createPhoto = async () => {
|
244
|
+
const createPhoto = async (status) => {
|
174
245
|
if (uploadedImages.length < 1) {
|
175
246
|
alert('Upload at least 1 image')
|
176
247
|
return
|
@@ -179,6 +250,7 @@ const createPhoto = async () => {
|
|
179
250
|
let createdPhotos = await gallery.create({
|
180
251
|
images: uploadedImages.value,
|
181
252
|
tags: selectedImage.value.tags,
|
253
|
+
status: status,
|
182
254
|
owner: {
|
183
255
|
type: 'Organization',
|
184
256
|
target: route.params._id
|
@@ -193,10 +265,6 @@ const createPhoto = async () => {
|
|
193
265
|
gallery.addItem(createdPhoto, photos.value)
|
194
266
|
}
|
195
267
|
}
|
196
|
-
|
197
|
-
onMounted(async () => {
|
198
|
-
})
|
199
|
-
|
200
268
|
</script>
|
201
269
|
|
202
270
|
<style scoped>
|
@@ -10,51 +10,57 @@ const controllerFactory = (db) => {
|
|
10
10
|
const Photo = db.photo;
|
11
11
|
|
12
12
|
const read = async (req, res) => {
|
13
|
-
|
14
|
-
let stages = [
|
15
|
-
...queryProcessorGlobals.getBasicOptions(
|
16
|
-
req.query
|
17
|
-
),
|
18
|
-
// For creator
|
19
|
-
queryProcessorGlobals.getCreatorUserLookupStage(),
|
20
|
-
queryProcessorGlobals.getCreatorOrganizationLookupStage(),
|
21
|
-
queryProcessorGlobals.getCreatorCustomerLookupStage(),
|
22
|
-
// For owner
|
23
|
-
queryProcessorGlobals.getOwnerUserLookupStage(),
|
24
|
-
queryProcessorGlobals.getOwnerOrganizationLookupStage(),
|
25
|
-
queryProcessorGlobals.getAddFieldsCreatorOwnerStage(),
|
26
|
-
queryProcessorGlobals.removeTempPropeties(),
|
27
|
-
// Pagination
|
28
|
-
...queryProcessorGlobals.getSortingOptions(
|
29
|
-
req.query.sortParam,
|
30
|
-
req.query.sortOrder,
|
31
|
-
),
|
32
|
-
...queryProcessorGlobals.getPaginationOptions(
|
33
|
-
req.query.skip,
|
34
|
-
req.query.limit
|
35
|
-
)
|
36
|
-
];
|
37
|
-
|
38
|
-
try {
|
39
|
-
const photos = await Photo.aggregate(stages);
|
40
13
|
|
41
|
-
|
14
|
+
console.log(req.query.tags)
|
15
|
+
|
16
|
+
let stages = [
|
17
|
+
...queryProcessorGlobals.getBasicOptions(
|
18
|
+
req.query
|
19
|
+
),
|
20
|
+
// Date Filter
|
21
|
+
...queryProcessorGlobals.getFilterDate(req.query.dateStart, req.query.dateEnd),
|
22
|
+
// Tags
|
23
|
+
...queryProcessorGlobals.getTagsOptions(req.query.tags),
|
24
|
+
// For creator
|
25
|
+
queryProcessorGlobals.getCreatorUserLookupStage(),
|
26
|
+
queryProcessorGlobals.getCreatorOrganizationLookupStage(),
|
27
|
+
queryProcessorGlobals.getCreatorCustomerLookupStage(),
|
28
|
+
// For owner
|
29
|
+
queryProcessorGlobals.getOwnerUserLookupStage(),
|
30
|
+
queryProcessorGlobals.getOwnerOrganizationLookupStage(),
|
31
|
+
queryProcessorGlobals.getAddFieldsCreatorOwnerStage(),
|
32
|
+
queryProcessorGlobals.removeTempPropeties(),
|
33
|
+
// Pagination
|
34
|
+
...queryProcessorGlobals.getSortingOptions(
|
35
|
+
req.query.sortParam,
|
36
|
+
req.query.sortOrder,
|
37
|
+
),
|
38
|
+
...queryProcessorGlobals.getPaginationOptions(
|
39
|
+
req.query.skip,
|
40
|
+
req.query.limit
|
41
|
+
)
|
42
|
+
];
|
43
|
+
|
44
|
+
console.log(stages)
|
45
|
+
|
46
|
+
try {
|
47
|
+
const photos = await Photo.aggregate(stages);
|
42
48
|
|
43
|
-
|
44
|
-
|
45
|
-
|
49
|
+
if (!photos) {
|
50
|
+
return res.status(404).send({ errorCode: "PHOTOS_NOT_FOUND", message: "Photos not found." });
|
51
|
+
}
|
46
52
|
|
47
|
-
|
53
|
+
res.status(200).send(photos);
|
48
54
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
55
|
+
} catch (err) {
|
56
|
+
console.log(err);
|
57
|
+
res.status(500).send({ errorCode: "GET_PHOTOS_FAILED", message: "Error occurred while fetching photos.", error: err });
|
58
|
+
}
|
59
|
+
};
|
54
60
|
|
55
61
|
const create = async (req, res) => {
|
56
62
|
try {
|
57
|
-
const { tags, creator, owner, images } = req.body;
|
63
|
+
const { tags, creator, owner, status, images } = req.body;
|
58
64
|
|
59
65
|
if (!creator || !owner || !images || images.length === 0) {
|
60
66
|
return res.status(400).send({ message: "All fields are required." });
|
@@ -71,6 +77,7 @@ const controllerFactory = (db) => {
|
|
71
77
|
creator,
|
72
78
|
owner,
|
73
79
|
image,
|
80
|
+
status,
|
74
81
|
cover: path.join(directory, 'thumbnail_' + filename) // создаем путь для миниатюры
|
75
82
|
};
|
76
83
|
|
@@ -1,66 +1,60 @@
|
|
1
1
|
<template>
|
2
2
|
<div
|
3
3
|
@click="handleClick"
|
4
|
-
class="flex-center flex"
|
4
|
+
class="cursor-pointer flex-center flex"
|
5
5
|
>
|
6
6
|
<IconCalendar class="w-1r mn-r-thin h-auto"/>
|
7
|
-
<span class="t-semi">
|
7
|
+
<span class="t-semi">{{ formattedDate }}</span>
|
8
8
|
</div>
|
9
9
|
</template>
|
10
10
|
|
11
11
|
<script setup>
|
12
|
-
import { toRefs } from 'vue';
|
13
|
-
|
12
|
+
import { toRefs, computed } from 'vue';
|
14
13
|
import IconCalendar from '@pf/src/modules/icons/navigation/IconCalendar.vue'
|
15
14
|
|
16
15
|
const props = defineProps({
|
17
16
|
action: {
|
18
17
|
type: Function,
|
19
18
|
},
|
19
|
+
date: {
|
20
|
+
type: Object
|
21
|
+
}
|
20
22
|
});
|
21
23
|
|
22
|
-
const { action } = toRefs(props);
|
24
|
+
const { action, date } = toRefs(props);
|
25
|
+
|
26
|
+
const formattedDate = computed(() => formatDate(date.value));
|
23
27
|
|
24
28
|
const handleClick = () => {
|
25
29
|
if (action.value) action.value();
|
26
30
|
};
|
27
|
-
</script>
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
.
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
flex-direction: column;
|
56
|
-
}
|
57
|
-
.flex {
|
58
|
-
display: flex;
|
59
|
-
}
|
60
|
-
.aspect-1x1 {
|
61
|
-
aspect-ratio: 1 / 1;
|
62
|
-
}
|
63
|
-
.transition-linear {
|
64
|
-
transition: width 0.3s linear;
|
32
|
+
function formatDate(dateObj) {
|
33
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
34
|
+
|
35
|
+
const { start, end } = dateObj;
|
36
|
+
|
37
|
+
if (start === null && end === null) {
|
38
|
+
return `All Time`;
|
39
|
+
}
|
40
|
+
|
41
|
+
const startDate = new Date(start);
|
42
|
+
const startDay = startDate.getUTCDate(); // Используем getUTCDate() для дня
|
43
|
+
const startMonth = months[startDate.getUTCMonth()]; // Используем getUTCMonth() для месяца
|
44
|
+
const startYear = startDate.getUTCFullYear(); // Используем getUTCFullYear() для года
|
45
|
+
|
46
|
+
if (!end) {
|
47
|
+
// Если нет end, выводим полную дату для start
|
48
|
+
return `${startDay} ${startMonth} ${startYear}`;
|
49
|
+
}
|
50
|
+
|
51
|
+
const endDate = new Date(end);
|
52
|
+
const endDay = endDate.getUTCDate(); // Используем getUTCDate() для дня
|
53
|
+
const endMonth = months[endDate.getUTCMonth()]; // Используем getUTCMonth() для месяца
|
54
|
+
const endYear = endDate.getUTCFullYear(); // Используем getUTCFullYear() для года
|
55
|
+
|
56
|
+
// Если есть start и end, для start не выводим год, а для end выводим
|
57
|
+
return `${startDay} ${startMonth} - ${endDay} ${endMonth} ${endYear}`;
|
65
58
|
}
|
66
|
-
|
59
|
+
|
60
|
+
</script>
|
@@ -22,9 +22,27 @@ function getBasicOptions(query) {
|
|
22
22
|
}
|
23
23
|
}
|
24
24
|
|
25
|
+
function getFilterDate(start, end) {
|
26
|
+
let filter = {};
|
27
|
+
|
28
|
+
if (start !== null) {
|
29
|
+
filter.$gte = new Date(start);
|
30
|
+
}
|
31
|
+
if (end !== null) {
|
32
|
+
filter.$lte = new Date(end);
|
33
|
+
}
|
34
|
+
|
35
|
+
if (start === 'null' && end === 'null') {
|
36
|
+
return [];
|
37
|
+
} else {
|
38
|
+
return [{ $match: { createdAt: filter } }];
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
25
42
|
function getTagsOptions(tags) {
|
26
|
-
if (tags
|
27
|
-
|
43
|
+
if (tags) {
|
44
|
+
const tagsArray = Array.isArray(tags) ? tags : [tags];
|
45
|
+
return [{ $match: { tags: { $in: tagsArray } } }];
|
28
46
|
} else {
|
29
47
|
return [];
|
30
48
|
}
|
@@ -159,6 +177,7 @@ module.exports = {
|
|
159
177
|
getSortingOptions,
|
160
178
|
getPaginationOptions,
|
161
179
|
getTagsOptions,
|
180
|
+
getFilterDate,
|
162
181
|
// Creator and Owner
|
163
182
|
getCreatorUserLookupStage,
|
164
183
|
getCreatorOrganizationLookupStage,
|
@@ -65,7 +65,7 @@ class Store {
|
|
65
65
|
|
66
66
|
async update(item) {
|
67
67
|
return await this.request('/update', {
|
68
|
-
method: '
|
68
|
+
method: 'PUT',
|
69
69
|
body: item
|
70
70
|
});
|
71
71
|
}
|
@@ -83,9 +83,9 @@ class Store {
|
|
83
83
|
state.splice(0, state.length, ...items);
|
84
84
|
}
|
85
85
|
|
86
|
-
addItem(item, state) {
|
86
|
+
addItem(item, state, property = '_id') {
|
87
87
|
const targetState = state || this.state.items;
|
88
|
-
const existingItemIndex = targetState.findIndex(i => i
|
88
|
+
const existingItemIndex = targetState.findIndex(i => i[property] === item[property]);
|
89
89
|
|
90
90
|
if (existingItemIndex === -1) {
|
91
91
|
targetState.splice(0, 0, item);
|
@@ -94,22 +94,18 @@ class Store {
|
|
94
94
|
}
|
95
95
|
}
|
96
96
|
|
97
|
-
updateItem(item, state) {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
targetState.splice(index, 1, item); // замена найденного элемента обновленным
|
97
|
+
updateItem(item, state, property = '_id') {
|
98
|
+
const targetState = state || this.state.items;
|
99
|
+
const index = targetState.findIndex(i => i[property] === item[property]);
|
100
|
+
if (index !== -1) {
|
101
|
+
targetState.splice(index, 1, item);
|
102
|
+
}
|
104
103
|
}
|
105
|
-
}
|
106
|
-
|
107
|
-
removeItem(item, state) {
|
108
|
-
const targetState = state ? state.items : this.state.items;
|
109
|
-
|
110
|
-
// Поиск и удаление элемента по его _id
|
111
|
-
const index = targetState.findIndex(i => i._id === item._id);
|
112
104
|
|
105
|
+
removeItem(item, state, property = '_id') {
|
106
|
+
const targetState = state || this.state.items;
|
107
|
+
// Поиск и удаление элемента по указанному ключу
|
108
|
+
const index = targetState.findIndex(i => i[property] === item[property]);
|
113
109
|
if (index !== -1) {
|
114
110
|
targetState.splice(index, 1);
|
115
111
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<svg width="100%" height="20rem" xmlns="http://www.w3.org/2000/svg">
|
3
3
|
<!-- Фоновый прямоугольник для всей карточки -->
|
4
|
-
<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--
|
4
|
+
<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--light))"/>
|
5
5
|
|
6
6
|
<!-- Имитация шапки карточки -->
|
7
7
|
<rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<svg width="100%" height="20rem" xmlns="http://www.w3.org/2000/svg">
|
3
3
|
<!-- Фоновый прямоугольник для всей карточки -->
|
4
|
-
<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--
|
4
|
+
<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--light))"/>
|
5
5
|
|
6
6
|
<!-- Имитация шапки карточки -->
|
7
7
|
<rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<svg width="100%" height="50" xmlns="http://www.w3.org/2000/svg">
|
3
3
|
<!-- Фоновый прямоугольник для всей строки -->
|
4
|
-
<rect x="0" y="0" width="100%" height="100%" fill="rgb(var(--
|
4
|
+
<rect x="0" y="0" width="100%" height="100%" fill="rgb(var(--light))"/>
|
5
5
|
|
6
6
|
<!-- Имитация времени -->
|
7
7
|
<rect x="15" y="15" rx="3" ry="3" width="40" height="20" fill="rgba(var(--black),0.05)"></rect>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<svg width="100%" height="20rem" xmlns="http://www.w3.org/2000/svg">
|
3
3
|
<!-- Фоновый прямоугольник для всей карточки -->
|
4
|
-
<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--
|
4
|
+
<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--light))"/>
|
5
5
|
|
6
6
|
<!-- Имитация шапки карточки -->
|
7
7
|
<rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect>
|
@@ -94,7 +94,6 @@ import * as marketplace from '@pf/src/modules/marketplace/store/marketplace';
|
|
94
94
|
let options = {
|
95
95
|
status: 'published'
|
96
96
|
}
|
97
|
-
await categories.actions.fetchCategories(options)
|
98
97
|
|
99
98
|
let selectedFilters = ref({
|
100
99
|
categories: [],
|
@@ -149,6 +148,8 @@ watch(() => marketplace.state.filter, (newFilterValue, oldFilterValue) => {
|
|
149
148
|
}, { deep: true })
|
150
149
|
|
151
150
|
onMounted(async () => {
|
151
|
+
await categories.actions.fetchCategories(options)
|
152
|
+
|
152
153
|
if (route.query) {
|
153
154
|
const query = route.query;
|
154
155
|
const newFilterValue = {
|