@ozdao/prometheus-framework 0.0.87 → 0.0.88
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Feed-51e4e232.js +1 -0
- package/dist/Feed-dc8b66bf.mjs +367 -0
- package/dist/Image-6c7584f5.mjs +477 -0
- package/dist/Image-9a870c88.js +9 -0
- package/dist/Product-1724d88d.mjs +837 -0
- package/dist/Product-a94d8b65.js +7 -0
- package/dist/ProductEdit-57484f1e.mjs +349 -0
- package/dist/ProductEdit-ef301baa.js +1 -0
- package/dist/ProfileEvents-1cfe6858.mjs +55 -0
- package/dist/ProfileEvents-d8e16509.js +1 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +197 -214
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +328 -309
- package/dist/events.server.js +77 -0
- package/dist/events.server.mjs +77 -0
- package/dist/organizations.client-686845be.mjs +3179 -0
- package/dist/organizations.client-99bfc474.js +3 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +2 -2
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +1 -1
- package/package.json +1 -1
- package/src/modules/events/components/blocks/CardEvent.vue +1 -1
- package/src/modules/events/components/pages/EditEvent.vue +7 -2
- package/src/modules/events/components/pages/Event.vue +43 -4
- package/src/modules/events/middlewares/server/index.js +10 -0
- package/src/modules/events/middlewares/server/verifyEvent.js +60 -0
- package/src/modules/events/routes/events.routes.js +14 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),T=require("./CardHeader-925a972b.js"),b=require("./auth-5aa8e90c.js"),D=require("vue-router"),v=require("./globals-928eb13c.js"),V={class:"flex-v-center flex-nowrap flex"},$={key:1,class:"pd-thin radius-small t-semi bg-white"},U={__name:"Chips",props:["chips"],setup(t){return(r,s)=>(e.openBlock(),e.createElementBlock("div",V,[t.chips.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.chips,(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["pd-thin radius-small t-semi bg-main",{"mn-r-thin":c!==t.chips.length-1}])},e.toDisplayString(l.text?l.text:l),3))),256)):(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(t.chips),1))]))}},z={key:0,class:"o-hidden bg-grey mn-small w-100"},P=["src"],_=["src"],M={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},F={key:0,class:"t-semi"},O={class:"t-semi"},I={key:0,class:"t-semi uppercase"},L={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},q={key:0,class:""},j={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"},R={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),i=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())-o;if(i<0)return"Finished";if(i===0)return"Starting Now";{const f=Math.floor(i/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)}),c=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(T._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",z,[e.createElementVNode("img",{src:t.event.cover,alt:"Event image",class:"z-index-1 d-block mn-auto h-20r"},null,8,P),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,_)])):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",M,[t.type!=="short"?(e.openBlock(),e.createElementBlock("span",F,e.toDisplayString(e.unref(l))+" | ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",O,e.toDisplayString(e.unref(c)),1)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",I,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",L,[t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",q,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.event.status==="draft"?(e.openBlock(),e.createElementBlock("div",j,e.toDisplayString(t.event.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",R,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(U,{key:2,chips:t.event.tags},null,8,["chips"])):e.createCommentVNode("",!0)],2)],2))}},H={},G={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},Y=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),A=[Y];function J(t,r){return e.openBlock(),e.createElementBlock("svg",G,A)}const x=b._export_sfc(H,[["render",J]]),y=b.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 B(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 E(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 K(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 Q=Object.freeze(Object.defineProperty({__proto__:null,clean:S,create:B,read:h,remove:K,set:m,state:u,update:E},Symbol.toStringTag,{value:"Module"})),W={class:"feed"},X={__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),c=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()=>{c.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,c.value=!1}),(n,p)=>(e.openBlock(),e.createElementBlock("section",W,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[c.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value,i=>(e.openBlock(),e.createBlock(x,{key:i}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!c.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(()=>[!c.value&&s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(i,f)=>(e.openBlock(),e.createBlock(C,{onClick:g=>n.$router.push({name:"Event",params:{url:i.url}}),key:i._id,event:i,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=X;exports._sfc_main$1=C;exports.clean=S;exports.create=B;exports.events=Q;exports.read=h;exports.state=u;exports.update=E;
|
@@ -0,0 +1,367 @@
|
|
1
|
+
import { openBlock as r, createElementBlock as n, Fragment as _, renderList as M, normalizeClass as v, toDisplayString as m, ref as h, computed as f, createVNode as C, unref as k, createElementVNode as g, createCommentVNode as c, renderSlot as F, createBlock as T, createStaticVNode as I, reactive as N, watch as L, onMounted as j, TransitionGroup as O, withCtx as P, Transition as R } from "vue";
|
2
|
+
import { _ as V } from "./EmptyState-34d85f10.mjs";
|
3
|
+
import { _ as B } from "./CardHeader-ce5a1a75.mjs";
|
4
|
+
import { _ as H, a as Y } from "./auth-35ef1791.mjs";
|
5
|
+
import { useRouter as q } from "vue-router";
|
6
|
+
import { s as S } from "./globals-96ba60e4.mjs";
|
7
|
+
const A = { class: "flex-v-center flex-nowrap flex" }, G = {
|
8
|
+
key: 1,
|
9
|
+
class: "pd-thin radius-small t-semi bg-white"
|
10
|
+
}, J = {
|
11
|
+
__name: "Chips",
|
12
|
+
props: ["chips"],
|
13
|
+
setup(e) {
|
14
|
+
return (t, l) => (r(), n("div", A, [
|
15
|
+
e.chips.length ? (r(!0), n(_, { key: 0 }, M(e.chips, (i, u) => (r(), n("div", {
|
16
|
+
class: v(["pd-thin radius-small t-semi bg-main", { "mn-r-thin": u !== e.chips.length - 1 }])
|
17
|
+
}, m(i.text ? i.text : i), 3))), 256)) : (r(), n("div", G, m(e.chips), 1))
|
18
|
+
]));
|
19
|
+
}
|
20
|
+
}, K = {
|
21
|
+
key: 0,
|
22
|
+
class: "o-hidden bg-grey mn-small w-100"
|
23
|
+
}, Q = ["src"], W = ["src"], X = { class: "w-max mn-r-thin pd-thin radius-small t-semi bg-main" }, Z = {
|
24
|
+
key: 0,
|
25
|
+
class: "t-semi"
|
26
|
+
}, ee = { class: "t-semi" }, te = {
|
27
|
+
key: 0,
|
28
|
+
class: "t-semi uppercase"
|
29
|
+
}, ae = {
|
30
|
+
key: 0,
|
31
|
+
class: "cursor-pointer mn-thin flex-nowrap flex w-100"
|
32
|
+
}, re = {
|
33
|
+
key: 0,
|
34
|
+
class: ""
|
35
|
+
}, ne = {
|
36
|
+
key: 1,
|
37
|
+
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"
|
38
|
+
}, se = {
|
39
|
+
key: 1,
|
40
|
+
class: "mn-small p-big"
|
41
|
+
}, le = {
|
42
|
+
__name: "CardEvent",
|
43
|
+
props: ["event", "user", "short", "type"],
|
44
|
+
setup(e) {
|
45
|
+
const t = e;
|
46
|
+
h(/* @__PURE__ */ new Date()), q(), f(() => t.event.content.find((a) => a.type.name === "ImageUpload")), f(() => t.event.content.find((a) => a.type.name === "Textarea"));
|
47
|
+
const l = f(() => {
|
48
|
+
const a = /* @__PURE__ */ new Date(), d = Date.UTC(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate(), a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds()), s = new Date(t.event.date.start), o = Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate(), s.getUTCHours(), s.getUTCMinutes(), s.getUTCSeconds()) - d;
|
49
|
+
if (o < 0)
|
50
|
+
return "Finished";
|
51
|
+
if (o === 0)
|
52
|
+
return "Starting Now";
|
53
|
+
{
|
54
|
+
const b = Math.floor(o / 1e3), x = Math.floor(b / 60), D = Math.floor(x / 60), E = Math.floor(D / 24);
|
55
|
+
return E > 0 ? `${E} days until event` : D > 0 ? `${D} hours until event` : x > 0 ? `${x} minutes until event` : `${b} seconds until event`;
|
56
|
+
}
|
57
|
+
}), i = f(() => {
|
58
|
+
const a = new Date(t.event.date.start), d = { day: "2-digit", month: "2-digit" };
|
59
|
+
return a.toLocaleDateString(void 0, d);
|
60
|
+
}), u = f(() => {
|
61
|
+
const a = new Date(t.event.date.start), d = new Date(t.event.date.end), s = new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).format(a), U = new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).format(d);
|
62
|
+
return `${s}-${U}`;
|
63
|
+
}), p = f(() => {
|
64
|
+
const a = t.event.name;
|
65
|
+
return a.length > 26 ? `${a.substring(0, 22)}…` : a;
|
66
|
+
});
|
67
|
+
return (a, d) => (r(), n("article", {
|
68
|
+
class: v({
|
69
|
+
"flex-nowrap flex-v-center flex": e.type === "short"
|
70
|
+
})
|
71
|
+
}, [
|
72
|
+
C(B, {
|
73
|
+
class: v({
|
74
|
+
"mn-small pd-medium": e.type !== "short",
|
75
|
+
"flex-child-order-last flex-child mn-l-small": e.type === "short"
|
76
|
+
}),
|
77
|
+
owner: e.event.owner,
|
78
|
+
creator: e.event.creator,
|
79
|
+
members: e.event.numberOfTickets,
|
80
|
+
membersPhotos: e.event.participantsPhotos,
|
81
|
+
type: e.type,
|
82
|
+
dateFormatted: k(l)
|
83
|
+
}, null, 8, ["class", "owner", "creator", "members", "membersPhotos", "type", "dateFormatted"]),
|
84
|
+
e.event.cover && e.type !== "short" ? (r(), n("div", K, [
|
85
|
+
g("img", {
|
86
|
+
src: e.event.cover,
|
87
|
+
alt: "Event image",
|
88
|
+
class: "z-index-1 d-block mn-auto h-20r"
|
89
|
+
}, null, 8, Q),
|
90
|
+
g("img", {
|
91
|
+
src: e.event.cover,
|
92
|
+
alt: "Event image",
|
93
|
+
class: "z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",
|
94
|
+
style: { transform: "scale(1.5)", filter: "blur(2rem)", "-webkit-filter": "blur(2rem)" }
|
95
|
+
}, null, 8, W)
|
96
|
+
])) : c("", !0),
|
97
|
+
g("section", {
|
98
|
+
class: v(["w-100", { "pd-t-zero pd-medium": e.type !== "short" }])
|
99
|
+
}, [
|
100
|
+
g("div", {
|
101
|
+
class: v([{ "mn-small": e.type !== "short" }, "flex-v-center flex-nowrap flex"])
|
102
|
+
}, [
|
103
|
+
g("div", X, [
|
104
|
+
e.type !== "short" ? (r(), n("span", Z, m(k(i)) + " | ", 1)) : c("", !0),
|
105
|
+
g("span", ee, m(k(u)), 1)
|
106
|
+
]),
|
107
|
+
e.type === "short" ? (r(), n("span", te, m(k(p)), 1)) : c("", !0)
|
108
|
+
], 2),
|
109
|
+
e.type !== "short" ? (r(), n("div", ae, [
|
110
|
+
e.type !== "short" ? (r(), n("h3", re, m(e.event.name), 1)) : c("", !0),
|
111
|
+
e.event.status === "draft" ? (r(), n("div", ne, m(e.event.status), 1)) : c("", !0)
|
112
|
+
])) : c("", !0),
|
113
|
+
e.type !== "short" ? (r(), n("p", se, m(e.event.description), 1)) : c("", !0),
|
114
|
+
F(a.$slots, "default"),
|
115
|
+
e.type !== "short" && e.event.tags.length > 0 ? (r(), T(J, {
|
116
|
+
key: 2,
|
117
|
+
chips: e.event.tags
|
118
|
+
}, null, 8, ["chips"])) : c("", !0)
|
119
|
+
], 2)
|
120
|
+
], 2));
|
121
|
+
}
|
122
|
+
}, ie = {}, ce = {
|
123
|
+
width: "100%",
|
124
|
+
height: "20rem",
|
125
|
+
xmlns: "http://www.w3.org/2000/svg"
|
126
|
+
}, ue = /* @__PURE__ */ I('<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), oe = [
|
127
|
+
ue
|
128
|
+
];
|
129
|
+
function de(e, t) {
|
130
|
+
return r(), n("svg", ce, oe);
|
131
|
+
}
|
132
|
+
const me = /* @__PURE__ */ H(ie, [["render", de]]), $ = Y.create({ baseURL: process.env.API_URL, withCredentials: !0 }), y = N({
|
133
|
+
all: [],
|
134
|
+
filter: {
|
135
|
+
// query
|
136
|
+
tags: [],
|
137
|
+
period: "",
|
138
|
+
date: null
|
139
|
+
// pagination
|
140
|
+
},
|
141
|
+
pagination: {
|
142
|
+
page: 1,
|
143
|
+
perPage: 18
|
144
|
+
},
|
145
|
+
// Sort
|
146
|
+
sort: {
|
147
|
+
current: "popularity",
|
148
|
+
ascending: !1
|
149
|
+
},
|
150
|
+
current: {
|
151
|
+
_id: "",
|
152
|
+
cover: "",
|
153
|
+
url: "",
|
154
|
+
status: "",
|
155
|
+
name: "",
|
156
|
+
tags: [],
|
157
|
+
date: {
|
158
|
+
start: null,
|
159
|
+
false: null
|
160
|
+
},
|
161
|
+
views: 0,
|
162
|
+
content: []
|
163
|
+
}
|
164
|
+
});
|
165
|
+
async function z(e = {}) {
|
166
|
+
e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.status && (e.params = { status: e.status }), e.url && (e.params = { url: e.url }), e.period && (e.params.period = e.period), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.date && (e.params.date = e.date), e.participant && (e.params.participant = e.participant), e.owner && (e.params.owner = e.owner), e.creator && (e.params.creator = e.creator), e.user && (e.params.user = e.user), e.sortOrder && (e.params.sortOrder = e.sortOrder), e.sortParam && (e.params.sortParam = e.sortParam), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
|
167
|
+
try {
|
168
|
+
console.log("Request params:" + e.params);
|
169
|
+
const t = await $.get("/api/events/read", { params: e.params });
|
170
|
+
return console.log(e.params), e.url ? w(t.data, "current") : w(t.data, "all"), Promise.resolve(t.data);
|
171
|
+
} catch (t) {
|
172
|
+
return S(t), Promise.reject(t);
|
173
|
+
}
|
174
|
+
}
|
175
|
+
async function fe(e) {
|
176
|
+
return $.post("/api/events/create", e).then(
|
177
|
+
(t) => (w(t.data, "current"), Promise.resolve(t.data)),
|
178
|
+
(t) => (S(t), Promise.reject(t))
|
179
|
+
);
|
180
|
+
}
|
181
|
+
async function ge(e) {
|
182
|
+
return $.post("/api/events/update", e).then(
|
183
|
+
(t) => (w(t.data, "current"), Promise.resolve(t.data)),
|
184
|
+
(t) => (S(t), Promise.reject(t))
|
185
|
+
);
|
186
|
+
}
|
187
|
+
async function he(e) {
|
188
|
+
return await $.delete(`/api/events/delete/${e}`).then(
|
189
|
+
(t) => {
|
190
|
+
const l = y.all.findIndex((i) => i._id === e);
|
191
|
+
return l !== -1 && y.all.splice(l, 1), Promise.resolve(t.data);
|
192
|
+
},
|
193
|
+
(t) => (S(t), Promise.reject(t))
|
194
|
+
);
|
195
|
+
}
|
196
|
+
function w(e, t) {
|
197
|
+
y[t] = e;
|
198
|
+
}
|
199
|
+
function ve() {
|
200
|
+
y.current = {
|
201
|
+
_id: "",
|
202
|
+
cover: "",
|
203
|
+
url: "",
|
204
|
+
status: "",
|
205
|
+
name: "",
|
206
|
+
tags: [],
|
207
|
+
date: {
|
208
|
+
start: null,
|
209
|
+
false: null
|
210
|
+
},
|
211
|
+
views: 0,
|
212
|
+
content: []
|
213
|
+
};
|
214
|
+
}
|
215
|
+
L(y, (e, t) => {
|
216
|
+
});
|
217
|
+
const Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
218
|
+
__proto__: null,
|
219
|
+
clean: ve,
|
220
|
+
create: fe,
|
221
|
+
read: z,
|
222
|
+
remove: he,
|
223
|
+
set: w,
|
224
|
+
state: y,
|
225
|
+
update: ge
|
226
|
+
}, Symbol.toStringTag, { value: "Module" })), ye = { class: "feed" }, Se = {
|
227
|
+
__name: "Feed",
|
228
|
+
props: {
|
229
|
+
category: {
|
230
|
+
type: String,
|
231
|
+
default: null
|
232
|
+
},
|
233
|
+
selectedDate: {
|
234
|
+
type: String,
|
235
|
+
default: null
|
236
|
+
},
|
237
|
+
organization: {
|
238
|
+
type: String,
|
239
|
+
default: null
|
240
|
+
},
|
241
|
+
owner: {
|
242
|
+
type: String,
|
243
|
+
default: null
|
244
|
+
},
|
245
|
+
creator: {
|
246
|
+
type: String,
|
247
|
+
default: null
|
248
|
+
},
|
249
|
+
user: {
|
250
|
+
type: [String, Number],
|
251
|
+
default: null
|
252
|
+
},
|
253
|
+
sortOrder: {
|
254
|
+
type: String,
|
255
|
+
default: "desc"
|
256
|
+
},
|
257
|
+
participant: {
|
258
|
+
type: String,
|
259
|
+
default: null
|
260
|
+
},
|
261
|
+
period: {
|
262
|
+
type: String,
|
263
|
+
default: null
|
264
|
+
},
|
265
|
+
status: {
|
266
|
+
type: String,
|
267
|
+
default: null
|
268
|
+
}
|
269
|
+
},
|
270
|
+
setup(e) {
|
271
|
+
const t = e, l = h([]), i = h(!1), u = h(!0), p = h(0), a = h(20), d = async () => {
|
272
|
+
if (i.value) {
|
273
|
+
p.value += a.value;
|
274
|
+
const s = await z({
|
275
|
+
skip: p.value,
|
276
|
+
limit: a.value,
|
277
|
+
category: t.category,
|
278
|
+
sortOrder: t.sortOrder,
|
279
|
+
participant: t.participant,
|
280
|
+
creator: t.creator,
|
281
|
+
user: t.user,
|
282
|
+
date: t.selectedDate,
|
283
|
+
owner: t.owner,
|
284
|
+
organization: t.organization,
|
285
|
+
period: t.period,
|
286
|
+
status: t.status
|
287
|
+
});
|
288
|
+
s.length === 0 ? i.value = !1 : i.value = !0, l.value = [...l.value, ...s];
|
289
|
+
}
|
290
|
+
};
|
291
|
+
return j(async () => {
|
292
|
+
u.value = !0, console.log(t.selectedDate);
|
293
|
+
const s = await z({
|
294
|
+
skip: p.value,
|
295
|
+
limit: a.value,
|
296
|
+
category: t.category,
|
297
|
+
participant: t.participant,
|
298
|
+
sortOrder: t.sortOrder,
|
299
|
+
user: t.user,
|
300
|
+
owner: t.owner,
|
301
|
+
creator: t.creator,
|
302
|
+
date: t.selectedDate,
|
303
|
+
organization: t.organization,
|
304
|
+
period: t.period,
|
305
|
+
status: t.status
|
306
|
+
});
|
307
|
+
s.length === 0 ? i.value = !1 : i.value = !0, l.value = s, u.value = !1;
|
308
|
+
}), (s, U) => (r(), n("section", ye, [
|
309
|
+
C(O, {
|
310
|
+
tag: "ul",
|
311
|
+
name: "fade",
|
312
|
+
class: "o-hidden bg-grey radius-big"
|
313
|
+
}, {
|
314
|
+
default: P(() => [
|
315
|
+
u.value ? (r(!0), n(_, { key: 0 }, M(a.value, (o) => (r(), T(me, { key: o }))), 128)) : c("", !0)
|
316
|
+
]),
|
317
|
+
_: 1
|
318
|
+
}),
|
319
|
+
C(R, { name: "fade" }, {
|
320
|
+
default: P(() => [
|
321
|
+
!u.value && l.value.length < 1 ? (r(), T(V, {
|
322
|
+
key: 0,
|
323
|
+
title: "No Events Found",
|
324
|
+
description: "Currently, there are no events available. Please check back later.",
|
325
|
+
class: "pd-medium mn-thin bg-grey radius-big"
|
326
|
+
})) : c("", !0)
|
327
|
+
]),
|
328
|
+
_: 1
|
329
|
+
}),
|
330
|
+
C(O, {
|
331
|
+
tag: "ul",
|
332
|
+
name: "fade",
|
333
|
+
class: "container"
|
334
|
+
}, {
|
335
|
+
default: P(() => [
|
336
|
+
!u.value && l.value.length > 0 ? (r(!0), n(_, { key: 0 }, M(l.value, (o, b) => (r(), T(le, {
|
337
|
+
onClick: (x) => s.$router.push({ name: "Event", params: { url: o.url } }),
|
338
|
+
key: o._id,
|
339
|
+
event: o,
|
340
|
+
owner: e.user,
|
341
|
+
type: "normal",
|
342
|
+
class: v(["bg-grey radius-big mn-medium", {
|
343
|
+
"br-b br-solid br-black-transp-10": b !== l.value.length - 1
|
344
|
+
}])
|
345
|
+
}, null, 8, ["onClick", "event", "owner", "class"]))), 128)) : c("", !0),
|
346
|
+
i.value && l.value.length > 0 ? (r(), n("button", {
|
347
|
+
key: 1,
|
348
|
+
onClick: d,
|
349
|
+
class: "w-100 bg-main button"
|
350
|
+
}, "Load more")) : c("", !0)
|
351
|
+
]),
|
352
|
+
_: 1
|
353
|
+
})
|
354
|
+
]));
|
355
|
+
}
|
356
|
+
};
|
357
|
+
export {
|
358
|
+
me as S,
|
359
|
+
Se as _,
|
360
|
+
le as a,
|
361
|
+
fe as b,
|
362
|
+
ve as c,
|
363
|
+
Te as e,
|
364
|
+
z as r,
|
365
|
+
y as s,
|
366
|
+
ge as u
|
367
|
+
};
|