@ozdao/prometheus-framework 0.2.220 → 0.2.222

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. package/dist/builder.js +7 -4
  2. package/dist/builder.mjs +7 -4
  3. package/dist/community.server.js +1 -1
  4. package/dist/community.server.mjs +1 -1
  5. package/dist/main.css +1 -1
  6. package/dist/organizations.server.js +39 -2
  7. package/dist/organizations.server.mjs +39 -2
  8. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  9. package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -1
  10. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +1 -1
  12. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  14. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +1 -1
  16. package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +1 -1
  18. package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
  20. package/dist/prometheus-framework/src/modules/auth/views/components/layouts/Auth.vue.cjs +4 -4
  21. package/dist/prometheus-framework/src/modules/auth/views/components/layouts/Auth.vue.js +4 -4
  22. package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.js +1 -1
  24. package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +3 -3
  25. package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterPassword.vue.js +3 -3
  26. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Invite.vue.cjs +3 -3
  27. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Invite.vue.js +3 -3
  28. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +3 -3
  29. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ResetPassword.vue.js +3 -3
  30. package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.cjs +3 -3
  31. package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.js +3 -3
  32. package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignUp.vue.cjs +3 -3
  33. package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignUp.vue.js +3 -3
  34. package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.cjs +33 -0
  35. package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.cjs.map +1 -0
  36. package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.js +33 -0
  37. package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.js.map +1 -0
  38. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +3 -1
  39. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs.map +1 -1
  40. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +3 -1
  41. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js.map +1 -1
  42. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +9 -8
  43. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs.map +1 -1
  44. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +10 -9
  45. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js.map +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +11 -13
  47. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs.map +1 -1
  48. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +11 -13
  49. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js.map +1 -1
  50. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +4 -4
  51. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +4 -4
  52. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +3 -3
  53. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  54. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +2 -2
  55. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
  56. package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs +11 -4
  57. package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs.map +1 -1
  58. package/dist/prometheus-framework/src/modules/community/router/blogposts.js +11 -4
  59. package/dist/prometheus-framework/src/modules/community/router/blogposts.js.map +1 -1
  60. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +2 -2
  63. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +2 -2
  64. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +3 -3
  67. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  68. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +3 -3
  69. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
  70. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/events/components/sections/Feed.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/events/components/sections/Feed.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/events/components/sections/List.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/events/components/sections/List.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
  78. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +4 -4
  79. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +4 -4
  80. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +2 -2
  83. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.js +2 -2
  84. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.cjs +4 -5
  85. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.cjs.map +1 -1
  86. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.js +4 -5
  87. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.js.map +1 -1
  88. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs +2 -2
  89. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js +2 -2
  90. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.cjs +2 -2
  91. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.js +2 -2
  92. package/dist/prometheus-framework/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/globals/views/components/partials/NavigationBar.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/globals/views/components/sections/SectionPageTitle.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/globals/views/components/sections/SectionPageTitle.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +3 -3
  97. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
  98. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +2 -2
  99. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +2 -2
  100. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +5 -5
  101. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +5 -5
  102. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  104. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +3 -3
  105. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +3 -3
  106. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +2 -2
  107. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +2 -2
  108. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  110. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  112. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +6 -6
  115. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +6 -6
  116. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +2 -2
  117. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  118. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  120. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +5 -5
  121. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +5 -5
  122. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  124. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +4 -4
  125. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +4 -4
  126. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.js +1 -1
  128. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +3 -3
  129. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  130. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +5 -5
  131. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +5 -5
  132. package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +713 -713
  133. package/dist/prometheus-framework/src/modules/pages/pages.client.js +713 -713
  134. package/dist/prometheus-framework/src/modules/pages/views/components/blocks/CardPage.vue.cjs +3 -3
  135. package/dist/prometheus-framework/src/modules/pages/views/components/blocks/CardPage.vue.js +3 -3
  136. package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.cjs +2 -2
  137. package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.js +2 -2
  138. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +2 -2
  139. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.js +2 -2
  140. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +2 -2
  141. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  142. package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue.js +1 -1
  144. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  146. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  148. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  150. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  152. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +3 -3
  153. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  154. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +3 -3
  155. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +3 -3
  156. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  158. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +4 -4
  159. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +4 -4
  160. package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
  162. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +2 -2
  163. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +2 -2
  164. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  166. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +4 -4
  167. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +4 -4
  168. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
  169. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
  170. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  172. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +3 -3
  173. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
  174. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +2 -2
  175. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +2 -2
  176. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  177. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  178. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  179. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +1 -1
  180. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +5 -5
  181. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +5 -5
  182. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +3 -3
  183. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
  184. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  185. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  186. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +3 -3
  187. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  188. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  189. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  190. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -1
  191. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
  192. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +2 -2
  193. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +2 -2
  194. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +3 -3
  195. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
  196. package/package.json +1 -1
  197. package/src/builder/webpack/webpack.config.client.js +7 -4
  198. package/src/modules/auth/views/middlewares/ownership.validation.js +45 -0
  199. package/src/modules/community/components/blocks/CardBlogpost.vue +3 -1
  200. package/src/modules/community/components/layouts/Community.vue +5 -7
  201. package/src/modules/community/components/pages/BlogPost.vue +7 -10
  202. package/src/modules/community/models/blogpost.model.js +1 -1
  203. package/src/modules/community/router/blogposts.js +10 -2
  204. package/src/modules/globals/views/components/layouts/App.vue +7 -7
  205. package/src/modules/organizations/controllers/organizations.controller.js +26 -34
  206. package/src/modules/organizations/models/department.model.js +14 -0
  207. package/src/styles/base/all.scss +0 -2
  208. package/src/styles/config.scss +6 -0
@@ -103,7 +103,6 @@ const controllerFactory$5 = (db) => {
103
103
  [sortParam]: sortOrder === "desc" ? -1 : 1,
104
104
  "_id": 1
105
105
  };
106
- console.log(sort);
107
106
  const pagination = {
108
107
  skip: parseInt(req.query.skip) || 0,
109
108
  limit: parseInt(req.query.limit) || 20
@@ -126,7 +125,31 @@ const controllerFactory$5 = (db) => {
126
125
  ...req.query.owner ? [{ owner: new ObjectId$1(req.query.owner) }] : [],
127
126
  ...req.query.member ? [{ "memberships.user": new ObjectId$1(req.query.member), "memberships.role": "member" }] : [],
128
127
  ...req.query.subscriber ? [{ "memberships.user": new ObjectId$1(req.query.subscriber), "memberships.role": "subscriber" }] : [],
129
- ...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$1(req.query.postable) }] }, { $and: [{ types: { $elemMatch: { $in: ["exclusive", "hidden"] } } }, { "memberships.user": new ObjectId$1(req.query.postable) }, { "memberships.role": { $ne: "subscriber" } }] }] }] : [],
128
+ ...req.query.postable ? [{
129
+ $or: [{
130
+ $and: [{
131
+ types: {
132
+ $elemMatch: { $eq: "public" }
133
+ }
134
+ }, {
135
+ "memberships.user": new ObjectId$1(req.query.postable)
136
+ }]
137
+ }, {
138
+ $and: [{
139
+ types: {
140
+ $elemMatch: {
141
+ $in: ["exclusive", "hidden"]
142
+ }
143
+ }
144
+ }, {
145
+ "memberships.user": new ObjectId$1(req.query.postable)
146
+ }, {
147
+ "memberships.role": {
148
+ $ne: "subscriber"
149
+ }
150
+ }]
151
+ }]
152
+ }] : [],
130
153
  ...req.query.types ? [{ types: { $in: req.query.types } }] : [],
