@ozdao/prometheus-framework 0.2.118 → 0.2.119

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) 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 +9 -3
  6. package/dist/gallery.server.mjs +9 -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/Block/Block.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
  18. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.js +116 -117
  20. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +58 -1
  22. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +1 -58
  24. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +123 -109
  26. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +32 -26
  28. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -73
  30. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +77 -1
  32. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
  34. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
  36. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
  38. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
  40. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  42. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  44. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +16 -17
  50. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  51. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  53. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  54. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.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/pages/EditEvent.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  60. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +44 -69
  64. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.cjs +1 -0
  65. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.js +64 -0
  66. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.cjs +1 -0
  67. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.js +1 -0
  68. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +101 -14
  70. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +165 -102
  72. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.js +38 -1
  76. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +3 -3
  78. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +21 -21
  80. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.js +3 -3
  82. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.js +1 -1
  84. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.js +5 -5
  86. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  90. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
  92. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
  94. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  98. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  102. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.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/Members.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +3 -3
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  120. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  124. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  128. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.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 +1 -1
  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/reports/components/sections/FormReport.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  136. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  138. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +4 -4
  140. package/dist/prometheus-framework.cjs.js +1 -1
  141. package/dist/prometheus-framework.es.js +1 -1
  142. package/dist/queryProcessor-g8208K6g.mjs +178 -0
  143. package/dist/queryProcessor-haY_gPGg.js +177 -0
  144. package/dist/style.css +1 -1
  145. package/dist/wallet.server.js +1 -1
  146. package/dist/wallet.server.mjs +1 -1
  147. package/dist/web-B8tq3Fda.mjs +54 -0
  148. package/dist/web-ByJkgGrt.js +1 -0
  149. package/package.json +1 -1
  150. package/src/components/DatePicker/Calendar.vue +82 -55
  151. package/src/components/Feed/Feed.vue +45 -16
  152. package/src/components/FieldTags/BlockTags.vue +30 -23
  153. package/src/components/Popup/Popup.vue +2 -2
  154. package/src/modules/events/components/pages/Events.vue +2 -48
  155. package/src/modules/gallery/components/blocks/PhotoViewer.vue +115 -0
  156. package/src/modules/gallery/components/pages/Gallery.vue +103 -6
  157. package/src/modules/gallery/components/sections/BackofficeGallery.vue +100 -32
  158. package/src/modules/gallery/controllers/gallery.controller.js +45 -38
  159. package/src/modules/globals/components/blocks/CardHeader.vue +1 -1
  160. package/src/modules/globals/components/elements/ButtonDate.vue +37 -43
  161. package/src/modules/globals/components/layouts/Client.vue +1 -1
  162. package/src/modules/globals/components/sections/SectionPageTitle.vue +1 -1
  163. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -2
  164. package/src/modules/globals/services/globals.store.js +13 -17
  165. package/src/modules/icons/skeletons/SkeletonBlogpost.vue +1 -1
  166. package/src/modules/icons/skeletons/SkeletonEvent.vue +1 -1
  167. package/src/modules/icons/skeletons/SkeletonEventShort.vue +1 -1
  168. package/src/modules/icons/skeletons/SkeletonOrganization.vue +1 -1
  169. package/src/modules/products/components/sections/FilterProducts.vue +2 -1
  170. package/src/modules/gallery/components/sections/GalleryWithCategories.vue +0 -176
@@ -1,15 +1,112 @@
1
1
  <template>
