@ozdao/prometheus-framework 0.0.94 → 0.0.96
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-6f807eb5.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-97217d38.mjs +1945 -0
- package/dist/ButtonFollow-4049a57e.js +1 -0
- package/dist/ButtonFollow-6765c266.mjs +131 -0
- package/dist/CardOrganization-1b0da77c.mjs +230 -0
- package/dist/CardOrganization-43e80590.js +1 -0
- package/dist/CardOrganization-b2098e42.js +1 -0
- package/dist/CardOrganization-c2e7e903.mjs +229 -0
- package/dist/Chips-4316f652.mjs +110 -0
- package/dist/Chips-92ccc11f.js +1 -0
- package/dist/Feed-13499a3a.mjs +428 -0
- package/dist/Feed-345d8513.mjs +355 -0
- package/dist/Feed-361761f5.mjs +366 -0
- package/dist/Feed-8acc6844.js +1 -0
- package/dist/Feed-8f6eb29d.mjs +439 -0
- package/dist/Feed-c6b67df4.js +1 -0
- package/dist/Feed-c8dc4359.js +1 -0
- package/dist/Feed-f0a40b33.js +1 -0
- package/dist/IconEdit-4cfe2115.js +1 -0
- package/dist/IconEdit-eacf3856.mjs +44 -0
- package/dist/Image-661e2fbc.mjs +477 -0
- package/dist/Image-b2131fa0.mjs +477 -0
- package/dist/Image-d01026cf.js +9 -0
- package/dist/Image-f66dbbf4.js +9 -0
- package/dist/Popup-0b38b537.js +1 -0
- package/dist/Popup-e6685f31.mjs +76 -0
- package/dist/Product-3c2ae338.js +7 -0
- package/dist/Product-601a9d5b.mjs +838 -0
- package/dist/Product-dccb371a.mjs +838 -0
- package/dist/Product-f017e6cd.js +7 -0
- package/dist/ProductEdit-777bb9e2.mjs +350 -0
- package/dist/ProductEdit-d5dec3cf.js +1 -0
- package/dist/ProductEdit-dae66a53.js +1 -0
- package/dist/ProductEdit-fa0117b6.mjs +350 -0
- package/dist/ProfileBlogposts-39c20b79.mjs +64 -0
- package/dist/ProfileBlogposts-69beaa14.js +1 -0
- package/dist/ProfileBlogposts-6c715a38.js +1 -0
- package/dist/ProfileBlogposts-92c4addb.mjs +64 -0
- package/dist/ProfileComments-1525663e.mjs +44 -0
- package/dist/ProfileComments-1cbf5c45.js +1 -0
- package/dist/ProfileComments-bae499e9.js +1 -0
- package/dist/ProfileComments-cdaccefe.mjs +44 -0
- package/dist/ProfileEvents-3089a526.mjs +56 -0
- package/dist/ProfileEvents-48c70286.mjs +56 -0
- package/dist/ProfileEvents-a28a4ee5.js +1 -0
- package/dist/ProfileEvents-e62e76cf.js +1 -0
- package/dist/ProfileLikes-6cf19687.js +1 -0
- package/dist/ProfileLikes-75215d15.mjs +44 -0
- package/dist/ProfileLikes-ca197731.mjs +44 -0
- package/dist/ProfileLikes-e31f28dc.js +1 -0
- package/dist/ProfileOrganizations-55914b43.js +1 -0
- package/dist/ProfileOrganizations-600d310d.js +1 -0
- package/dist/ProfileOrganizations-774c6508.mjs +212 -0
- package/dist/ProfileOrganizations-ec908108.mjs +212 -0
- package/dist/Publics-4db36606.js +1 -0
- package/dist/Publics-6b7c97bd.js +1 -0
- package/dist/Publics-abbe2e0c.mjs +123 -0
- package/dist/Publics-cbb8eaaa.mjs +123 -0
- package/dist/Socials-8193477c.mjs +189 -0
- package/dist/Socials-821bd677.js +1 -0
- package/dist/UploadImage-1b4c2a5e.mjs +83 -0
- package/dist/UploadImage-39d42048.js +1 -0
- package/dist/UploadImage-739cab04.js +1 -0
- package/dist/UploadImage-8835be69.mjs +83 -0
- package/dist/auth-b61483ce.js +8 -0
- package/dist/auth-cfeacd61.mjs +1839 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +3 -3
- package/dist/auth.validation-2f00457e.js +1 -0
- package/dist/auth.validation-3fd4cc7c.mjs +20 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +12 -12
- package/dist/components/Text/Text.vue.d.ts +1 -0
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +12 -12
- package/dist/landing.client.cjs +1 -1
- package/dist/landing.client.js +38 -38
- package/dist/main.css +1 -1
- package/dist/organizations-49a10611.js +1 -0
- package/dist/organizations-8ffdf84d.mjs +121 -0
- package/dist/organizations.client-0071acee.js +3 -0
- package/dist/organizations.client-8aa34e80.mjs +3017 -0
- package/dist/organizations.client-b0878617.js +3 -0
- package/dist/organizations.client-fa3b0839.mjs +3017 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +13 -13
- package/dist/prometheus-framework.cjs.js +2 -2
- package/dist/prometheus-framework.es.js +4 -3
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +48 -48
- package/package.json +2 -1
- package/src/components/CardHeader/CardHeader.vue +2 -2
- package/src/components/Magnifier/Magnifier.vue +1 -1
- package/src/components/Text/Text.vue +4 -3
- package/src/components/UploadImage/UploadImage.vue +8 -1
- package/src/modules/auth/store/auth.js +23 -3
- package/src/modules/backoffice/components/pages/Organizations.vue +1 -1
- package/src/modules/community/components/blocks/CardBlogpost.vue +16 -1
- package/src/modules/constructor/components/elements/Image.vue +1 -1
- package/src/modules/constructor/components/elements/ImageUpload.vue +1 -1
- package/src/modules/events/components/blocks/CardEvent.vue +18 -6
- package/src/modules/events/components/elements/ButtonJoin.vue +1 -1
- package/src/modules/landing/components/sections/MobileApp.vue +1 -1
- package/src/modules/orders/components/blocks/CardOrderItem.vue +1 -1
- package/src/modules/orders/components/blocks/Positions.vue +2 -2
- package/src/modules/organizations/components/blocks/CardOrganization.vue +5 -5
- package/src/modules/organizations/components/blocks/DepartmentSub.vue +1 -1
- package/src/modules/organizations/components/blocks/User.vue +1 -1
- package/src/modules/organizations/components/pages/Organizations.vue +1 -1
- package/src/modules/organizations/components/pages/OrganizationsAccount.vue +1 -1
- package/src/modules/organizations/components/sections/DetailsTab.vue +1 -1
- package/src/modules/organizations/components/sections/Publics.vue +1 -1
- package/src/modules/products/components/blocks/Images360.vue +1 -1
- package/src/modules/products/components/blocks/ImagesThumbnails.vue +1 -1
- package/src/modules/products/components/blocks/LeftoverPositions.vue +2 -2
- package/src/modules/products/components/blocks/ProductCard.vue +1 -1
- package/src/modules/products/components/sections/EditProductImages.vue +1 -1
- package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
- package/src/modules/products/components/sections/SectionProduct.vue +1 -1
- package/src/modules/users/components/pages/Profile.vue +3 -3
- package/src/modules/users/components/pages/ProfileEdit.vue +1 -1
- package/src/styles/base/all.scss +1 -0
@@ -0,0 +1,439 @@
|
|
1
|
+
import { reactive as z, watch as B, openBlock as o, createElementBlock as c, toDisplayString as d, createCommentVNode as i, createElementVNode as b, ref as g, createTextVNode as I, computed as L, createBlock as w, withModifiers as N, createVNode as k, normalizeClass as O, unref as m, renderSlot as U, onMounted as A, Transition as $, withCtx as j, Fragment as M, renderList as T } from "vue";
|
2
|
+
import { _ as F } from "./EmptyState-34d85f10.mjs";
|
3
|
+
import { _ as V } from "./_plugin-vue_export-helper-dad06003.mjs";
|
4
|
+
import { _ as q, a as D } from "./Chips-4316f652.mjs";
|
5
|
+
import { useRouter as G } from "vue-router";
|
6
|
+
import { a as E } from "./auth-cfeacd61.mjs";
|
7
|
+
import { s as p } from "./globals-96ba60e4.mjs";
|
8
|
+
import { I as H } from "./IconEdit-eacf3856.mjs";
|
9
|
+
const _ = E.create({ baseURL: process.env.API_URL, withCredentials: !0 });
|
10
|
+
_.defaults.withCredentials = !0;
|
11
|
+
const f = z({
|
12
|
+
all: [],
|
13
|
+
filter: {
|
14
|
+
// query
|
15
|
+
tags: [],
|
16
|
+
period: ""
|
17
|
+
// pagination
|
18
|
+
},
|
19
|
+
pagination: {
|
20
|
+
page: 1,
|
21
|
+
perPage: 18
|
22
|
+
},
|
23
|
+
// Sort
|
24
|
+
sort: {
|
25
|
+
current: "popularity",
|
26
|
+
ascending: !1
|
27
|
+
},
|
28
|
+
current: {
|
29
|
+
_id: "",
|
30
|
+
url: "",
|
31
|
+
status: "",
|
32
|
+
name: "",
|
33
|
+
tags: [],
|
34
|
+
owner: {},
|
35
|
+
date: "",
|
36
|
+
views: 0,
|
37
|
+
content: []
|
38
|
+
}
|
39
|
+
});
|
40
|
+
async function R(e = {}) {
|
41
|
+
e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.period && (e.params.period = e.period), e.url && (e.params = { url: e.url }), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.owner && (e.params.owner = e.owner), e.creator && (e.params.creator = e.creator), e.status && (e.params.status = e.status), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
|
42
|
+
try {
|
43
|
+
console.log("Request params:" + e.params);
|
44
|
+
const t = await _.get("/api/blog/read", { params: e.params });
|
45
|
+
return e.url ? P(t.data, "current") : P(t.data, "all"), Promise.resolve(t.data);
|
46
|
+
} catch (t) {
|
47
|
+
return p(t), Promise.reject(t);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
async function J(e) {
|
51
|
+
return _.post("/api/blog/create", e).then(
|
52
|
+
(t) => (P(t.data, "current"), Promise.resolve(t.data)),
|
53
|
+
(t) => (p(t), Promise.reject(t))
|
54
|
+
);
|
55
|
+
}
|
56
|
+
async function K(e) {
|
57
|
+
return _.post("/api/blog/update", e).then(
|
58
|
+
(t) => (P(t.data, "current"), Promise.resolve(t.data)),
|
59
|
+
(t) => (p(t), Promise.reject(t))
|
60
|
+
);
|
61
|
+
}
|
62
|
+
async function Q(e) {
|
63
|
+
return await _.delete(`/api/blog/delete/${e}`).then(
|
64
|
+
(t) => {
|
65
|
+
const a = f.all.findIndex((r) => r._id === e);
|
66
|
+
return a !== -1 && f.all.splice(a, 1), Promise.resolve(t.data);
|
67
|
+
},
|
68
|
+
(t) => (p(t), Promise.reject(t))
|
69
|
+
);
|
70
|
+
}
|
71
|
+
function P(e, t) {
|
72
|
+
f[t] = e;
|
73
|
+
}
|
74
|
+
function W() {
|
75
|
+
f.current = {
|
76
|
+
_id: "",
|
77
|
+
url: "",
|
78
|
+
status: "",
|
79
|
+
name: "",
|
80
|
+
tags: [],
|
81
|
+
author: "",
|
82
|
+
owner: "",
|
83
|
+
date: "",
|
84
|
+
views: 0,
|
85
|
+
content: []
|
86
|
+
};
|
87
|
+
}
|
88
|
+
function X(e) {
|
89
|
+
const t = {
|
90
|
+
order: f.project.content.length + 1,
|
91
|
+
type: e.type,
|
92
|
+
data: e.data,
|
93
|
+
class: e.class,
|
94
|
+
content: e.content
|
95
|
+
};
|
96
|
+
f.project.content.push(t);
|
97
|
+
}
|
98
|
+
B(f, (e, t) => {
|
99
|
+
});
|
100
|
+
const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
101
|
+
__proto__: null,
|
102
|
+
blockAdd: X,
|
103
|
+
clean: W,
|
104
|
+
create: J,
|
105
|
+
read: R,
|
106
|
+
remove: Q,
|
107
|
+
set: P,
|
108
|
+
state: f,
|
109
|
+
update: K
|
110
|
+
}, Symbol.toStringTag, { value: "Module" })), Y = {
|
111
|
+
props: {
|
112
|
+
progress: {
|
113
|
+
type: Number,
|
114
|
+
default: null
|
115
|
+
},
|
116
|
+
status: {
|
117
|
+
type: String,
|
118
|
+
default: null
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}, Z = { class: "circular-loader" }, ee = /* @__PURE__ */ b("svg", { viewBox: "25 25 50 50" }, [
|
122
|
+
/* @__PURE__ */ b("circle", {
|
123
|
+
cx: "50",
|
124
|
+
cy: "50",
|
125
|
+
r: "20",
|
126
|
+
fill: "none",
|
127
|
+
"stroke-width": "4",
|
128
|
+
"stroke-miterlimit": "10"
|
129
|
+
})
|
130
|
+
], -1), te = {
|
131
|
+
key: 0,
|
132
|
+
class: "progress-text"
|
133
|
+
}, re = {
|
134
|
+
key: 1,
|
135
|
+
class: "uppercase t-semi w-m-10r status-text"
|
136
|
+
};
|
137
|
+
function ae(e, t, a, r, s, n) {
|
138
|
+
return o(), c("div", Z, [
|
139
|
+
ee,
|
140
|
+
a.progress ? (o(), c("div", te, d(a.progress), 1)) : i("", !0),
|
141
|
+
a.status ? (o(), c("div", re, d(a.status), 1)) : i("", !0)
|
142
|
+
]);
|
143
|
+
}
|
144
|
+
const se = /* @__PURE__ */ V(Y, [["render", ae]]), x = E.create({
|
145
|
+
baseURL: process.env.API_URL,
|
146
|
+
withCredentials: !0
|
147
|
+
}), y = z({
|
148
|
+
reactions: [],
|
149
|
+
error: null
|
150
|
+
}), S = {
|
151
|
+
async read({ user: e, type: t, target: a, role: r }) {
|
152
|
+
try {
|
153
|
+
const s = await x.get("/api/reactions", { params: { user: e, type: t, target: a, role: r } });
|
154
|
+
return y.error = null, y.reactions = s.data, Promise.resolve(s.data);
|
155
|
+
} catch (s) {
|
156
|
+
return p(s), Promise.reject(s);
|
157
|
+
}
|
158
|
+
},
|
159
|
+
async create(e) {
|
160
|
+
try {
|
161
|
+
const t = await x.post("/api/reactions/create", e);
|
162
|
+
return y.error = null, Promise.resolve(t.data);
|
163
|
+
} catch (t) {
|
164
|
+
return console.log(t), p(t), Promise.reject(t);
|
165
|
+
}
|
166
|
+
},
|
167
|
+
async update(e) {
|
168
|
+
try {
|
169
|
+
const t = await x.post("/api/reactions/update", e);
|
170
|
+
return y.error = null, Promise.resolve(t.data);
|
171
|
+
} catch (t) {
|
172
|
+
return p(t), Promise.reject(t);
|
173
|
+
}
|
174
|
+
},
|
175
|
+
async delete(e) {
|
176
|
+
try {
|
177
|
+
const t = await x.post("/api/reactions/delete", e);
|
178
|
+
return y.error = null, Promise.resolve(t.data);
|
179
|
+
} catch (t) {
|
180
|
+
return p(t), Promise.reject(t);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}, oe = {
|
184
|
+
handleReactionUpdate(e, t, a) {
|
185
|
+
let r;
|
186
|
+
if (Array.isArray(e) ? r = e.find((s) => s._id === t.target) : typeof e == "object" && e._id === t.target && (r = e), r)
|
187
|
+
if (r.hasReaction = a, a)
|
188
|
+
r.reactions.push(t), r.numberOfReactions += 1;
|
189
|
+
else {
|
190
|
+
const s = r.reactions.findIndex((n) => n._id === t._id);
|
191
|
+
s !== -1 && (r.reactions.splice(s, 1), r.numberOfReactions -= 1);
|
192
|
+
}
|
193
|
+
}
|
194
|
+
};
|
195
|
+
B(y, (e) => {
|
196
|
+
});
|
197
|
+
const Ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
198
|
+
__proto__: null,
|
199
|
+
actions: S,
|
200
|
+
mutations: oe,
|
201
|
+
state: y
|
202
|
+
}, Symbol.toStringTag, { value: "Module" })), le = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, ne = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ce = { class: "cursor-pointer" }, ie = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ue = {
|
203
|
+
__name: "FooterBlogpost",
|
204
|
+
props: ["blogpost", "owner", "user"],
|
205
|
+
setup(e) {
|
206
|
+
const t = e, a = g(t.blogpost.numberOfReactions), r = g(t.blogpost.isReacted), s = g(t.blogpost.reactionId);
|
207
|
+
async function n(v) {
|
208
|
+
if (!t.user) {
|
209
|
+
alert("Please login to add a reaction");
|
210
|
+
return;
|
211
|
+
}
|
212
|
+
try {
|
213
|
+
const l = {
|
214
|
+
target: t.blogpost._id,
|
215
|
+
type: "blogpost",
|
216
|
+
user: t.user,
|
217
|
+
class: "like"
|
218
|
+
}, h = await S.create(l);
|
219
|
+
h.reaction.class === "like" && (a.value += 1, r.value = !0, s.value = h.reaction._id);
|
220
|
+
} catch (l) {
|
221
|
+
console.error(l), alert("Error adding reaction. Please try again later.");
|
222
|
+
}
|
223
|
+
}
|
224
|
+
async function u(v) {
|
225
|
+
if (!t.user) {
|
226
|
+
alert("Please login to add a reaction");
|
227
|
+
return;
|
228
|
+
}
|
229
|
+
try {
|
230
|
+
const l = { _id: s.value };
|
231
|
+
await S.delete(l), a.value -= 1, r.value = !1, s.value = null;
|
232
|
+
} catch {
|
233
|
+
alert("Error adding reaction. Please try again later.");
|
234
|
+
}
|
235
|
+
}
|
236
|
+
return (v, l) => (o(), c("footer", le, [
|
237
|
+
I(" 👁️ " + d(e.blogpost.views) + " ", 1),
|
238
|
+
ne,
|
239
|
+
b("div", ce, [
|
240
|
+
r.value ? i("", !0) : (o(), c("div", {
|
241
|
+
key: 0,
|
242
|
+
class: "cursor-pointer",
|
243
|
+
onClick: l[0] || (l[0] = (h) => n())
|
244
|
+
}, " 👍 " + d(a.value), 1)),
|
245
|
+
r.value ? (o(), c("div", {
|
246
|
+
key: 1,
|
247
|
+
class: "cursor-pointer",
|
248
|
+
onClick: l[1] || (l[1] = (h) => u())
|
249
|
+
}, " 👍 " + d(a.value), 1)) : i("", !0)
|
250
|
+
]),
|
251
|
+
ie,
|
252
|
+
I(" 💬 " + d(e.blogpost.numberOfComments), 1)
|
253
|
+
]));
|
254
|
+
}
|
255
|
+
}, de = { class: "bg-grey radius-big" }, me = ["src"], ge = { class: "pd-t-zero pd-medium" }, pe = {
|
256
|
+
key: 0,
|
257
|
+
class: "cursor-pointer mn-thin flex-nowrap flex w-100"
|
258
|
+
}, fe = {
|
259
|
+
key: 0,
|
260
|
+
class: "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"
|
261
|
+
}, ye = {
|
262
|
+
key: 1,
|
263
|
+
class: "mn-small t-transp p-big"
|
264
|
+
}, be = {
|
265
|
+
key: 2,
|
266
|
+
class: "mn-small h2"
|
267
|
+
}, ve = {
|
268
|
+
__name: "CardBlogpost",
|
269
|
+
props: ["blogpost", "user", "type"],
|
270
|
+
setup(e) {
|
271
|
+
const t = e, a = G(), r = L(() => t.blogpost.content.find((n) => n.type === "ImageUpload")), s = L(() => t.blogpost.content.find((n) => n.type === "Textarea"));
|
272
|
+
return (n, u) => (o(), c("article", de, [
|
273
|
+
e.user === e.blogpost.creator.target._id ? (o(), w(H, {
|
274
|
+
key: 0,
|
275
|
+
onClick: u[0] || (u[0] = N((v) => n.$router.push({
|
276
|
+
name: "Edit BlogPost",
|
277
|
+
params: {
|
278
|
+
url: e.blogpost.url
|
279
|
+
}
|
280
|
+
}), ["stop"])),
|
281
|
+
class: "z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
|
282
|
+
})) : i("", !0),
|
283
|
+
k(q, {
|
284
|
+
class: O({
|
285
|
+
"mn-small pd-medium": e.type !== "short",
|
286
|
+
"flex-child-order-last flex-child mn-l-small": e.type === "short"
|
287
|
+
}),
|
288
|
+
owner: e.blogpost.owner,
|
289
|
+
creator: e.blogpost.creator,
|
290
|
+
date: e.blogpost.createdAt
|
291
|
+
}, null, 8, ["class", "owner", "creator", "date"]),
|
292
|
+
m(r) && m(r).content && e.type !== "blogpostPage" ? (o(), c("img", {
|
293
|
+
key: 1,
|
294
|
+
src: (n.FILE_SERVER_URL || "") + m(r).content,
|
295
|
+
alt: "Blog post image",
|
296
|
+
class: "mn-medium object-fit-cover w-100 h-20r"
|
297
|
+
}, null, 8, me)) : i("", !0),
|
298
|
+
b("section", ge, [
|
299
|
+
e.type !== "blogpostPage" ? (o(), c("div", pe, [
|
300
|
+
b("h3", {
|
301
|
+
onClick: u[1] || (u[1] = (v) => m(a).push({
|
302
|
+
name: "BlogPost",
|
303
|
+
params: {
|
304
|
+
url: e.blogpost.url
|
305
|
+
}
|
306
|
+
})),
|
307
|
+
class: ""
|
308
|
+
}, d(e.blogpost.name), 1),
|
309
|
+
e.blogpost.status === "draft" ? (o(), c("div", fe, d(e.blogpost.status), 1)) : i("", !0)
|
310
|
+
])) : i("", !0),
|
311
|
+
m(s) && m(s).content && e.type !== "blogpostPage" ? (o(), c("p", ye, d(m(s).content.slice(0, 120)) + "... ", 1)) : i("", !0),
|
312
|
+
e.type === "blogpostPage" ? (o(), c("h3", be, d(e.blogpost.name), 1)) : i("", !0),
|
313
|
+
U(n.$slots, "default"),
|
314
|
+
e.type !== "short" && e.blogpost.tags.length > 0 ? (o(), w(D, {
|
315
|
+
key: 3,
|
316
|
+
chips: e.blogpost.tags
|
317
|
+
}, null, 8, ["chips"])) : i("", !0)
|
318
|
+
]),
|
319
|
+
k(ue, {
|
320
|
+
class: "pd-t-zero pd-medium",
|
321
|
+
blogpost: e.blogpost,
|
322
|
+
user: e.user
|
323
|
+
}, null, 8, ["blogpost", "user"])
|
324
|
+
]));
|
325
|
+
}
|
326
|
+
}, he = { class: "feed" }, we = { key: 1 }, Le = {
|
327
|
+
__name: "Feed",
|
328
|
+
props: {
|
329
|
+
category: {
|
330
|
+
type: String,
|
331
|
+
default: null
|
332
|
+
},
|
333
|
+
owner: {
|
334
|
+
type: String,
|
335
|
+
default: null
|
336
|
+
},
|
337
|
+
creator: {
|
338
|
+
type: String,
|
339
|
+
default: null
|
340
|
+
},
|
341
|
+
status: {
|
342
|
+
type: String,
|
343
|
+
default: "published"
|
344
|
+
},
|
345
|
+
user: {
|
346
|
+
type: [String, Number],
|
347
|
+
default: null
|
348
|
+
},
|
349
|
+
period: {
|
350
|
+
type: String,
|
351
|
+
default: null
|
352
|
+
}
|
353
|
+
},
|
354
|
+
setup(e) {
|
355
|
+
const t = e, a = g([]), r = g(!0);
|
356
|
+
let s = g(!0), n = g(0), u = g(7);
|
357
|
+
const v = async () => {
|
358
|
+
if (r.value) {
|
359
|
+
n.value += u.value;
|
360
|
+
const l = await R({
|
361
|
+
skip: n.value,
|
362
|
+
limit: u.value,
|
363
|
+
category: t.category,
|
364
|
+
user: t.user,
|
365
|
+
owner: t.owner,
|
366
|
+
status: t.status,
|
367
|
+
creator: t.creator,
|
368
|
+
period: t.period
|
369
|
+
});
|
370
|
+
l.length === 0 && (r.value = !1), a.value = [...a.value, ...l];
|
371
|
+
}
|
372
|
+
};
|
373
|
+
return A(async () => {
|
374
|
+
const l = await R({
|
375
|
+
skip: n.value,
|
376
|
+
limit: u.value,
|
377
|
+
category: t.category,
|
378
|
+
user: t.user,
|
379
|
+
owner: t.owner,
|
380
|
+
status: t.status,
|
381
|
+
creator: t.creator,
|
382
|
+
period: t.period
|
383
|
+
});
|
384
|
+
l.length === 0 ? r.value = !1 : r.value = !0, a.value = l, s.value = !1;
|
385
|
+
}), (l, h) => (o(), c("section", he, [
|
386
|
+
k($, { name: "fade" }, {
|
387
|
+
default: j(() => [
|
388
|
+
m(s) ? (o(), w(se, {
|
389
|
+
key: 0,
|
390
|
+
class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
|
391
|
+
})) : i("", !0)
|
392
|
+
]),
|
393
|
+
_: 1
|
394
|
+
}),
|
395
|
+
k($, { name: "fade" }, {
|
396
|
+
default: j(() => [
|
397
|
+
!m(s) && a.value.length < 1 ? (o(), w(F, {
|
398
|
+
key: 0,
|
399
|
+
title: "No Blog Posts Found",
|
400
|
+
description: "Currently, there are no posts available in this blog. Please check back later.",
|
401
|
+
class: "pd-medium mn-thin bg-grey radius-big"
|
402
|
+
})) : (o(), c("div", we, [
|
403
|
+
(o(!0), c(M, null, T(a.value, (C) => (o(), w(ve, {
|
404
|
+
key: C._id,
|
405
|
+
blogpost: C,
|
406
|
+
user: e.user,
|
407
|
+
class: "mn-medium"
|
408
|
+
}, null, 8, ["blogpost", "user"]))), 128)),
|
409
|
+
k($, { name: "fade" }, {
|
410
|
+
default: j(() => [
|
411
|
+
r.value && a.value.length > 0 ? (o(), c("button", {
|
412
|
+
key: 0,
|
413
|
+
onClick: v,
|
414
|
+
class: "w-100 bg-main button"
|
415
|
+
}, " Load more ")) : i("", !0)
|
416
|
+
]),
|
417
|
+
_: 1
|
418
|
+
})
|
419
|
+
]))
|
420
|
+
]),
|
421
|
+
_: 1
|
422
|
+
})
|
423
|
+
]));
|
424
|
+
}
|
425
|
+
};
|
426
|
+
export {
|
427
|
+
se as L,
|
428
|
+
Le as _,
|
429
|
+
J as a,
|
430
|
+
Q as b,
|
431
|
+
W as c,
|
432
|
+
ve as d,
|
433
|
+
ue as e,
|
434
|
+
Ce as f,
|
435
|
+
Ie as g,
|
436
|
+
R as r,
|
437
|
+
f as s,
|
438
|
+
K as u
|
439
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),b=require("./Chips-2a0d9bfe.js"),T=require("./auth-b61483ce.js"),D=require("vue-router"),V=require("./_plugin-vue_export-helper-f246444f.js"),v=require("./globals-928eb13c.js"),U={key:0,class:"o-hidden bg-grey mn-small w-100"},$=["src"],P=["src"],z={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},_={key:0,class:"t-semi"},M={class:"t-semi"},F={key:0,class:"t-semi uppercase"},O={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},I={key:0,class:""},q={key:1,class:"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"},L={key:1,class:"mn-small p-big"},C={__name:"CardEvent",props:["event","user","short","type"],setup(t){const r=t;e.ref(new Date),D.useRouter(),e.computed(()=>r.event.content.find(a=>a.type.name==="ImageUpload")),e.computed(()=>r.event.content.find(a=>a.type.name==="Textarea"));const s=e.computed(()=>{const a=new Date,o=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds()),n=new Date(r.event.date.start),c=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())-o;if(c<0)return"Finished";if(c===0)return"Starting Now";{const f=Math.floor(c/1e3),g=Math.floor(f/60),k=Math.floor(g/60),w=Math.floor(k/24);return w>0?`${w} days until event`:k>0?`${k} hours until event`:g>0?`${g} minutes until event`:`${f} seconds until event`}}),l=e.computed(()=>{const a=new Date(r.event.date.start),o={day:"2-digit",month:"2-digit"};return a.toLocaleDateString(void 0,o)}),i=e.computed(()=>{const a=new Date(r.event.date.start),o=new Date(r.event.date.end),n=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(a),p=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(o);return`${n}-${p}`}),d=e.computed(()=>{const a=r.event.name;return a.length>26?`${a.substring(0,22)}…`:a});return(a,o)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass({"flex-nowrap flex-v-center flex":t.type==="short"})},[e.createVNode(b._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),owner:t.event.owner,creator:t.event.creator,members:t.event.numberOfTickets,membersPhotos:t.event.participantsPhotos,type:t.type,dateFormatted:e.unref(s)},null,8,["class","owner","creator","members","membersPhotos","type","dateFormatted"]),t.event.cover&&t.type!=="short"?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("img",{src:t.event.cover,alt:"Event image",class:"z-index-1 d-block mn-auto h-20r"},null,8,$),e.createElementVNode("img",{src:t.event.cover,alt:"Event image",class:"z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",style:{transform:"scale(1.5)",filter:"blur(2rem)","-webkit-filter":"blur(2rem)"}},null,8,P)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:e.normalizeClass(["w-100",{"pd-t-zero pd-medium":t.type!=="short"}])},[e.createElementVNode("div",{class:e.normalizeClass([{"mn-small":t.type!=="short"},"flex-v-center flex-nowrap flex"])},[e.createElementVNode("div",z,[t.type!=="short"?(e.openBlock(),e.createElementBlock("span",_,e.toDisplayString(e.unref(l))+" | ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",M,e.toDisplayString(e.unref(i)),1)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",F,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",O,[t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",I,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.event.status==="draft"?(e.openBlock(),e.createElementBlock("div",q,e.toDisplayString(t.event.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",L,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.type!=="short"&&t.event.tags.length>0?(e.openBlock(),e.createBlock(b._sfc_main$1,{key:2,chips:t.event.tags},null,8,["chips"])):e.createCommentVNode("",!0)],2)],2))}},j={},R={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},H=e.createStaticVNode('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',6),G=[H];function Y(t,r){return e.openBlock(),e.createElementBlock("svg",R,G)}const x=V._export_sfc(j,[["render",Y]]),y=T.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),u=e.reactive({all:[],filter:{tags:[],period:"",date:null},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}});async function h(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.status&&(t.params={status:t.status}),t.url&&(t.params={url:t.url}),t.period&&(t.params.period=t.period),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.date&&(t.params.date=t.date),t.participant&&(t.params.participant=t.participant),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.user&&(t.params.user=t.user),t.sortOrder&&(t.params.sortOrder=t.sortOrder),t.sortParam&&(t.params.sortParam=t.sortParam),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await y.get("/api/events/read",{params:t.params});return console.log(t.params),t.url?m(r.data,"current"):m(r.data,"all"),Promise.resolve(r.data)}catch(r){return v.setError(r),Promise.reject(r)}}async function E(t){return y.post("/api/events/create",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(v.setError(r),Promise.reject(r)))}async function B(t){return y.post("/api/events/update",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(v.setError(r),Promise.reject(r)))}async function A(t){return await y.delete(`/api/events/delete/${t}`).then(r=>{const s=u.all.findIndex(l=>l._id===t);return s!==-1&&u.all.splice(s,1),Promise.resolve(r.data)},r=>(v.setError(r),Promise.reject(r)))}function m(t,r){u[r]=t}function S(){u.current={_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}}e.watch(u,(t,r)=>{});const J=Object.freeze(Object.defineProperty({__proto__:null,clean:S,create:E,read:h,remove:A,set:m,state:u,update:B},Symbol.toStringTag,{value:"Module"})),K={class:"feed"},Q={__name:"Feed",props:{category:{type:String,default:null},selectedDate:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},user:{type:[String,Number],default:null},sortOrder:{type:String,default:"desc"},participant:{type:String,default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(t){const r=t,s=e.ref([]),l=e.ref(!1),i=e.ref(!0),d=e.ref(0),a=e.ref(20),o=async()=>{if(l.value){d.value+=a.value;const n=await h({skip:d.value,limit:a.value,category:r.category,sortOrder:r.sortOrder,participant:r.participant,creator:r.creator,user:r.user,date:r.selectedDate,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=[...s.value,...n]}};return e.onMounted(async()=>{i.value=!0,console.log(r.selectedDate);const n=await h({skip:d.value,limit:a.value,category:r.category,participant:r.participant,sortOrder:r.sortOrder,user:r.user,owner:r.owner,creator:r.creator,date:r.selectedDate,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=n,i.value=!1}),(n,p)=>(e.openBlock(),e.createElementBlock("section",K,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[i.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value,c=>(e.openBlock(),e.createBlock(x,{key:c}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!i.value&&s.value.length<1?(e.openBlock(),e.createBlock(N._sfc_main,{key:0,title:"No Events Found",description:"Currently, there are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"container"},{default:e.withCtx(()=>[!i.value&&s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(c,f)=>(e.openBlock(),e.createBlock(C,{onClick:g=>n.$router.push({name:"Event",params:{url:c.url}}),key:c._id,event:c,owner:t.user,type:"normal",class:e.normalizeClass(["bg-grey radius-big mn-medium",{"br-b br-solid br-black-transp-10":f!==s.value.length-1}])},null,8,["onClick","event","owner","class"]))),128)):e.createCommentVNode("",!0),l.value&&s.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:o,class:"w-100 bg-main button"},"Load more")):e.createCommentVNode("",!0)]),_:1})]))}};exports.SkeletonEvent=x;exports._sfc_main=Q;exports._sfc_main$1=C;exports.clean=S;exports.create=E;exports.events=J;exports.read=h;exports.state=u;exports.update=B;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),C=require("./Chips-92ccc11f.js"),T=require("./IconEdit-4cfe2115.js"),V=require("./auth-b61483ce.js"),D=require("vue-router"),U=require("./_plugin-vue_export-helper-f246444f.js"),v=require("./globals-928eb13c.js"),$={key:0,class:"o-hidden bg-grey mn-small w-100"},z=["src"],P=["src"],M={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},I={key:0,class:"t-semi"},F={class:"t-semi"},L={key:0,class:"t-semi uppercase"},R={key:1,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},O={key:0,class:""},_={key:1,class:"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"},q={key:2,class:"mn-small p-big"},b={__name:"CardEvent",props:["event","user","short","type"],setup(t){const r=t;e.ref(new Date),D.useRouter(),e.computed(()=>r.event.content.find(a=>a.type.name==="ImageUpload")),e.computed(()=>r.event.content.find(a=>a.type.name==="Textarea"));const s=e.computed(()=>{const a=new Date,c=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds()),n=new Date(r.event.date.start),o=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())-c;if(o<0)return"Finished";if(o===0)return"Starting Now";{const f=Math.floor(o/1e3),g=Math.floor(f/60),k=Math.floor(g/60),w=Math.floor(k/24);return w>0?`${w} days until event`:k>0?`${k} hours until event`:g>0?`${g} minutes until event`:`${f} seconds until event`}}),l=e.computed(()=>{const a=new Date(r.event.date.start),c={day:"2-digit",month:"2-digit"};return a.toLocaleDateString(void 0,c)}),i=e.computed(()=>{const a=new Date(r.event.date.start),c=new Date(r.event.date.end),n=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(a),p=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(c);return`${n}-${p}`}),d=e.computed(()=>{const a=r.event.name;return a.length>26?`${a.substring(0,22)}…`:a});return(a,c)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass({"flex-nowrap flex-v-center flex":t.type==="short"})},[e.createVNode(C._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),owner:t.event.owner,creator:t.event.creator,members:t.event.numberOfTickets,membersPhotos:t.event.participantsPhotos,type:t.type,dateFormatted:e.unref(s)},null,8,["class","owner","creator","members","membersPhotos","type","dateFormatted"]),t.event.cover&&t.type!=="short"?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("img",{src:(a.FILE_SERVER_URL||"")+t.event.cover,alt:"Event image",class:"z-index-1 d-block mn-auto h-20r"},null,8,z),e.createElementVNode("img",{src:(a.FILE_SERVER_URL||"")+t.event.cover,alt:"Event Background",class:"z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",style:{transform:"scale(1.5)",filter:"blur(2rem)","-webkit-filter":"blur(2rem)"}},null,8,P)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:e.normalizeClass(["w-100",{"pd-t-zero pd-medium":t.type!=="short"}])},[t.user===t.event.creator.target._id?(e.openBlock(),e.createBlock(T.IconEdit,{key:0,onClick:c[0]||(c[0]=e.withModifiers(n=>a.$router.push({name:"Edit Event",params:{url:t.event.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([{"mn-small":t.type!=="short"},"flex-v-center flex-nowrap flex"])},[e.createElementVNode("div",M,[t.type!=="short"?(e.openBlock(),e.createElementBlock("span",I,e.toDisplayString(e.unref(l))+" | ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",F,e.toDisplayString(e.unref(i)),1)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",L,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",R,[t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",O,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.event.status==="draft"?(e.openBlock(),e.createElementBlock("div",_,e.toDisplayString(t.event.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",q,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.type!=="short"&&t.event.tags.length>0?(e.openBlock(),e.createBlock(C._sfc_main$1,{key:3,chips:t.event.tags},null,8,["chips"])):e.createCommentVNode("",!0)],2)],2))}},j={},H={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},G=e.createStaticVNode('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',6),Y=[G];function A(t,r){return e.openBlock(),e.createElementBlock("svg",H,Y)}const E=U._export_sfc(j,[["render",A]]),y=V.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),u=e.reactive({all:[],filter:{tags:[],period:"",date:null},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}});async function h(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.status&&(t.params={status:t.status}),t.url&&(t.params={url:t.url}),t.period&&(t.params.period=t.period),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.date&&(t.params.date=t.date),t.participant&&(t.params.participant=t.participant),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.user&&(t.params.user=t.user),t.sortOrder&&(t.params.sortOrder=t.sortOrder),t.sortParam&&(t.params.sortParam=t.sortParam),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await y.get("/api/events/read",{params:t.params});return console.log(t.params),t.url?m(r.data,"current"):m(r.data,"all"),Promise.resolve(r.data)}catch(r){return v.setError(r),Promise.reject(r)}}async function x(t){return y.post("/api/events/create",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(v.setError(r),Promise.reject(r)))}async function B(t){return y.post("/api/events/update",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(v.setError(r),Promise.reject(r)))}async function J(t){return await y.delete(`/api/events/delete/${t}`).then(r=>{const s=u.all.findIndex(l=>l._id===t);return s!==-1&&u.all.splice(s,1),Promise.resolve(r.data)},r=>(v.setError(r),Promise.reject(r)))}function m(t,r){u[r]=t}function S(){u.current={_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}}e.watch(u,(t,r)=>{});const K=Object.freeze(Object.defineProperty({__proto__:null,clean:S,create:x,read:h,remove:J,set:m,state:u,update:B},Symbol.toStringTag,{value:"Module"})),Q={class:"feed"},W={__name:"Feed",props:{category:{type:String,default:null},selectedDate:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},user:{type:[String,Number],default:null},sortOrder:{type:String,default:"desc"},participant:{type:String,default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(t){const r=t,s=e.ref([]),l=e.ref(!1),i=e.ref(!0),d=e.ref(0),a=e.ref(20),c=async()=>{if(l.value){d.value+=a.value;const n=await h({skip:d.value,limit:a.value,category:r.category,sortOrder:r.sortOrder,participant:r.participant,creator:r.creator,user:r.user,date:r.selectedDate,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=[...s.value,...n]}};return e.onMounted(async()=>{i.value=!0,console.log(r.selectedDate);const n=await h({skip:d.value,limit:a.value,category:r.category,participant:r.participant,sortOrder:r.sortOrder,user:r.user,owner:r.owner,creator:r.creator,date:r.selectedDate,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=n,i.value=!1}),(n,p)=>(e.openBlock(),e.createElementBlock("section",Q,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[i.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value,o=>(e.openBlock(),e.createBlock(E,{key:o}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!i.value&&s.value.length<1?(e.openBlock(),e.createBlock(N._sfc_main,{key:0,title:"No Events Found",description:"Currently, there are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"container"},{default:e.withCtx(()=>[!i.value&&s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(o,f)=>(e.openBlock(),e.createBlock(b,{onClick:g=>n.$router.push({name:"Event",params:{url:o.url}}),key:o._id,event:o,owner:t.user,type:"normal",class:e.normalizeClass(["bg-grey radius-big mn-medium",{"br-b br-solid br-black-transp-10":f!==s.value.length-1}])},null,8,["onClick","event","owner","class"]))),128)):e.createCommentVNode("",!0),l.value&&s.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c,class:"w-100 bg-main button"},"Load more")):e.createCommentVNode("",!0)]),_:1})]))}};exports.SkeletonEvent=E;exports._sfc_main=W;exports._sfc_main$1=b;exports.clean=S;exports.create=x;exports.events=K;exports.read=h;exports.state=u;exports.update=B;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),V=require("./EmptyState-7658d7d6.js"),S=require("./_plugin-vue_export-helper-f246444f.js"),v=require("./Chips-2a0d9bfe.js"),$=require("vue-router"),w=require("./auth-b61483ce.js"),u=require("./globals-928eb13c.js"),f=w.axios.create({baseURL:process.env.API_URL,withCredentials:!0});f.defaults.withCredentials=!0;const c=e.reactive({all:[],filter:{tags:[],period:""},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",url:"",status:"",name:"",tags:[],owner:{},date:"",views:0,content:[]}});async function k(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.period&&(t.params.period=t.period),t.url&&(t.params={url:t.url}),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.status&&(t.params.status=t.status),t.user&&(t.params.user=t.user),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await f.get("/api/blog/read",{params:t.params});return t.url?g(r.data,"current"):g(r.data,"all"),Promise.resolve(r.data)}catch(r){return u.setError(r),Promise.reject(r)}}async function B(t){return f.post("/api/blog/create",t).then(r=>(g(r.data,"current"),Promise.resolve(r.data)),r=>(u.setError(r),Promise.reject(r)))}async function _(t){return f.post("/api/blog/update",t).then(r=>(g(r.data,"current"),Promise.resolve(r.data)),r=>(u.setError(r),Promise.reject(r)))}async function x(t){return await f.delete(`/api/blog/delete/${t}`).then(r=>{const o=c.all.findIndex(a=>a._id===t);return o!==-1&&c.all.splice(o,1),Promise.resolve(r.data)},r=>(u.setError(r),Promise.reject(r)))}function g(t,r){c[r]=t}function E(){c.current={_id:"",url:"",status:"",name:"",tags:[],author:"",owner:"",date:"",views:0,content:[]}}function j(t){const r={order:c.project.content.length+1,type:t.type,data:t.data,class:t.class,content:t.content};c.project.content.push(r)}e.watch(c,(t,r)=>{});const R=Object.freeze(Object.defineProperty({__proto__:null,blockAdd:j,clean:E,create:B,read:k,remove:x,set:g,state:c,update:_},Symbol.toStringTag,{value:"Module"})),D={props:{progress:{type:Number,default:null},status:{type:String,default:null}}},z={class:"circular-loader"},L=e.createElementVNode("svg",{viewBox:"25 25 50 50"},[e.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})],-1),T={key:0,class:"progress-text"},q={key:1,class:"uppercase t-semi w-m-10r status-text"};function I(t,r,o,a,s,l){return e.openBlock(),e.createElementBlock("div",z,[L,o.progress?(e.openBlock(),e.createElementBlock("div",T,e.toDisplayString(o.progress),1)):e.createCommentVNode("",!0),o.status?(e.openBlock(),e.createElementBlock("div",q,e.toDisplayString(o.status),1)):e.createCommentVNode("",!0)])}const P=S._export_sfc(D,[["render",I]]),y=w.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),d=e.reactive({reactions:[],error:null}),b={async read({user:t,type:r,target:o,role:a}){try{const s=await y.get("/api/reactions",{params:{user:t,type:r,target:o,role:a}});return d.error=null,d.reactions=s.data,Promise.resolve(s.data)}catch(s){return u.setError(s),Promise.reject(s)}},async create(t){try{const r=await y.post("/api/reactions/create",t);return d.error=null,Promise.resolve(r.data)}catch(r){return console.log(r),u.setError(r),Promise.reject(r)}},async update(t){try{const r=await y.post("/api/reactions/update",t);return d.error=null,Promise.resolve(r.data)}catch(r){return u.setError(r),Promise.reject(r)}},async delete(t){try{const r=await y.post("/api/reactions/delete",t);return d.error=null,Promise.resolve(r.data)}catch(r){return u.setError(r),Promise.reject(r)}}},O={handleReactionUpdate(t,r,o){let a;if(Array.isArray(t)?a=t.find(s=>s._id===r.target):typeof t=="object"&&t._id===r.target&&(a=t),a)if(a.hasReaction=o,o)a.reactions.push(r),a.numberOfReactions+=1;else{const s=a.reactions.findIndex(l=>l._id===r._id);s!==-1&&(a.reactions.splice(s,1),a.numberOfReactions-=1)}}};e.watch(d,t=>{});const A=Object.freeze(Object.defineProperty({__proto__:null,actions:b,mutations:O,state:d},Symbol.toStringTag,{value:"Module"})),U={class:"t-semi br-top-dark flex-nowrap flex-nojustify flex"},M=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),F={class:"cursor-pointer"},H=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),N={__name:"FooterBlogpost",props:["blogpost","owner","user"],setup(t){const r=t,o=e.ref(r.blogpost.numberOfReactions),a=e.ref(r.blogpost.isReacted),s=e.ref(r.blogpost.reactionId);async function l(m){if(!r.user){alert("Please login to add a reaction");return}try{const n={target:r.blogpost._id,type:"blogpost",user:r.user,class:"like"},p=await b.create(n);p.reaction.class==="like"&&(o.value+=1,a.value=!0,s.value=p.reaction._id)}catch(n){console.error(n),alert("Error adding reaction. Please try again later.")}}async function i(m){if(!r.user){alert("Please login to add a reaction");return}try{const n={_id:s.value};await b.delete(n),o.value-=1,a.value=!1,s.value=null}catch{alert("Error adding reaction. Please try again later.")}}return(m,n)=>(e.openBlock(),e.createElementBlock("footer",U,[e.createTextVNode(" 👁️ "+e.toDisplayString(t.blogpost.views)+" ",1),M,e.createElementVNode("div",F,[a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"cursor-pointer",onClick:n[0]||(n[0]=p=>l())}," 👍 "+e.toDisplayString(o.value),1)),a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cursor-pointer",onClick:n[1]||(n[1]=p=>i())}," 👍 "+e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)]),H,e.createTextVNode(" 💬 "+e.toDisplayString(t.blogpost.numberOfComments),1)]))}},G={class:"bg-grey radius-big"},J=["src"],K={class:"pd-t-zero pd-medium"},Q={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},W={key:0,class:"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"},X={key:1,class:"mn-small t-transp p-big"},Y={key:2,class:"mn-small h2"},C={__name:"CardBlogpost",props:["blogpost","user","type"],setup(t){const r=t,o=$.useRouter(),a=e.computed(()=>r.blogpost.content.find(l=>l.type==="ImageUpload")),s=e.computed(()=>r.blogpost.content.find(l=>l.type==="Textarea"));return(l,i)=>(e.openBlock(),e.createElementBlock("article",G,[e.createVNode(v._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),owner:t.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt},null,8,["class","owner","creator","date"]),e.unref(a)&&e.unref(a).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("img",{key:0,src:e.unref(a).content,alt:"Blog post image",class:"mn-medium object-fit-cover w-100 h-20r"},null,8,J)):e.createCommentVNode("",!0),e.createElementVNode("section",K,[t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("div",Q,[e.createElementVNode("h3",{onClick:i[0]||(i[0]=m=>e.unref(o).push({name:"BlogPost",params:{url:t.blogpost.url}})),class:""},e.toDisplayString(t.blogpost.name),1),t.blogpost.status==="draft"?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(t.blogpost.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(s)&&e.unref(s).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("p",X,e.toDisplayString(e.unref(s).content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),t.type==="blogpostPage"?(e.openBlock(),e.createElementBlock("h3",Y,e.toDisplayString(t.blogpost.name),1)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default"),t.type!=="short"&&t.blogpost.tags.length>0?(e.openBlock(),e.createBlock(v._sfc_main$1,{key:3,chips:t.blogpost.tags},null,8,["chips"])):e.createCommentVNode("",!0)]),e.createVNode(N,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])]))}},Z={class:"feed"},ee={key:1},te={__name:"Feed",props:{category:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},status:{type:String,default:"published"},user:{type:[String,Number],default:null},period:{type:String,default:null}},setup(t){const r=t,o=e.ref([]),a=e.ref(!0);let s=e.ref(!0),l=e.ref(0),i=e.ref(7);const m=async()=>{if(a.value){l.value+=i.value;const n=await k({skip:l.value,limit:i.value,category:r.category,user:r.user,owner:r.owner,status:r.status,creator:r.creator,period:r.period});n.length===0&&(a.value=!1),o.value=[...o.value,...n]}};return e.onMounted(async()=>{const n=await k({skip:l.value,limit:i.value,category:r.category,user:r.user,owner:r.owner,status:r.status,creator:r.creator,period:r.period});n.length===0?a.value=!1:a.value=!0,o.value=n,s.value=!1}),(n,p)=>(e.openBlock(),e.createElementBlock("section",Z,[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createBlock(P,{key:0,class:"z-index-5 pos-t-50 left-t-50 pos-absolute"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!e.unref(s)&&o.value.length<1?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Blog Posts Found",description:"Currently, there are no posts available in this blog. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):(e.openBlock(),e.createElementBlock("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,h=>(e.openBlock(),e.createBlock(C,{key:h._id,blogpost:h,user:t.user,class:"mn-medium"},null,8,["blogpost","user"]))),128)),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[a.value&&o.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:m,class:"w-100 bg-main button"}," Load more ")):e.createCommentVNode("",!0)]),_:1})]))]),_:1})]))}};exports.Loader=P;exports._sfc_main=te;exports._sfc_main$1=C;exports._sfc_main$2=N;exports.blogposts=R;exports.clean=E;exports.create=B;exports.reactions=A;exports.read=k;exports.remove=x;exports.state=c;exports.update=_;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),t=require("./_plugin-vue_export-helper-f246444f.js"),o={},l={viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r=e.createElementVNode("circle",{fill:"rgb(var(--main))",cx:"21",cy:"21",r:"21"},null,-1),s=e.createElementVNode("path",{fill:"#242424","fill-opacity":"0.1","fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"},null,-1),i=[r,s];function _(c,n){return e.openBlock(),e.createElementBlock("svg",l,i)}const d=t._export_sfc(o,[["render",_]]),a={},h={width:"652",height:"652",viewBox:"0 0 652 652",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C=e.createElementVNode("path",{fill:"rgb(var(--black))",d:"M515.693 9.52082C510.095 3.91669 502.49 0.765625 494.563 0.765625C486.635 0.765625 479.036 3.91669 473.432 9.52082L48.7255 434.307C44.8244 438.214 42.0848 443.125 40.8088 448.496L0.939444 615.069C-1.47202 625.168 1.528 635.788 8.86652 643.132C16.2103 650.47 26.8305 653.47 36.9292 651.059L203.516 611.261H203.511C208.88 609.985 213.792 607.246 217.699 603.35L642.485 178.496C648.089 172.892 651.241 165.293 651.241 157.366C651.241 149.439 648.089 141.835 642.485 136.235L515.693 9.52082ZM113.76 453.708L388.307 179.161L472.828 263.682L198.281 538.229L113.76 453.708ZM87.1041 511.5L140.416 564.812L70.3014 581.614L87.1041 511.5ZM515.091 221.793L430.195 136.897L494.184 72.9075L579.08 157.429L515.091 221.793Z"},null,-1),L=[C];function f(c,n){return e.openBlock(),e.createElementBlock("svg",h,L)}const p=t._export_sfc(a,[["render",f]]);exports.IconEdit=p;exports.PlaceholderUserpic=d;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { openBlock as t, createElementBlock as o, createElementVNode as e } from "vue";
|
2
|
+
import { _ as n } from "./_plugin-vue_export-helper-dad06003.mjs";
|
3
|
+
const s = {}, r = {
|
4
|
+
viewBox: "0 0 42 42",
|
5
|
+
fill: "none",
|
6
|
+
xmlns: "http://www.w3.org/2000/svg"
|
7
|
+
}, i = /* @__PURE__ */ e("circle", {
|
8
|
+
fill: "rgb(var(--main))",
|
9
|
+
cx: "21",
|
10
|
+
cy: "21",
|
11
|
+
r: "21"
|
12
|
+
}, null, -1), _ = /* @__PURE__ */ e("path", {
|
13
|
+
fill: "#242424",
|
14
|
+
"fill-opacity": "0.1",
|
15
|
+
"fill-rule": "evenodd",
|
16
|
+
"clip-rule": "evenodd",
|
17
|
+
d: "M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"
|
18
|
+
}, null, -1), d = [
|
19
|
+
i,
|
20
|
+
_
|
21
|
+
];
|
22
|
+
function C(c, l) {
|
23
|
+
return t(), o("svg", r, d);
|
24
|
+
}
|
25
|
+
const v = /* @__PURE__ */ n(s, [["render", C]]), a = {}, h = {
|
26
|
+
width: "652",
|
27
|
+
height: "652",
|
28
|
+
viewBox: "0 0 652 652",
|
29
|
+
fill: "none",
|
30
|
+
xmlns: "http://www.w3.org/2000/svg"
|
31
|
+
}, f = /* @__PURE__ */ e("path", {
|
32
|
+
fill: "rgb(var(--black))",
|
33
|
+
d: "M515.693 9.52082C510.095 3.91669 502.49 0.765625 494.563 0.765625C486.635 0.765625 479.036 3.91669 473.432 9.52082L48.7255 434.307C44.8244 438.214 42.0848 443.125 40.8088 448.496L0.939444 615.069C-1.47202 625.168 1.528 635.788 8.86652 643.132C16.2103 650.47 26.8305 653.47 36.9292 651.059L203.516 611.261H203.511C208.88 609.985 213.792 607.246 217.699 603.35L642.485 178.496C648.089 172.892 651.241 165.293 651.241 157.366C651.241 149.439 648.089 141.835 642.485 136.235L515.693 9.52082ZM113.76 453.708L388.307 179.161L472.828 263.682L198.281 538.229L113.76 453.708ZM87.1041 511.5L140.416 564.812L70.3014 581.614L87.1041 511.5ZM515.091 221.793L430.195 136.897L494.184 72.9075L579.08 157.429L515.091 221.793Z"
|
34
|
+
}, null, -1), L = [
|
35
|
+
f
|
36
|
+
];
|
37
|
+
function p(c, l) {
|
38
|
+
return t(), o("svg", h, L);
|
39
|
+
}
|
40
|
+
const g = /* @__PURE__ */ n(a, [["render", p]]);
|
41
|
+
export {
|
42
|
+
g as I,
|
43
|
+
v as P
|
44
|
+
};
|