131
154
  // Если req.query.types - строка
132
155
  // to remove
@@ -790,6 +813,20 @@ var department_model = (mongoose) => {
790
813
  default: false
791
814
  }
792
815
  },
816
+ posts: {
817
+ read: {
818
+ type: Boolean,
819
+ default: false
820
+ },
821
+ edit: {
822
+ type: Boolean,
823
+ default: false
824
+ },
825
+ delete: {
826
+ type: Boolean,
827
+ default: false
828
+ }
829
+ },
793
830
  gallery: {
794
831
  read: {
795
832
  type: Boolean,
@@ -102,7 +102,6 @@ const controllerFactory$5 = (db) => {
102
102
  [sortParam]: sortOrder === "desc" ? -1 : 1,
103
103
  "_id": 1
104
104
  };
105
- console.log(sort);
106
105
  const pagination = {
107
106
  skip: parseInt(req.query.skip) || 0,
108
107
  limit: parseInt(req.query.limit) || 20
@@ -125,7 +124,31 @@ const controllerFactory$5 = (db) => {
125
124
  ...req.query.owner ? [{ owner: new ObjectId$1(req.query.owner) }] : [],
126
125
  ...req.query.member ? [{ "memberships.user": new ObjectId$1(req.query.member), "memberships.role": "member" }] : [],
127
126
  ...req.query.subscriber ? [{ "memberships.user": new ObjectId$1(req.query.subscriber), "memberships.role": "subscriber" }] : [],
128
- ...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$1(req.query.postable) }] }, { $and: [{ types: { $elemMatch: { $in: ["exclusive", "hidden"] } } }, { "memberships.user": new ObjectId$1(req.query.postable) }, { "memberships.role": { $ne: "subscriber" } }] }] }] : [],
127
+ ...req.query.postable ? [{
128
+ $or: [{
129
+ $and: [{
130
+ types: {
131
+ $elemMatch: { $eq: "public" }
132
+ }
133
+ }, {
134
+ "memberships.user": new ObjectId$1(req.query.postable)
135
+ }]
136
+ }, {
137
+ $and: [{
138
+ types: {
139
+ $elemMatch: {
140
+ $in: ["exclusive", "hidden"]
141
+ }
142
+ }
143
+ }, {
144
+ "memberships.user": new ObjectId$1(req.query.postable)
145
+ }, {
146
+ "memberships.role": {
147
+ $ne: "subscriber"
148
+ }
149
+ }]
150
+ }]
151
+ }] : [],
129
152
  ...req.query.types ? [{ types: { $in: req.query.types } }] : [],
130
153
  // Если req.query.types - строка
131
154
  // to remove
@@ -789,6 +812,20 @@ var department_model = (mongoose) => {
789
812
  default: false
790
813
  }
791
814
  },
