@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.
Files changed (175) hide show
  1. package/dist/community.server.js +1 -1
  2. package/dist/community.server.mjs +1 -1
  3. package/dist/events.server.js +1 -1
  4. package/dist/events.server.mjs +1 -1
  5. package/dist/gallery.server.js +13 -3
  6. package/dist/gallery.server.mjs +13 -3
  7. package/dist/main-DL3vRQCi.js +92 -0
  8. package/dist/main-Ds3Z5x5d.mjs +14206 -0
  9. package/dist/main.css +1 -1
  10. package/dist/orders.server.js +1 -1
  11. package/dist/orders.server.mjs +1 -1
  12. package/dist/organizations.server.js +1 -1
  13. package/dist/organizations.server.mjs +1 -1
  14. package/dist/products.server.js +1 -1
  15. package/dist/products.server.mjs +1 -1
  16. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  18. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
  20. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.js +116 -117
  22. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +123 -109
  24. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  26. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  28. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  30. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +32 -26
  32. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +30 -26
  34. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  42. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  44. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  46. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  50. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  52. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +16 -17
  54. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  56. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  62. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  64. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +44 -69
  66. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.cjs +1 -0
  67. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.js +64 -0
  68. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.cjs +1 -0
  69. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.js +1 -0
  70. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +101 -14
  72. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +166 -103
  74. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  78. package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.js +38 -1
  80. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +3 -3
  82. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +21 -21
  84. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.js +3 -3
  86. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.js +5 -5
  90. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  94. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  96. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  98. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  108. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  110. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  114. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  120. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  128. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  132. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +31 -32
  134. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  136. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  138. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  140. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  142. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
  144. package/dist/prometheus-framework.cjs.js +1 -1
  145. package/dist/prometheus-framework.es.js +1 -1
  146. package/dist/queryProcessor-g8208K6g.mjs +178 -0
  147. package/dist/queryProcessor-haY_gPGg.js +177 -0
  148. package/dist/style.css +1 -1
  149. package/dist/wallet.server.js +1 -1
  150. package/dist/wallet.server.mjs +1 -1
  151. package/dist/web-B8tq3Fda.mjs +54 -0
  152. package/dist/web-ByJkgGrt.js +1 -0
  153. package/package.json +1 -1
  154. package/src/components/DatePicker/Calendar.vue +82 -55
  155. package/src/components/Feed/Feed.vue +45 -16
  156. package/src/components/FieldTags/BlockTags.vue +30 -23
  157. package/src/components/Popup/Popup.vue +2 -2
  158. package/src/modules/events/components/pages/Events.vue +2 -48
  159. package/src/modules/gallery/components/blocks/PhotoViewer.vue +115 -0
  160. package/src/modules/gallery/components/pages/Gallery.vue +103 -6
  161. package/src/modules/gallery/components/sections/BackofficeGallery.vue +100 -32
  162. package/src/modules/gallery/controllers/gallery.controller.js +45 -38
  163. package/src/modules/gallery/models/photo.model.js +4 -0
  164. package/src/modules/globals/components/blocks/CardHeader.vue +1 -1
  165. package/src/modules/globals/components/elements/ButtonDate.vue +37 -43
  166. package/src/modules/globals/components/layouts/Client.vue +1 -1
  167. package/src/modules/globals/components/sections/SectionPageTitle.vue +1 -1
  168. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -2
  169. package/src/modules/globals/services/globals.store.js +13 -17
  170. package/src/modules/icons/skeletons/SkeletonBlogpost.vue +1 -1
  171. package/src/modules/icons/skeletons/SkeletonEvent.vue +1 -1
  172. package/src/modules/icons/skeletons/SkeletonEventShort.vue +1 -1
  173. package/src/modules/icons/skeletons/SkeletonOrganization.vue +1 -1
  174. package/src/modules/products/components/sections/FilterProducts.vue +2 -1
  175. 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="Manage Gallery"
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="gallery.state.sort"
23
- :search="true"
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._id), label: 'Delete' }
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
- <img :src="(FILE_SERVER_URL || '') + item.cover" class="w-100 h-20r object-fit-contain bg-black " @click="openPhotoPopup(photo)" />
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
- title="Add photo"
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
- <Button
94
- :submit="selectedImage._id ? updatePhoto : createPhoto"
95
- :callback="closePhotoPopup"
96
- class="mn-b-thin bg-main w-100"
97
- >
98
- {{selectedImage._id ? 'Update' : 'Publish'}}
99
- </Button>
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
- // Tab logic
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 loadMore = async () => {
159
- loading.value = true
160
- await gallery.read(page, limit)
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 updatePhoto = async () => {
169
- await gallery.update(selectedImage.value)
170
- closePhotoPopup()
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
- console.log(photos)
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
- if (!photos) {
44
- return res.status(404).send({ errorCode: "PHOTOS_NOT_FOUND", message: "Photos not found." });
45
- }
49
+ if (!photos) {
50
+ return res.status(404).send({ errorCode: "PHOTOS_NOT_FOUND", message: "Photos not found." });
51
+ }
46
52
 
47
- res.status(200).send(photos);
53
+ res.status(200).send(photos);
48
54
 
49
- } catch (err) {
50
- console.log(err);
51
- res.status(500).send({ errorCode: "GET_PHOTOS_FAILED", message: "Error occurred while fetching photos.", error: err });
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
 
@@ -15,6 +15,10 @@ module.exports = (db) => {
15
15
  type: String,
16
16
  required: true
17
17
  },
18
+ createdAt: {
19
+ type: Date,
20
+ default: Date.now
21
+ },
18
22
  }, {
19
23
  timestamps: {
20
24
  currentTime: () => Date.now()
@@ -158,7 +158,7 @@
158
158
  class="cursor-pointer z-index-2"
159
159
  >
160
160
  <section
161
- class="bg-black pd-thin radius-small"
161
+ class="bg-black flex-column flex gap-thin pd-thin radius-small"
162
162
  >
163
163
  <FormReport
164
164
  v-if="user !== creator.target._id"
@@ -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">11 Apr - 18 Mar 23</span>
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
- <style scoped>
30
- .bg-white {
31
- background-color: white;
32
- }
33
- .cursor-pointer {
34
- cursor: pointer;
35
- }
36
- .pd-thin {
37
- padding: 0.5rem;
38
- }
39
- .w-2r {
40
- width: 2rem;
41
- }
42
- .t-center {
43
- text-align: center;
44
- }
45
- .t-black {
46
- color: black;
47
- }
48
- .radius-small {
49
- border-radius: 0.25rem;
50
- }
51
- .flex-justify-between {
52
- justify-content: space-between;
53
- }
54
- .flex-column {
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
- </style>
59
+
60
+ </script>
@@ -65,7 +65,7 @@
65
65
  'pos-l-0': !store.globals.state.isOpenSidebar
66
66
  }"
67
67
  >
68
- <!-- <ShopCart /> -->
68
+ <ShopCart />
69
69
 
70
70
  <Status
71
71
  v-if="store.globals.state.error.show"
@@ -49,7 +49,7 @@ const props = defineProps({
49
49
  title: String,
50
50
  actions: Array,
51
51
  tabs: Array,
52
- tabs_current: Object
52
+ tabs_current: [Object, String]
53
53
  });
54
54
 
55
55
  const updateTabsCurrent = (newValue) => {
@@ -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 && tags.length > 0) {
27
- [{ $in: tags.split(',') }]
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: 'POST',
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._id === item._id);
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
- const targetState = state ? state.items : this.state.items;
99
-
100
- const index = targetState.findIndex(i => i._id === item._id);
101
-
102
- if (index !== -1) {
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(--grey))"/>
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(--grey))"/>
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(--grey))"/>
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(--grey))"/>
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 = {