2
- <div class="wrapper">
3
- <Title :text="$t('gallery.title')" class="pd-medium" />
2
+ <div class="cols-1 gap-thin pd-thin">
3
+ <SectionPageTitle
4
+ :title="$t('gallery.title')"
5
+ @update:tabs_current="(update) => tab = update"
6
+ :tabs_current="tab"
7
+ :tabs="[
8
+ { name: 'All', value: 'all' },
9
+ { name: 'Place', value: 'place' },
10
+ { name: 'Drinks', value: 'drinks' },
11
+ { name: 'People', value: 'people' },
12
+ { name: 'Events', value: 'events' }
13
+ ]"
14
+ class="mn-b-small bg-light bg-light radius-big"
15
+ />
16
+ <Popup
17
+ @close-popup="closePreviewPopup"
18
+ :isPopupOpen="isOpenPreviewPopup"
19
+ class="bg-black o-hidden w-100 h-100 radius-big"
20
+ >
21
+ <PhotoViewer
22
+ :photoUrl="selectedPhoto.image"
23
+ />
24
+ </Popup>
4
25
 
5
- <div style="min-height: 100vh">
6
- <GalleryWithCategories/>
7
- </div>
26
+ <Feed
27
+ v-model:items="photos"
28
+ v-model:sort="sort"
29
+ v-model:date="date"
30
+ :states="{
31
+ empty: {
32
+ title: 'No Photos Found',
33
+ description: 'Currently, there are no photos in gallery.'
34
+ },
35
+ }"
36
+ :store="{
37
+ read: (options) => gallery.read(options)
38
+ }"
39
+ :options="{
40
+ limit: 15,
41
+ status: 'published',
42
+ ...(tab !== 'all' && { tags: tab })
43
+ }"
44
+ v-slot="{
45
+ items
46
+ }"
47
+ class="cols-3 gap-thin"
48
+ >
49
+ <div v-for="item in items" :key="item._id" class="bg-light radius-medium o-hidden flex-column pos-relative flex-wrap">
50
+ <div class="w-100 h-100 pos-relative">
51
+ <img
52
+ :src="(FILE_SERVER_URL || '') + item.cover"
53
+ class="w-100 h-100 object-fit-cover bg-black " @click="openPreviewPopup(item)"
54
+ />
55
+ </div>
56
+ </div>
57
+ </Feed>
8
58
  </div>
9
59
  </template>
10
60
 
11
61
  <script setup>
62
+ import { ref, onMounted, reactive, computed } from 'vue'
63
+
12
64
  import Title from '@pf/src/modules/globals/components/sections/Title.vue';
13
65
 
14
- import GalleryWithCategories from '@pf/src/modules/gallery/components/sections/GalleryWithCategories.vue';
66
+ import Feed from '@pf/src/components/Feed/Feed.vue'
67
+ import Popup from '@pf/src/components/Popup/Popup.vue'
68
+
69
+ import SectionPageTitle from '@pf/src/modules/globals/components/sections/SectionPageTitle.vue'
70
+
71
+ import PhotoViewer from '@pf/src/modules/gallery/components/blocks/PhotoViewer.vue'
72
+
73
+ import gallery from '@pf/src/modules/gallery/store/gallery';
74
+
75
+ const photos = ref([])
76
+
77
+ const tab = ref('all')
78
+
79
+ let sort = ref({
80
+ param: 'createdAt',
81
+ order: 'desc',
82
+ options: [{
83
+ label: 'Date',
84
+ value: 'createdAt'
85
+ },{
86
+ label: 'Popularity',
87
+ value: 'views'
88
+ },{
89
+ label: 'Creator',
90
+ value: 'creator'
91
+ }]
92
+ })
93
+ // Date
94
+ let date = ref({
95
+ start: null,
96
+ end: null
97
+ })
98
+
99
+ const selectedPhoto = ref(null);
100
+
101
+ // Preview Photo
102
+ const isOpenPreviewPopup = ref(false);
103
+ function openPreviewPopup(photo) {
104
+ isOpenPreviewPopup.value = true;
105
+ selectedPhoto.value = photo;
106
+ }
107
+ function closePreviewPopup() {
108
+ isOpenPreviewPopup.value = false;
109
+ selectedPhoto.value = null;
110
+ }
111
+
15
112
  </script>
@@ -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
 
@@ -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>