815
+ posts: {
816
+ read: {
817
+ type: Boolean,
818
+ default: false
819
+ },
820
+ edit: {
821
+ type: Boolean,
822
+ default: false
823
+ },
824
+ delete: {
825
+ type: Boolean,
826
+ default: false
827
+ }
828
+ },
792
829
  gallery: {
793
830
  read: {
794
831
  type: Boolean,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- const Loader = require("../Loader/Loader.vue2.cjs");
4
+ const Loader = require("../Loader/Loader.vue.cjs");
5
5
  ;/* empty css */
6
6
  const _hoisted_1 = ["disabled"];
7
7
  const _hoisted_2 = { key: 0 };
@@ -1,5 +1,5 @@
1
1
  import { ref, openBlock, createElementBlock, withModifiers, createVNode, Transition, withCtx, renderSlot, toDisplayString, createCommentVNode } from "vue";
2
- import Loader from "../Loader/Loader.vue2.js";
2
+ import Loader from "../Loader/Loader.vue.js";
3
3
  /* empty css */
4
4
  const _hoisted_1 = ["disabled"];
5
5
  const _hoisted_2 = { key: 0 };
@@ -2,7 +2,7 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
4
  const SkeletonEvent = require("../../modules/icons/skeletons/SkeletonEvent.vue.cjs");
5
- const Loader = require("../Loader/Loader.vue2.cjs");
5
+ const Loader = require("../Loader/Loader.vue.cjs");
6
6
  const EmptyState = require("../EmptyState/EmptyState.vue.cjs");
7
7
  const Dropdown = require("../Dropdown/Dropdown.vue.cjs");
8
8
  const Calendar = require("../DatePicker/Calendar.vue2.cjs");
@@ -1,6 +1,6 @@
1
1
  import { mergeModels, useModel, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock, Fragment, createBlock, normalizeClass, createCommentVNode, createElementVNode, createVNode, withCtx, unref, TransitionGroup, renderList, renderSlot } from "vue";
2
2
  import SkeletonEvent from "../../modules/icons/skeletons/SkeletonEvent.vue.js";
3
- import Loader from "../Loader/Loader.vue2.js";
3
+ import Loader from "../Loader/Loader.vue.js";
4
4
  import _sfc_main$a from "../EmptyState/EmptyState.vue.js";
5
5
  import _sfc_main$5 from "../Dropdown/Dropdown.vue.js";
6
6
  import _sfc_main$7 from "../DatePicker/Calendar.vue2.js";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- const Field = require("../Field/Field.vue2.cjs");
4
+ const Field = require("../Field/Field.vue.cjs");
5
5
  const IconArrow = require("../../modules/icons/navigation/IconArrow.vue.cjs");
6
6
  const vueI18n = require("vue-i18n");
7
7
  const _hoisted_1 = { class: "pd-thin radius-extra flex-nowrap flex" };
@@ -1,5 +1,5 @@
1
1
  import { ref, onMounted, watchEffect, openBlock, createElementBlock, createVNode, unref, isRef, createElementVNode, toDisplayString, createCommentVNode } from "vue";
2
- import Field from "../Field/Field.vue2.js";
2
+ import Field from "../Field/Field.vue.js";
3
3
  import _sfc_main$1 from "../../modules/icons/navigation/IconArrow.vue.js";
4
4
  import { useI18n } from "vue-i18n";
5
5
  const _hoisted_1 = { class: "pd-thin radius-extra flex-nowrap flex" };
@@ -2,7 +2,7 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
4
  const index = require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");
5
- const Loader = require("../Loader/Loader.vue2.cjs");
5
+ const Loader = require("../Loader/Loader.vue.cjs");
6
6
  ;/* empty css */
7
7
  const _hoisted_1 = { class: "pos-relative" };
8
8
  const _hoisted_2 = {
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, watchEffect, openBlock, createElementBlock, createElementVNode, createVNode, Transition, withCtx, createBlock } from "vue";
2
2
  import { Loader } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
3
- import Loader$1 from "../Loader/Loader.vue2.js";
3
+ import Loader$1 from "../Loader/Loader.vue.js";
4
4
  /* empty css */
5
5
  const _hoisted_1 = { class: "pos-relative" };
6
6
  const _hoisted_2 = {
@@ -5,7 +5,7 @@ const vueRouter = require("vue-router");
5
5
  require("vue-i18n");
6
6
  const emblaCarouselVue_esm = require("../../../../node_modules/embla-carousel-vue/esm/embla-carousel-vue.esm.cjs");
7
7
  const emblaCarouselAutoplay_esm = require("../../../../node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.cjs");
8
- ;/* empty css */
8
+ ;/* empty css */
9
9
  const _hoisted_1 = { class: "embla__container" };
10
10
  const _sfc_main = {
11
11
  __name: "Slider",
@@ -3,7 +3,7 @@ import { useRouter } from "vue-router";
3
3
  import "vue-i18n";
4
4
  import emblaCarouselVue from "../../../../node_modules/embla-carousel-vue/esm/embla-carousel-vue.esm.js";
5
5
  import Autoplay from "../../../../node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js";
6
- /* empty css */
6
+ /* empty css */
7
7
  const _hoisted_1 = { class: "embla__container" };
8
8
  const _sfc_main = {
9
9
  __name: "Slider",
@@ -2,7 +2,7 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
4
  const axios = require("axios");
5
- const Loader = require("../Loader/Loader.vue2.cjs");
5
+ const Loader = require("../Loader/Loader.vue.cjs");
6
6
  const IconUpload = require("../../modules/icons/navigation/IconUpload.vue.cjs");
7
7
  const _hoisted_1 = {
8
8
  key: 0,
@@ -1,6 +1,6 @@
1
1
  import { ref, openBlock, createElementBlock, withModifiers, createVNode, Transition, withCtx, toDisplayString, createCommentVNode, createBlock, createElementVNode } from "vue";
2
2
  import axios from "axios";
3
- import Loader from "../Loader/Loader.vue2.js";
3
+ import Loader from "../Loader/Loader.vue.js";
4
4
  import _sfc_main$1 from "../../modules/icons/navigation/IconUpload.vue.js";
5
5
  const _hoisted_1 = {
6
6
  key: 0,
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- ;/* empty css */
5
- ;/* empty css */
6
- ;/* empty css */
7
- ;/* empty css */
4
+ ;/* empty css */
5
+ ;/* empty css */
6
+ ;/* empty css */
7
+ ;/* empty css */
8
8
  require("vue-i18n");
9
9
  ;/* empty css */
10
10
  const vueRouter = require("vue-router");
@@ -1,8 +1,8 @@
1
1
  import { ref, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Transition, createBlock, resolveDynamicComponent, createElementVNode } from "vue";
2
- /* empty css */
3
- /* empty css */
4
- /* empty css */
5
- /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
+ /* empty css */
5
+ /* empty css */
6
6
  import "vue-i18n";
7
7
  /* empty css */
8
8
  import { useRoute, useRouter } from "vue-router";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- ;/* empty css */
4
+ ;/* empty css */
5
5
  const vueRouter = require("vue-router");
6
6
  const vueI18n = require("vue-i18n");
7
7
  const auth = require("../../store/auth.cjs");
@@ -1,5 +1,5 @@
1
1
  import { reactive, watch, ref, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, withDirectives, vModelText } from "vue";
2
- /* empty css */
2
+ /* empty css */
3
3
  import { useRoute, useRouter } from "vue-router";
4
4
  import { useI18n } from "vue-i18n";
5
5
  import { state as state$1 } from "../../store/auth.js";
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- ;/* empty css */
5
- const Field = require("../../../../../components/Field/Field.vue2.cjs");
6
- const Button = require("../../../../../components/Button/Button.vue2.cjs");
4
+ ;/* empty css */
5
+ const Field = require("../../../../../components/Field/Field.vue.cjs");
6
+ const Button = require("../../../../../components/Button/Button.vue.cjs");
7
7
  const vueRouter = require("vue-router");
8
8
  const vueI18n = require("vue-i18n");
9
9
  const auth = require("../../store/auth.cjs");
@@ -1,7 +1,7 @@
1
1
  import { ref, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, createVNode, createTextVNode, createCommentVNode, withCtx } from "vue";
2
- /* empty css */
3
- import Field from "../../../../../components/Field/Field.vue2.js";
4
- import _sfc_main$1 from "../../../../../components/Button/Button.vue2.js";
2
+ /* empty css */
3
+ import Field from "../../../../../components/Field/Field.vue.js";
4
+ import _sfc_main$1 from "../../../../../components/Button/Button.vue.js";
5
5
  import { useRoute, useRouter } from "vue-router";
6
6
  import { useI18n } from "vue-i18n";
7
7
  import { state, actions } from "../../store/auth.js";
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- ;/* empty css */
5
- const Field = require("../../../../../components/Field/Field.vue2.cjs");
6
- const Button = require("../../../../../components/Button/Button.vue2.cjs");
4
+ ;/* empty css */
5
+ const Field = require("../../../../../components/Field/Field.vue.cjs");
6
+ const Button = require("../../../../../components/Button/Button.vue.cjs");
7
7
  const vueRouter = require("vue-router");
8
8
  const auth = require("../../store/auth.cjs");
9
9
  const invites = require("../../../../organizations/store/invites.cjs");
@@ -1,7 +1,7 @@
1
1
  import { ref, onMounted, openBlock, createElementBlock, createElementVNode, createVNode, withCtx } from "vue";
2
- /* empty css */
3
- import Field from "../../../../../components/Field/Field.vue2.js";
4
- import _sfc_main$1 from "../../../../../components/Button/Button.vue2.js";
2
+ /* empty css */
3
+ import Field from "../../../../../components/Field/Field.vue.js";
4
+ import _sfc_main$1 from "../../../../../components/Button/Button.vue.js";
5
5
  import { useRoute, useRouter } from "vue-router";
6
6
  import { state, actions as actions$1 } from "../../store/auth.js";
7
7
  import { actions } from "../../../../organizations/store/invites.js";
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- const Tab = require("../../../../../components/Tab/Tab.vue2.cjs");
5
- const Field = require("../../../../../components/Field/Field.vue2.cjs");
4
+ const Tab = require("../../../../../components/Tab/Tab.vue.cjs");
5
+ const Field = require("../../../../../components/Field/Field.vue.cjs");
6
6
  const FieldPhone = require("../../../../../components/FieldPhone/FieldPhone.vue.cjs");
7
- const Button = require("../../../../../components/Button/Button.vue2.cjs");
7
+ const Button = require("../../../../../components/Button/Button.vue.cjs");
8
8
  const vueRouter = require("vue-router");
9
9
  const vueI18n = require("vue-i18n");
10
10
  const ResetPassword = require("../../localization/ResetPassword.json.cjs");
@@ -1,8 +1,8 @@
1
1
  import { ref, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, createVNode, Transition, withCtx, createCommentVNode, createTextVNode } from "vue";
2
- import _sfc_main$1 from "../../../../../components/Tab/Tab.vue2.js";
3
- import Field from "../../../../../components/Field/Field.vue2.js";
2
+ import _sfc_main$1 from "../../../../../components/Tab/Tab.vue.js";
3
+ import Field from "../../../../../components/Field/Field.vue.js";
4
4
  import _sfc_main$2 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import _sfc_main$3 from "../../../../../components/Button/Button.vue2.js";
5
+ import _sfc_main$3 from "../../../../../components/Button/Button.vue.js";
6
6
  import { useRoute, useRouter } from "vue-router";
7
7
  import { useI18n } from "vue-i18n";
8
8
  import text from "../../localization/ResetPassword.json.js";
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- const Tab = require("../../../../../components/Tab/Tab.vue2.cjs");
5
- const Field = require("../../../../../components/Field/Field.vue2.cjs");
4
+ const Tab = require("../../../../../components/Tab/Tab.vue.cjs");
5
+ const Field = require("../../../../../components/Field/Field.vue.cjs");
6
6
  const FieldPhone = require("../../../../../components/FieldPhone/FieldPhone.vue.cjs");
7
- const Button = require("../../../../../components/Button/Button.vue2.cjs");
7
+ const Button = require("../../../../../components/Button/Button.vue.cjs");
8
8
  const vueRouter = require("vue-router");
9
9
  const vueI18n = require("vue-i18n");
10
10
  const SignIn = require("../../localization/SignIn.json.cjs");
@@ -1,8 +1,8 @@
1
1
  import { ref, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, unref, createVNode, withCtx, Transition, withDirectives, vShow } from "vue";
2
- import _sfc_main$1 from "../../../../../components/Tab/Tab.vue2.js";
3
- import Field from "../../../../../components/Field/Field.vue2.js";
2
+ import _sfc_main$1 from "../../../../../components/Tab/Tab.vue.js";
3
+ import Field from "../../../../../components/Field/Field.vue.js";
4
4
  import _sfc_main$2 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import _sfc_main$3 from "../../../../../components/Button/Button.vue2.js";
5
+ import _sfc_main$3 from "../../../../../components/Button/Button.vue.js";
6
6
  import { useRoute, useRouter } from "vue-router";
7
7
  import { useI18n } from "vue-i18n";
8
8
  import text from "../../localization/SignIn.json.js";
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
- const Tab = require("../../../../../components/Tab/Tab.vue2.cjs");
5
- const Field = require("../../../../../components/Field/Field.vue2.cjs");
4
+ const Tab = require("../../../../../components/Tab/Tab.vue.cjs");
5
+ const Field = require("../../../../../components/Field/Field.vue.cjs");
6
6
  const FieldPhone = require("../../../../../components/FieldPhone/FieldPhone.vue.cjs");
7
- const Button = require("../../../../../components/Button/Button.vue2.cjs");
7
+ const Button = require("../../../../../components/Button/Button.vue.cjs");
8
8
  const vueRouter = require("vue-router");
9
9
  const vueI18n = require("vue-i18n");
10
10
  const SignUp = require("../../localization/SignUp.json.cjs");
@@ -1,8 +1,8 @@
1
1
  import { ref, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, createVNode, Transition, withCtx, withDirectives, vShow, createTextVNode } from "vue";
2
- import _sfc_main$1 from "../../../../../components/Tab/Tab.vue2.js";
3
- import Field from "../../../../../components/Field/Field.vue2.js";
2
+ import _sfc_main$1 from "../../../../../components/Tab/Tab.vue.js";
3
+ import Field from "../../../../../components/Field/Field.vue.js";
4
4
  import _sfc_main$2 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import _sfc_main$3 from "../../../../../components/Button/Button.vue2.js";
5
+ import _sfc_main$3 from "../../../../../components/Button/Button.vue.js";
6
6
  import { useRoute, useRouter } from "vue-router";
7
7
  import { useI18n } from "vue-i18n";
8
8
  import text from "../../localization/SignUp.json.js";
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const auth = require("../store/auth.cjs");
4
+ const blogposts = require("../../../community/store/blogposts.cjs");
5
+ const mixins = require("../../../globals/views/mixins/mixins.cjs");
6
+ const { hasAccess } = mixins.useGlobalMixins();
7
+ async function requiresEditAccess(to, from, next) {
8
+ to.params.url;
9
+ const userId = auth.state.user._id;
10
+ try {
11
+ const post = (await blogposts.read({ url: to.params.url }))[0];
12
+ console.log("post is", post);
13
+ if (!post) {
14
+ return next("/404");
15
+ }
16
+ if (post.owner.type === "organization") {
17
+ const isAccess = hasAccess(post.owner.target._id, "posts", "edit", auth.state.accesses);
18
+ if (!isAccess) {
19
+ return next("/401");
20
+ }
21
+ } else {
22
+ if (post.creator.target._id !== userId) {
23
+ return next("/401");
24
+ }
25
+ }
26
+ next();
27
+ } catch (error) {
28
+ console.error("Error during post access check:", error);
29
+ return next("/500");
30
+ }
31
+ }
32
+ exports.requiresEditAccess = requiresEditAccess;
33
+ //# sourceMappingURL=ownership.validation.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ownership.validation.cjs","sources":["../../../../../../../src/modules/auth/views/middlewares/ownership.validation.js"],"sourcesContent":["import * as auth from '@pf/src/modules/auth/views/store/auth'\nimport * as blog from '@pf/src/modules/community/store/blogposts.js';\n\nimport { useGlobalMixins } from \"@pf/src/modules/globals/views/mixins/mixins.js\"\n\nconst { hasAccess } = useGlobalMixins()\n\nasync function requiresEditAccess(to, from, next) {\n const postId = to.params.url; // Предполагается, что `url` является идентификатором поста\n const userId = auth.state.user._id; // Получаем текущего пользователя\n\n try {\n // Получаем данные поста, чтобы проверить его принадлежность к организации или авторство\n const post = (await blog.read({ url: to.params.url }))[0];\n\n console.log('post is', post)\n\n if (!post) {\n return next('/404'); // Если пост не найден, перенаправляем на страницу 404\n }\n\n if (post.owner.type === 'organization') {\n // Если пост принадлежит организации, проверяем права на редактирование через `hasAccess`\n const isAccess = hasAccess(post.owner.target._id, 'posts', 'edit', auth.state.accesses);\n\n if (!isAccess) {\n return next('/401'); // Если у пользователя нет прав на редактирование в организации, перенаправляем на 403\n }\n } else {\n // Если пост не принадлежит организации, проверяем авторство\n if (post.creator.target._id !== userId) {\n return next('/401'); // Если пользователь не является автором, перенаправляем на 403\n }\n }\n\n next(); // Если все проверки прошли, продолжаем\n } catch (error) {\n console.error(\"Error during post access check:\", error);\n return next('/500'); // Если произошла ошибка, перенаправляем на страницу 500\n }\n}\n\nexport {\n requiresEditAccess\n}"],"names":["useGlobalMixins","auth.state","blog.read"],"mappings":";;;;;AAKA,MAAM,EAAE,UAAW,IAAGA,uBAAiB;AAEvC,eAAe,mBAAmB,IAAI,MAAM,MAAM;AACjC,KAAG,OAAO;AACzB,QAAM,SAASC,KAAAA,MAAW,KAAK;AAE/B,MAAI;AAEF,UAAM,QAAQ,MAAMC,UAAS,KAAC,EAAE,KAAK,GAAG,OAAO,IAAG,CAAE,GAAG,CAAC;AAExD,YAAQ,IAAI,WAAW,IAAI;AAE3B,QAAI,CAAC,MAAM;AACT,aAAO,KAAK,MAAM;AAAA,IACnB;AAED,QAAI,KAAK,MAAM,SAAS,gBAAgB;AAEtC,YAAM,WAAW,UAAU,KAAK,MAAM,OAAO,KAAK,SAAS,QAAQD,KAAU,MAAC,QAAQ;AAEtF,UAAI,CAAC,UAAU;AACb,eAAO,KAAK,MAAM;AAAA,MACnB;AAAA,IACP,OAAW;AAEL,UAAI,KAAK,QAAQ,OAAO,QAAQ,QAAQ;AACtC,eAAO,KAAK,MAAM;AAAA,MACnB;AAAA,IACF;AAED;EACD,SAAQ,OAAO;AACd,YAAQ,MAAM,mCAAmC,KAAK;AACtD,WAAO,KAAK,MAAM;AAAA,EACnB;AACH;;"}
@@ -0,0 +1,33 @@
1
+ import { state } from "../store/auth.js";
2
+ import { read } from "../../../community/store/blogposts.js";
3
+ import { useGlobalMixins } from "../../../globals/views/mixins/mixins.js";
4
+ const { hasAccess } = useGlobalMixins();
5
+ async function requiresEditAccess(to, from, next) {
6
+ to.params.url;
7
+ const userId = state.user._id;
8
+ try {
9
+ const post = (await read({ url: to.params.url }))[0];
10
+ console.log("post is", post);
11
+ if (!post) {
12
+ return next("/404");
13
+ }
14
+ if (post.owner.type === "organization") {
15
+ const isAccess = hasAccess(post.owner.target._id, "posts", "edit", state.accesses);
16
+ if (!isAccess) {
17
+ return next("/401");
18
+ }
19
+ } else {
20
+ if (post.creator.target._id !== userId) {
21
+ return next("/401");
22
+ }
23
+ }
24
+ next();
25
+ } catch (error) {
26
+ console.error("Error during post access check:", error);
27
+ return next("/500");
28
+ }
29
+ }
30
+ export {
31
+ requiresEditAccess
32
+ };
33
+ //# sourceMappingURL=ownership.validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ownership.validation.js","sources":["../../../../../../../src/modules/auth/views/middlewares/ownership.validation.js"],"sourcesContent":["import * as auth from '@pf/src/modules/auth/views/store/auth'\nimport * as blog from '@pf/src/modules/community/store/blogposts.js';\n\nimport { useGlobalMixins } from \"@pf/src/modules/globals/views/mixins/mixins.js\"\n\nconst { hasAccess } = useGlobalMixins()\n\nasync function requiresEditAccess(to, from, next) {\n const postId = to.params.url; // Предполагается, что `url` является идентификатором поста\n const userId = auth.state.user._id; // Получаем текущего пользователя\n\n try {\n // Получаем данные поста, чтобы проверить его принадлежность к организации или авторство\n const post = (await blog.read({ url: to.params.url }))[0];\n\n console.log('post is', post)\n\n if (!post) {\n return next('/404'); // Если пост не найден, перенаправляем на страницу 404\n }\n\n if (post.owner.type === 'organization') {\n // Если пост принадлежит организации, проверяем права на редактирование через `hasAccess`\n const isAccess = hasAccess(post.owner.target._id, 'posts', 'edit', auth.state.accesses);\n\n if (!isAccess) {\n return next('/401'); // Если у пользователя нет прав на редактирование в организации, перенаправляем на 403\n }\n } else {\n // Если пост не принадлежит организации, проверяем авторство\n if (post.creator.target._id !== userId) {\n return next('/401'); // Если пользователь не является автором, перенаправляем на 403\n }\n }\n\n next(); // Если все проверки прошли, продолжаем\n } catch (error) {\n console.error(\"Error during post access check:\", error);\n return next('/500'); // Если произошла ошибка, перенаправляем на страницу 500\n }\n}\n\nexport {\n requiresEditAccess\n}"],"names":["auth.state","blog.read"],"mappings":";;;AAKA,MAAM,EAAE,UAAW,IAAG,gBAAiB;AAEvC,eAAe,mBAAmB,IAAI,MAAM,MAAM;AACjC,KAAG,OAAO;AACzB,QAAM,SAASA,MAAW,KAAK;AAE/B,MAAI;AAEF,UAAM,QAAQ,MAAMC,KAAU,EAAE,KAAK,GAAG,OAAO,IAAG,CAAE,GAAG,CAAC;AAExD,YAAQ,IAAI,WAAW,IAAI;AAE3B,QAAI,CAAC,MAAM;AACT,aAAO,KAAK,MAAM;AAAA,IACnB;AAED,QAAI,KAAK,MAAM,SAAS,gBAAgB;AAEtC,YAAM,WAAW,UAAU,KAAK,MAAM,OAAO,KAAK,SAAS,QAAQD,MAAW,QAAQ;AAEtF,UAAI,CAAC,UAAU;AACb,eAAO,KAAK,MAAM;AAAA,MACnB;AAAA,IACP,OAAW;AAEL,UAAI,KAAK,QAAQ,OAAO,QAAQ,QAAQ;AACtC,eAAO,KAAK,MAAM;AAAA,MACnB;AAAA,IACF;AAED;EACD,SAAQ,OAAO;AACd,YAAQ,MAAM,mCAAmC,KAAK;AACtD,WAAO,KAAK,MAAM;AAAA,EACnB;AACH;"}
@@ -62,7 +62,9 @@ const _sfc_main = {
62
62
  return props.blogpost.content.find((block) => block.type === "Video");
63
63
  });
64
64
  const firstText = vue.computed(() => {
65
- return props.blogpost.content.find((block) => block.type === "Textarea");
65
+ return props.blogpost.content.find(
66
+ (block) => block.type === "Textarea" && block.class !== "h2"
67
+ );
66
68
  });
67
69
  return (_ctx, _cache) => {
68
70
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"CardBlogpost.vue.cjs","sources":["../../../../../../../src/modules/community/components/blocks/CardBlogpost.vue"],"sourcesContent":["<template>\n\t<article \n\t\tclass=\"pos-relative bg-light radius-big flex-column flex\"\n\t>\n\t\t<CardHeader \n\t :class=\"{\n\t \t'mn-b-small pd-medium': type !== 'short',\n\t \t'flex-child-order-last flex-child mn-l-small': type === 'short',\n\t }\"\n\t :entity=\"blogpost\"\n\t :entityType=\"'blogpost'\"\n\t :user=\"user\"\n\t :owner=\"blogpost.owner\" \n \t:creator=\"blogpost.creator\"\n \t:date=\"blogpost.createdAt\"\n \t:actions=\"user && user === blogpost.creator.target._id ? [\n { to: { name: 'Edit BlogPost', params: {url: blogpost.url } }, label: 'Edit' }\n ]: null\"\n\t\t/>\n\n\t\n\t\t<section\n\t\t\tclass=\"pd-t-zero pd-b-zero pd-medium\"\n\t\t>\n\t\t\t\n\t\t\t<div v-if=\"type !== 'blogpostPage'\" class=\"cursor-pointer mn-b-thin flex-nowrap flex w-100\">\n\n\t\t\t\t<Text \n\t\t\t\t\tv-if=\"!hideTitle\"\n\t\t\t\t \t:text=\"blogpost.name || ''\" \n\t\t\t\t \t:maxLen=\"80\" \n\t\t\t\t \tclass=\"h3 d-block\"\n\t\t\t\t \t@click=\"router.push({\n\t\t\t\t\t\tname: 'BlogPost', \n\t\t\t\t\t\tparams: { \n\t\t\t\t\t\t\turl: blogpost.url \n\t\t\t\t\t\t}\n\t\t\t\t\t})\"\n\t\t\t\t/>\n\n\t\t\t\t<div \n\t\t\t\t\tv-if=\"blogpost.status === 'draft'\" \n\t\t\t\t\tclass=\"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra\"\n\t\t\t\t>\n\t\t\t\t\t{{blogpost.status}}\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t</div>\n\t\t\t\n\t\t\t<p \n\t\t\t\tv-if=\"firstText && firstText.content && type !== 'blogpostPage' && !hideDescription\" \n\t\t\t\tclass='mn-b-small t-transp p-big'\n\t\t\t>\n\t\t\t\t{{firstText.content.slice(0,120)}}...\n\t\t\t</p>\n\n\t\t\t<h3 \n\t\t\t\tv-if=\"type === 'blogpostPage' && !hideTitle\" \n\t\t\t\tclass=\"mn-b-small h2\"\n\t\t\t>\n\t\t\t\t{{blogpost.name}}\n\t\t\t</h3>\n\n\t\t\t<slot></slot>\n\n\t\t\t<!-- <Chips \n \tv-if=\"type !== 'short' && blogpost.tags?.length > 0\" \n \t:chips=\"blogpost.tags\"\n \t/> -->\n\n\t\t</section>\n\n\t\t\t<!-- <Image :prop=\"{content:firstImage.content}\" class=\"h-100\"/> -->\n\n\t\t<template\n\t\t\tv-if=\"firstImage && firstImage.content && type !== 'blogpostPage'\"\n\t\t>\n\t\t\t<img loading=\"lazy\" \n\t\t\t\t:src=\"(FILE_SERVER_URL || '') + firstImage.content\" \n\t\t\t\talt=\"Blog post image\" \n\t\t\t\tclass=\"mn-b-medium object-fit-cover w-100 h-min-10r h-100\"\n\t\t\t/>\n\t\t</template>\n\n\t\t<template\n\t\t\tv-if=\"!firstImage?.content && firstVideo && firstVideo.content && type !== 'blogpostPage'\"\n\t\t>\n\t\t\t<!-- <div class=\"flex-center flex\"> -->\n\t <video controls class=\"mn-b-medium object-fit-cover w-100 h-max-20r\">\n\t <source :src=\"firstVideo.content\" type=\"video/mp4\">\n\t Your browser does not support the video tag.\n\t </video>\n\t <!-- </div> -->\n\t\t</template>\n\n\t\t\n\t\t<FooterBlogpost \n\t\t\tclass=\"pd-t-zero pd-medium\" \n\t\t\t:blogpost=\"blogpost\" :user=\"user\"\n\t\t/>\n\t\n\t</article>\n\n</template>\n\n\n<script setup=\"props\">\n\timport CardHeader from '@pf/src/modules/globals/views/components/blocks/CardHeader.vue'\n\timport FooterBlogpost from '@pf/src/modules/community/components/blocks/FooterBlogpost.vue'\t\n\n\timport Image from '@pf/src/modules/constructor/components/elements/Image.vue';\n\n import Text from '@pf/src/components/Text/Text.vue'\n\timport Chips from '@pf/src/components/Chips/Chips.vue'\n\n\timport IconEdit from '@pf/src/modules/icons/navigation/IconEdit.vue'\n\n\timport { computed } from 'vue'\n\n\timport { useRouter } from 'vue-router'\n\n\tconst router = useRouter()\n\n\tconst props = defineProps({\n\t\tblogpost: {\n\t\t\ttype: Object,\n\t\t},\n\t\tuser: {\n\t\t\ttype: String,\n\t\t},\n\t\ttype: {\n\t\t\ttype: String,\n\t\t},\n\t\thideDescription: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t},\n\t\thideTitle: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t}\n\t})\n\n const firstImage = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'ImageUpload');\n\t});\n\n\tconst firstVideo = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'Video');\n\t});\n\n\tconst firstText = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'Textarea');\n\t});\n\n</script>\n\n<style lang=\"scss\">\n</style>\n\n\n"],"names":["useRouter","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHC,UAAM,SAASA,UAAAA,UAAW;AAE1B,UAAM,QAAQ;AAoBb,UAAM,aAAaC,IAAAA,SAAS,MAAM;AACjC,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,aAAa;AAAA,IAC3E,CAAE;AAED,UAAM,aAAaA,IAAAA,SAAS,MAAM;AAChC,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,OAAO;AAAA,IACrE,CAAE;AAED,UAAM,YAAYA,IAAAA,SAAS,MAAM;AAC/B,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,UAAU;AAAA,IACxE,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CardBlogpost.vue.cjs","sources":["../../../../../../../src/modules/community/components/blocks/CardBlogpost.vue"],"sourcesContent":["<template>\n\t<article \n\t\tclass=\"pos-relative bg-light radius-big flex-column flex\"\n\t>\n\t\t<CardHeader \n\t :class=\"{\n\t \t'mn-b-small pd-medium': type !== 'short',\n\t \t'flex-child-order-last flex-child mn-l-small': type === 'short',\n\t }\"\n\t :entity=\"blogpost\"\n\t :entityType=\"'blogpost'\"\n\t :user=\"user\"\n\t :owner=\"blogpost.owner\" \n \t:creator=\"blogpost.creator\"\n \t:date=\"blogpost.createdAt\"\n \t:actions=\"user && user === blogpost.creator.target._id ? [\n { to: { name: 'Edit BlogPost', params: {url: blogpost.url } }, label: 'Edit' }\n ]: null\"\n\t\t/>\n\n\t\n\t\t<section\n\t\t\tclass=\"pd-t-zero pd-b-zero pd-medium\"\n\t\t>\n\t\t\t\n\t\t\t<div v-if=\"type !== 'blogpostPage'\" class=\"cursor-pointer mn-b-thin flex-nowrap flex w-100\">\n\n\t\t\t\t<Text \n\t\t\t\t\tv-if=\"!hideTitle\"\n\t\t\t\t \t:text=\"blogpost.name || ''\" \n\t\t\t\t \t:maxLen=\"80\" \n\t\t\t\t \tclass=\"h3 d-block\"\n\t\t\t\t \t@click=\"router.push({\n\t\t\t\t\t\tname: 'BlogPost', \n\t\t\t\t\t\tparams: { \n\t\t\t\t\t\t\turl: blogpost.url \n\t\t\t\t\t\t}\n\t\t\t\t\t})\"\n\t\t\t\t/>\n\n\t\t\t\t<div \n\t\t\t\t\tv-if=\"blogpost.status === 'draft'\" \n\t\t\t\t\tclass=\"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra\"\n\t\t\t\t>\n\t\t\t\t\t{{blogpost.status}}\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t</div>\n\t\t\t\n\t\t\t<p \n\t\t\t\tv-if=\"firstText && firstText.content && type !== 'blogpostPage' && !hideDescription\" \n\t\t\t\tclass='mn-b-small t-transp p-big'\n\t\t\t>\n\t\t\t\t{{firstText.content.slice(0,120)}}...\n\t\t\t</p>\n\n\t\t\t<h3 \n\t\t\t\tv-if=\"type === 'blogpostPage' && !hideTitle\" \n\t\t\t\tclass=\"mn-b-small h2\"\n\t\t\t>\n\t\t\t\t{{blogpost.name}}\n\t\t\t</h3>\n\n\t\t\t<slot></slot>\n\n\t\t\t<!-- <Chips \n \tv-if=\"type !== 'short' && blogpost.tags?.length > 0\" \n \t:chips=\"blogpost.tags\"\n \t/> -->\n\n\t\t</section>\n\n\t\t\t<!-- <Image :prop=\"{content:firstImage.content}\" class=\"h-100\"/> -->\n\n\t\t<template\n\t\t\tv-if=\"firstImage && firstImage.content && type !== 'blogpostPage'\"\n\t\t>\n\t\t\t<img loading=\"lazy\" \n\t\t\t\t:src=\"(FILE_SERVER_URL || '') + firstImage.content\" \n\t\t\t\talt=\"Blog post image\" \n\t\t\t\tclass=\"mn-b-medium object-fit-cover w-100 h-min-10r h-100\"\n\t\t\t/>\n\t\t</template>\n\n\t\t<template\n\t\t\tv-if=\"!firstImage?.content && firstVideo && firstVideo.content && type !== 'blogpostPage'\"\n\t\t>\n\t\t\t<!-- <div class=\"flex-center flex\"> -->\n\t <video controls class=\"mn-b-medium object-fit-cover w-100 h-max-20r\">\n\t <source :src=\"firstVideo.content\" type=\"video/mp4\">\n\t Your browser does not support the video tag.\n\t </video>\n\t <!-- </div> -->\n\t\t</template>\n\n\t\t\n\t\t<FooterBlogpost \n\t\t\tclass=\"pd-t-zero pd-medium\" \n\t\t\t:blogpost=\"blogpost\" :user=\"user\"\n\t\t/>\n\t\n\t</article>\n\n</template>\n\n\n<script setup=\"props\">\n\timport CardHeader from '@pf/src/modules/globals/views/components/blocks/CardHeader.vue'\n\timport FooterBlogpost from '@pf/src/modules/community/components/blocks/FooterBlogpost.vue'\t\n\n\timport Image from '@pf/src/modules/constructor/components/elements/Image.vue';\n\n import Text from '@pf/src/components/Text/Text.vue'\n\timport Chips from '@pf/src/components/Chips/Chips.vue'\n\n\timport IconEdit from '@pf/src/modules/icons/navigation/IconEdit.vue'\n\n\timport { computed } from 'vue'\n\n\timport { useRouter } from 'vue-router'\n\n\tconst router = useRouter()\n\n\tconst props = defineProps({\n\t\tblogpost: {\n\t\t\ttype: Object,\n\t\t},\n\t\tuser: {\n\t\t\ttype: String,\n\t\t},\n\t\ttype: {\n\t\t\ttype: String,\n\t\t},\n\t\thideDescription: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t},\n\t\thideTitle: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t}\n\t})\n\n const firstImage = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'ImageUpload');\n\t});\n\n\tconst firstVideo = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'Video');\n\t});\n\n\tconst firstText = computed(() => {\n\t return props.blogpost.content.find(block => \n\t block.type === 'Textarea' && block.class !== 'h2'\n\t );\n\t});\n\n</script>\n\n<style lang=\"scss\">\n</style>\n\n\n"],"names":["useRouter","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHC,UAAM,SAASA,UAAAA,UAAW;AAE1B,UAAM,QAAQ;AAoBb,UAAM,aAAaC,IAAAA,SAAS,MAAM;AACjC,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,aAAa;AAAA,IAC3E,CAAE;AAED,UAAM,aAAaA,IAAAA,SAAS,MAAM;AAChC,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,OAAO;AAAA,IACrE,CAAE;AAED,UAAM,YAAYA,IAAAA,SAAS,MAAM;AAC/B,aAAO,MAAM,SAAS,QAAQ;AAAA,QAAK,WACjC,MAAM,SAAS,cAAc,MAAM,UAAU;AAAA,MAClD;AAAA,IACA,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -60,7 +60,9 @@ const _sfc_main = {
60
60
  return props.blogpost.content.find((block) => block.type === "Video");
61
61
  });
62
62
  const firstText = computed(() => {
63
- return props.blogpost.content.find((block) => block.type === "Textarea");
63
+ return props.blogpost.content.find(
64
+ (block) => block.type === "Textarea" && block.class !== "h2"
65
+ );
64
66
  });
65
67
  return (_ctx, _cache) => {
66
68
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"CardBlogpost.vue.js","sources":["../../../../../../../src/modules/community/components/blocks/CardBlogpost.vue"],"sourcesContent":["<template>\n\t<article \n\t\tclass=\"pos-relative bg-light radius-big flex-column flex\"\n\t>\n\t\t<CardHeader \n\t :class=\"{\n\t \t'mn-b-small pd-medium': type !== 'short',\n\t \t'flex-child-order-last flex-child mn-l-small': type === 'short',\n\t }\"\n\t :entity=\"blogpost\"\n\t :entityType=\"'blogpost'\"\n\t :user=\"user\"\n\t :owner=\"blogpost.owner\" \n \t:creator=\"blogpost.creator\"\n \t:date=\"blogpost.createdAt\"\n \t:actions=\"user && user === blogpost.creator.target._id ? [\n { to: { name: 'Edit BlogPost', params: {url: blogpost.url } }, label: 'Edit' }\n ]: null\"\n\t\t/>\n\n\t\n\t\t<section\n\t\t\tclass=\"pd-t-zero pd-b-zero pd-medium\"\n\t\t>\n\t\t\t\n\t\t\t<div v-if=\"type !== 'blogpostPage'\" class=\"cursor-pointer mn-b-thin flex-nowrap flex w-100\">\n\n\t\t\t\t<Text \n\t\t\t\t\tv-if=\"!hideTitle\"\n\t\t\t\t \t:text=\"blogpost.name || ''\" \n\t\t\t\t \t:maxLen=\"80\" \n\t\t\t\t \tclass=\"h3 d-block\"\n\t\t\t\t \t@click=\"router.push({\n\t\t\t\t\t\tname: 'BlogPost', \n\t\t\t\t\t\tparams: { \n\t\t\t\t\t\t\turl: blogpost.url \n\t\t\t\t\t\t}\n\t\t\t\t\t})\"\n\t\t\t\t/>\n\n\t\t\t\t<div \n\t\t\t\t\tv-if=\"blogpost.status === 'draft'\" \n\t\t\t\t\tclass=\"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra\"\n\t\t\t\t>\n\t\t\t\t\t{{blogpost.status}}\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t</div>\n\t\t\t\n\t\t\t<p \n\t\t\t\tv-if=\"firstText && firstText.content && type !== 'blogpostPage' && !hideDescription\" \n\t\t\t\tclass='mn-b-small t-transp p-big'\n\t\t\t>\n\t\t\t\t{{firstText.content.slice(0,120)}}...\n\t\t\t</p>\n\n\t\t\t<h3 \n\t\t\t\tv-if=\"type === 'blogpostPage' && !hideTitle\" \n\t\t\t\tclass=\"mn-b-small h2\"\n\t\t\t>\n\t\t\t\t{{blogpost.name}}\n\t\t\t</h3>\n\n\t\t\t<slot></slot>\n\n\t\t\t<!-- <Chips \n \tv-if=\"type !== 'short' && blogpost.tags?.length > 0\" \n \t:chips=\"blogpost.tags\"\n \t/> -->\n\n\t\t</section>\n\n\t\t\t<!-- <Image :prop=\"{content:firstImage.content}\" class=\"h-100\"/> -->\n\n\t\t<template\n\t\t\tv-if=\"firstImage && firstImage.content && type !== 'blogpostPage'\"\n\t\t>\n\t\t\t<img loading=\"lazy\" \n\t\t\t\t:src=\"(FILE_SERVER_URL || '') + firstImage.content\" \n\t\t\t\talt=\"Blog post image\" \n\t\t\t\tclass=\"mn-b-medium object-fit-cover w-100 h-min-10r h-100\"\n\t\t\t/>\n\t\t</template>\n\n\t\t<template\n\t\t\tv-if=\"!firstImage?.content && firstVideo && firstVideo.content && type !== 'blogpostPage'\"\n\t\t>\n\t\t\t<!-- <div class=\"flex-center flex\"> -->\n\t <video controls class=\"mn-b-medium object-fit-cover w-100 h-max-20r\">\n\t <source :src=\"firstVideo.content\" type=\"video/mp4\">\n\t Your browser does not support the video tag.\n\t </video>\n\t <!-- </div> -->\n\t\t</template>\n\n\t\t\n\t\t<FooterBlogpost \n\t\t\tclass=\"pd-t-zero pd-medium\" \n\t\t\t:blogpost=\"blogpost\" :user=\"user\"\n\t\t/>\n\t\n\t</article>\n\n</template>\n\n\n<script setup=\"props\">\n\timport CardHeader from '@pf/src/modules/globals/views/components/blocks/CardHeader.vue'\n\timport FooterBlogpost from '@pf/src/modules/community/components/blocks/FooterBlogpost.vue'\t\n\n\timport Image from '@pf/src/modules/constructor/components/elements/Image.vue';\n\n import Text from '@pf/src/components/Text/Text.vue'\n\timport Chips from '@pf/src/components/Chips/Chips.vue'\n\n\timport IconEdit from '@pf/src/modules/icons/navigation/IconEdit.vue'\n\n\timport { computed } from 'vue'\n\n\timport { useRouter } from 'vue-router'\n\n\tconst router = useRouter()\n\n\tconst props = defineProps({\n\t\tblogpost: {\n\t\t\ttype: Object,\n\t\t},\n\t\tuser: {\n\t\t\ttype: String,\n\t\t},\n\t\ttype: {\n\t\t\ttype: String,\n\t\t},\n\t\thideDescription: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t},\n\t\thideTitle: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t}\n\t})\n\n const firstImage = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'ImageUpload');\n\t});\n\n\tconst firstVideo = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'Video');\n\t});\n\n\tconst firstText = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'Textarea');\n\t});\n\n</script>\n\n<style lang=\"scss\">\n</style>\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHC,UAAM,SAAS,UAAW;AAE1B,UAAM,QAAQ;AAoBb,UAAM,aAAa,SAAS,MAAM;AACjC,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,aAAa;AAAA,IAC3E,CAAE;AAED,UAAM,aAAa,SAAS,MAAM;AAChC,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,OAAO;AAAA,IACrE,CAAE;AAED,UAAM,YAAY,SAAS,MAAM;AAC/B,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,UAAU;AAAA,IACxE,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CardBlogpost.vue.js","sources":["../../../../../../../src/modules/community/components/blocks/CardBlogpost.vue"],"sourcesContent":["<template>\n\t<article \n\t\tclass=\"pos-relative bg-light radius-big flex-column flex\"\n\t>\n\t\t<CardHeader \n\t :class=\"{\n\t \t'mn-b-small pd-medium': type !== 'short',\n\t \t'flex-child-order-last flex-child mn-l-small': type === 'short',\n\t }\"\n\t :entity=\"blogpost\"\n\t :entityType=\"'blogpost'\"\n\t :user=\"user\"\n\t :owner=\"blogpost.owner\" \n \t:creator=\"blogpost.creator\"\n \t:date=\"blogpost.createdAt\"\n \t:actions=\"user && user === blogpost.creator.target._id ? [\n { to: { name: 'Edit BlogPost', params: {url: blogpost.url } }, label: 'Edit' }\n ]: null\"\n\t\t/>\n\n\t\n\t\t<section\n\t\t\tclass=\"pd-t-zero pd-b-zero pd-medium\"\n\t\t>\n\t\t\t\n\t\t\t<div v-if=\"type !== 'blogpostPage'\" class=\"cursor-pointer mn-b-thin flex-nowrap flex w-100\">\n\n\t\t\t\t<Text \n\t\t\t\t\tv-if=\"!hideTitle\"\n\t\t\t\t \t:text=\"blogpost.name || ''\" \n\t\t\t\t \t:maxLen=\"80\" \n\t\t\t\t \tclass=\"h3 d-block\"\n\t\t\t\t \t@click=\"router.push({\n\t\t\t\t\t\tname: 'BlogPost', \n\t\t\t\t\t\tparams: { \n\t\t\t\t\t\t\turl: blogpost.url \n\t\t\t\t\t\t}\n\t\t\t\t\t})\"\n\t\t\t\t/>\n\n\t\t\t\t<div \n\t\t\t\t\tv-if=\"blogpost.status === 'draft'\" \n\t\t\t\t\tclass=\"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra\"\n\t\t\t\t>\n\t\t\t\t\t{{blogpost.status}}\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t</div>\n\t\t\t\n\t\t\t<p \n\t\t\t\tv-if=\"firstText && firstText.content && type !== 'blogpostPage' && !hideDescription\" \n\t\t\t\tclass='mn-b-small t-transp p-big'\n\t\t\t>\n\t\t\t\t{{firstText.content.slice(0,120)}}...\n\t\t\t</p>\n\n\t\t\t<h3 \n\t\t\t\tv-if=\"type === 'blogpostPage' && !hideTitle\" \n\t\t\t\tclass=\"mn-b-small h2\"\n\t\t\t>\n\t\t\t\t{{blogpost.name}}\n\t\t\t</h3>\n\n\t\t\t<slot></slot>\n\n\t\t\t<!-- <Chips \n \tv-if=\"type !== 'short' && blogpost.tags?.length > 0\" \n \t:chips=\"blogpost.tags\"\n \t/> -->\n\n\t\t</section>\n\n\t\t\t<!-- <Image :prop=\"{content:firstImage.content}\" class=\"h-100\"/> -->\n\n\t\t<template\n\t\t\tv-if=\"firstImage && firstImage.content && type !== 'blogpostPage'\"\n\t\t>\n\t\t\t<img loading=\"lazy\" \n\t\t\t\t:src=\"(FILE_SERVER_URL || '') + firstImage.content\" \n\t\t\t\talt=\"Blog post image\" \n\t\t\t\tclass=\"mn-b-medium object-fit-cover w-100 h-min-10r h-100\"\n\t\t\t/>\n\t\t</template>\n\n\t\t<template\n\t\t\tv-if=\"!firstImage?.content && firstVideo && firstVideo.content && type !== 'blogpostPage'\"\n\t\t>\n\t\t\t<!-- <div class=\"flex-center flex\"> -->\n\t <video controls class=\"mn-b-medium object-fit-cover w-100 h-max-20r\">\n\t <source :src=\"firstVideo.content\" type=\"video/mp4\">\n\t Your browser does not support the video tag.\n\t </video>\n\t <!-- </div> -->\n\t\t</template>\n\n\t\t\n\t\t<FooterBlogpost \n\t\t\tclass=\"pd-t-zero pd-medium\" \n\t\t\t:blogpost=\"blogpost\" :user=\"user\"\n\t\t/>\n\t\n\t</article>\n\n</template>\n\n\n<script setup=\"props\">\n\timport CardHeader from '@pf/src/modules/globals/views/components/blocks/CardHeader.vue'\n\timport FooterBlogpost from '@pf/src/modules/community/components/blocks/FooterBlogpost.vue'\t\n\n\timport Image from '@pf/src/modules/constructor/components/elements/Image.vue';\n\n import Text from '@pf/src/components/Text/Text.vue'\n\timport Chips from '@pf/src/components/Chips/Chips.vue'\n\n\timport IconEdit from '@pf/src/modules/icons/navigation/IconEdit.vue'\n\n\timport { computed } from 'vue'\n\n\timport { useRouter } from 'vue-router'\n\n\tconst router = useRouter()\n\n\tconst props = defineProps({\n\t\tblogpost: {\n\t\t\ttype: Object,\n\t\t},\n\t\tuser: {\n\t\t\ttype: String,\n\t\t},\n\t\ttype: {\n\t\t\ttype: String,\n\t\t},\n\t\thideDescription: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t},\n\t\thideTitle: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t}\n\t})\n\n const firstImage = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'ImageUpload');\n\t});\n\n\tconst firstVideo = computed(() => {\n\t return props.blogpost.content.find(block => block.type === 'Video');\n\t});\n\n\tconst firstText = computed(() => {\n\t return props.blogpost.content.find(block => \n\t block.type === 'Textarea' && block.class !== 'h2'\n\t );\n\t});\n\n</script>\n\n<style lang=\"scss\">\n</style>\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHC,UAAM,SAAS,UAAW;AAE1B,UAAM,QAAQ;AAoBb,UAAM,aAAa,SAAS,MAAM;AACjC,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,aAAa;AAAA,IAC3E,CAAE;AAED,UAAM,aAAa,SAAS,MAAM;AAChC,aAAO,MAAM,SAAS,QAAQ,KAAK,WAAS,MAAM,SAAS,OAAO;AAAA,IACrE,CAAE;AAED,UAAM,YAAY,SAAS,MAAM;AAC/B,aAAO,MAAM,SAAS,QAAQ;AAAA,QAAK,WACjC,MAAM,SAAS,cAAc,MAAM,UAAU;AAAA,MAClD;AAAA,IACA,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}