@ozdao/prometheus-framework 0.0.78 → 0.0.80
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-451d2614.mjs +80 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-5ea8b4fa.js +1 -0
- package/dist/ButtonFollow-0d83a04a.mjs +130 -0
- package/dist/ButtonFollow-f9c5dc7a.js +1 -0
- package/dist/CardHeader-2d7e5d49.mjs +76 -0
- package/dist/CardHeader-dff9c71a.js +1 -0
- package/dist/Comments-b6e32958.js +1 -0
- package/dist/Comments-d2a8fd0f.mjs +76 -0
- package/dist/EditProductImages-1d4b44a9.mjs +236 -0
- package/dist/EditProductImages-d9228ad0.js +1 -0
- package/dist/EmptyState-34d85f10.mjs +36 -0
- package/dist/EmptyState-7658d7d6.js +1 -0
- package/dist/Feed-932d976d.js +1 -0
- package/dist/Feed-962e009b.js +1 -0
- package/dist/Feed-c93012c7.mjs +346 -0
- package/dist/Feed-d8e33aed.mjs +397 -0
- package/dist/PlaceholderUserpic-1a6cf257.mjs +28 -0
- package/dist/PlaceholderUserpic-3bf126ee.js +1 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-8981c189.mjs +280 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-931f265a.js +1 -0
- package/dist/Product-3c64a352.mjs +904 -0
- package/dist/Product-67efba5c.js +7 -0
- package/dist/ProductEdit-04760699.js +1 -0
- package/dist/ProductEdit-39adf62f.mjs +113 -0
- package/dist/ProfileBlogposts-00424109.js +1 -0
- package/dist/ProfileBlogposts-65a7a5e0.mjs +56 -0
- package/dist/ProfileComments-5884d09f.mjs +43 -0
- package/dist/ProfileComments-677731b3.js +1 -0
- package/dist/ProfileEvents-85a88674.mjs +55 -0
- package/dist/ProfileEvents-b5431cd6.js +1 -0
- package/dist/ProfileLikes-4a57f637.mjs +43 -0
- package/dist/ProfileLikes-8ccf6815.js +1 -0
- package/dist/ProfileOrganizations-5d681498.mjs +202 -0
- package/dist/ProfileOrganizations-c7688210.js +1 -0
- package/dist/Publics-889c25fc.js +1 -0
- package/dist/Publics-8bea4201.mjs +44 -0
- package/dist/UploadImage-34bc4a3f.mjs +99 -0
- package/dist/UploadImage-75b1a18a.js +1 -0
- package/dist/auth-18f80fef.mjs +1501 -0
- package/dist/auth-78fd9408.js +8 -0
- package/dist/auth.client.cjs +5 -5
- package/dist/auth.client.js +5 -5
- package/dist/auth.validation-6bccabd6.mjs +20 -0
- package/dist/auth.validation-a18510e8.js +1 -0
- package/dist/community.client.cjs +8 -9
- package/dist/community.client.js +568 -552
- package/dist/community.server.js +3 -2
- package/dist/community.server.mjs +3 -2
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +10 -10
- package/dist/files.client.cjs +1 -0
- package/dist/files.client.js +1 -0
- package/dist/files.server.js +5 -2
- package/dist/files.server.mjs +5 -2
- package/dist/main.css +1 -1
- package/dist/organizations-0e9ff7ca.mjs +319 -0
- package/dist/organizations-c77ea9d0.js +1 -0
- package/dist/organizations.client.cjs +2 -2
- package/dist/organizations.client.js +26 -26
- package/dist/prometheus-framework.cjs.js +3 -3
- package/dist/prometheus-framework.es.js +8 -8
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +10 -10
- package/package.json +3 -3
- package/src/modules/community/components/elements/ImageUpload.vue +7 -5
- package/src/modules/community/components/pages/BlogPost.vue +12 -15
- package/src/modules/community/components/pages/CreateBlogPost.vue +14 -1
- package/src/modules/community/controllers/blog.controller.js +2 -1
- package/src/modules/files/controllers/files.controller.js +5 -1
- package/src/modules/files/routes/files.routes.js +3 -1
@@ -0,0 +1,36 @@
|
|
1
|
+
import { openBlock as a, createElementBlock as c, createElementVNode as l, toDisplayString as e, createCommentVNode as o } from "vue";
|
2
|
+
const s = { class: "mn-regular" }, r = { class: "mn-small t-transp p-medium" }, d = {
|
3
|
+
__name: "EmptyState",
|
4
|
+
props: {
|
5
|
+
title: {
|
6
|
+
type: String,
|
7
|
+
default: "У вас еще нет организации"
|
8
|
+
},
|
9
|
+
description: {
|
10
|
+
type: String,
|
11
|
+
default: "Для использования сервиса, вам необходимо добавить вашу организацию."
|
12
|
+
},
|
13
|
+
action: {
|
14
|
+
type: String
|
15
|
+
},
|
16
|
+
callback: {
|
17
|
+
type: Function,
|
18
|
+
default: () => {
|
19
|
+
}
|
20
|
+
}
|
21
|
+
},
|
22
|
+
setup(t) {
|
23
|
+
return (u, n) => (a(), c("section", null, [
|
24
|
+
l("h3", s, e(t.title), 1),
|
25
|
+
l("p", r, e(t.description), 1),
|
26
|
+
t.action ? (a(), c("button", {
|
27
|
+
key: 0,
|
28
|
+
onClick: n[0] || (n[0] = (...i) => t.callback && t.callback(...i)),
|
29
|
+
class: "t-white bg-second w-100 button"
|
30
|
+
}, e(t.action), 1)) : o("", !0)
|
31
|
+
]));
|
32
|
+
}
|
33
|
+
};
|
34
|
+
export {
|
35
|
+
d as _
|
36
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const t=require("vue");const l={class:"mn-regular"},a={class:"mn-small t-transp p-medium"},i={__name:"EmptyState",props:{title:{type:String,default:"У вас еще нет организации"},description:{type:String,default:"Для использования сервиса, вам необходимо добавить вашу организацию."},action:{type:String},callback:{type:Function,default:()=>{}}},setup(e){return(o,n)=>(t.openBlock(),t.createElementBlock("section",null,[t.createElementVNode("h3",l,t.toDisplayString(e.title),1),t.createElementVNode("p",a,t.toDisplayString(e.description),1),e.action?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:n[0]||(n[0]=(...c)=>e.callback&&e.callback(...c)),class:"t-white bg-second w-100 button"},t.toDisplayString(e.action),1)):t.createCommentVNode("",!0)]))}};exports._sfc_main=i;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),b=require("./auth-78fd9408.js"),C=require("./CardHeader-dff9c71a.js"),$=require("vue-router"),u=require("./globals-d7a54bb4.js"),f=b.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 v(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.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 _(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 w(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 S(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 B(){c.current={_id:"",url:"",status:"",name:"",tags:[],author:"",owner:"",date:"",views:0,content:[]}}function V(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 j=Object.freeze(Object.defineProperty({__proto__:null,blockAdd:V,clean:B,create:_,read:v,remove:S,set:g,state:c,update:w},Symbol.toStringTag,{value:"Module"})),R={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"},D={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",D,e.toDisplayString(o.status),1)):e.createCommentVNode("",!0)])}const P=b._export_sfc(R,[["render",I]]),y=b.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),d=e.reactive({reactions:[],error:null}),k={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 q=Object.freeze(Object.defineProperty({__proto__:null,actions:k,mutations:O,state:d},Symbol.toStringTag,{value:"Module"})),A={class:"t-semi br-top-dark flex-nowrap flex-nojustify flex"},U=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),M={class:"cursor-pointer"},F=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),E={__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 k.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 k.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",A,[e.createTextVNode(" 👁️ "+e.toDisplayString(t.blogpost.views)+" ",1),U,e.createElementVNode("div",M,[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)]),F,e.createTextVNode(" 💬 "+e.toDisplayString(t.blogpost.numberOfComments),1)]))}},H={class:"bg-grey radius-big"},G=["src"],J={class:"pd-t-zero pd-medium"},K={key:0,class:"mn-small t-transp p-big"},x={__name:"CardBlogpost",props:["blogpost","user","type"],setup(t){const r=t,o=$.useRouter(),a=e.computed(()=>r.blogpost.content.find(l=>l.type.name==="ImageUpload")),s=e.computed(()=>r.blogpost.content.find(l=>l.type.name==="Textarea"));return(l,i)=>(e.openBlock(),e.createElementBlock("article",H,[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.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt},null,8,["class","owner","creator","date"]),e.unref(a)&&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,G)):e.createCommentVNode("",!0),e.createElementVNode("section",J,[e.createElementVNode("h3",{onClick:i[0]||(i[0]=m=>e.unref(o).push({name:"BlogPost",params:{url:t.blogpost.url}})),class:"cursor-pointer mn-thin"},e.toDisplayString(t.blogpost.name),1),e.unref(s)&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("p",K,e.toDisplayString(e.unref(s).content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")]),e.createVNode(E,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])]))}},Q={class:"feed"},W={key:1},X={__name:"Feed",props:{category:{type:String,default:null},owner:{type:String,default:null},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(2);const m=async()=>{if(a.value){l.value+=i.value;const n=await v({skip:l.value,limit:i.value,category:r.category,user:r.user,owner:r.owner,period:r.period});n.length===0&&(a.value=!1),o.value=[...o.value,...n]}};return e.onMounted(async()=>{const n=await v({skip:l.value,limit:i.value,category:r.category,user:r.user,owner:r.owner,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",Q,[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(N._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",W,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,h=>(e.openBlock(),e.createBlock(x,{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=X;exports._sfc_main$1=x;exports._sfc_main$2=E;exports.blogposts=j;exports.clean=B;exports.create=_;exports.reactions=q;exports.read=v;exports.state=c;exports.update=w;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),E=require("./EmptyState-7658d7d6.js"),B=require("./CardHeader-dff9c71a.js"),b=require("./auth-78fd9408.js"),S=require("vue-router"),y=require("./globals-d7a54bb4.js"),T={key:0,class:"o-hidden bg-grey mn-small w-100"},N=["src"],D=["src"],U={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},V={key:0,class:"t-semi"},$={class:"t-semi"},z={key:0,class:"t-semi uppercase"},P={key:0,class:"cursor-pointer mn-thin"},_={key:1,class:"mn-small p-big"},M={key:2,class:"flex-v-center flex-nowrap flex"},C={__name:"CardEvent",props:["event","user","short","type"],setup(t){const r=t;e.ref(new Date),S.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,i=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())-i;if(c<0)return"Finished";if(c===0)return"Starting Now";{const g=Math.floor(c/1e3),h=Math.floor(g/60),k=Math.floor(h/60),w=Math.floor(k/24);return w>0?`${w} days until event`:k>0?`${k} hours until event`:h>0?`${h} minutes until event`:`${g} seconds until event`}}),l=e.computed(()=>{const a=new Date(r.event.date.start),i={day:"2-digit",month:"2-digit"};return a.toLocaleDateString(void 0,i)}),u=e.computed(()=>{const a=new Date(r.event.date.start),i=new Date(r.event.date.end),n=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(a),m=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(i);return`${n}-${m}`}),d=e.computed(()=>{const a=r.event.name;return a.length>26?`${a.substring(0,22)}…`:a});return(a,i)=>(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",T,[e.createElementVNode("img",{src:t.event.cover,alt:"Event image",class:"z-index-1 d-block mn-auto h-20r"},null,8,N),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,D)])):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",U,[t.type!=="short"?(e.openBlock(),e.createElementBlock("span",V,e.toDisplayString(e.unref(l))+" | ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",$,e.toDisplayString(e.unref(u)),1)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",P,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",_,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.event.tags,(n,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["pd-thin radius-small t-semi bg-white",{"mn-r-thin":m!==t.event.tags.length-1}])},e.toDisplayString(n),3))),256))])):e.createCommentVNode("",!0)],2)],2))}},F={},O={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},I=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),L=[I];function j(t,r){return e.openBlock(),e.createElementBlock("svg",O,L)}const x=b._export_sfc(F,[["render",j]]),p=b.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),o=e.reactive({all:[],filter:{tags:[],period:"",date:null},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",url:"",status:"",name:"",tags:[],owner:{},date:"",views:0,content:[]}});async function v(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.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 p.get("/api/events/read",{params:t.params});return console.log(t.params),t.url?f(r.data,"current"):f(r.data,"all"),Promise.resolve(r.data)}catch(r){return y.setError(r),Promise.reject(r)}}async function q(t){return p.post("/api/events/create",t).then(r=>(f(r.data,"current"),Promise.resolve(r.data)),r=>(y.setError(r),Promise.reject(r)))}async function R(t){return p.post("/api/events/update",t).then(r=>(f(r.data,"current"),Promise.resolve(r.data)),r=>(y.setError(r),Promise.reject(r)))}async function H(t){return await p.delete(`/api/events/delete/${t}`).then(r=>{const s=o.all.findIndex(l=>l._id===t);return s!==-1&&o.all.splice(s,1),Promise.resolve(r.data)},r=>(y.setError(r),Promise.reject(r)))}function f(t,r){o[r]=t}function A(){o.current={_id:"",url:"",status:"",name:"",tags:[],author:"",owner:"",date:"",views:0,content:[]}}function G(t){const r={order:o.project.content.length+1,type:t.type,data:t.data,class:t.class,content:t.content};o.project.content.push(r)}e.watch(o,(t,r)=>{});const Y=Object.freeze(Object.defineProperty({__proto__:null,blockAdd:G,clean:A,create:q,read:v,remove:H,set:f,state:o,update:R},Symbol.toStringTag,{value:"Module"})),J={class:"feed"},K={__name:"Feed",props:{category:{type:String,default:null},selectedDate:{type:String,default:null},organization:{type:String,default:null},owner:{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),u=e.ref(!0),d=e.ref(0),a=e.ref(20),i=async()=>{if(l.value){d.value+=a.value;const n=await v({skip:d.value,limit:a.value,category:r.category,sortOrder:r.sortOrder,participant:r.participant,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()=>{u.value=!0,console.log(r.selectedDate);const n=await v({skip:d.value,limit:a.value,category:r.category,participant:r.participant,sortOrder:r.sortOrder,user:r.user,owner:r.owner,date:r.selectedDate,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=n,u.value=!1}),(n,m)=>(e.openBlock(),e.createElementBlock("section",J,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[u.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(()=>[!u.value&&s.value.length<1?(e.openBlock(),e.createBlock(E._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(()=>[!u.value&&s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(c,g)=>(e.openBlock(),e.createBlock(C,{onClick:h=>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":g!==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:i,class:"w-100 bg-main button"},"Load more")):e.createCommentVNode("",!0)]),_:1})]))}};exports.SkeletonEvent=x;exports._sfc_main=K;exports._sfc_main$1=C;exports.events=Y;exports.read=v;exports.state=o;
|
@@ -0,0 +1,346 @@
|
|
1
|
+
import { ref as v, computed as f, openBlock as n, createElementBlock as s, normalizeClass as y, createVNode as T, unref as C, createElementVNode as g, createCommentVNode as c, toDisplayString as h, renderSlot as O, Fragment as _, renderList as M, createStaticVNode as F, reactive as I, watch as j, onMounted as L, TransitionGroup as N, withCtx as $, createBlock as P, Transition as R } from "vue";
|
2
|
+
import { _ as V } from "./EmptyState-34d85f10.mjs";
|
3
|
+
import { _ as B } from "./CardHeader-2d7e5d49.mjs";
|
4
|
+
import { _ as H, a as A } from "./auth-18f80fef.mjs";
|
5
|
+
import { useRouter as Y } from "vue-router";
|
6
|
+
import { s as S } from "./globals-f538c0ef.mjs";
|
7
|
+
const q = {
|
8
|
+
key: 0,
|
9
|
+
class: "o-hidden bg-grey mn-small w-100"
|
10
|
+
}, G = ["src"], J = ["src"], K = { class: "w-max mn-r-thin pd-thin radius-small t-semi bg-main" }, Q = {
|
11
|
+
key: 0,
|
12
|
+
class: "t-semi"
|
13
|
+
}, W = { class: "t-semi" }, X = {
|
14
|
+
key: 0,
|
15
|
+
class: "t-semi uppercase"
|
16
|
+
}, Z = {
|
17
|
+
key: 0,
|
18
|
+
class: "cursor-pointer mn-thin"
|
19
|
+
}, ee = {
|
20
|
+
key: 1,
|
21
|
+
class: "mn-small p-big"
|
22
|
+
}, te = {
|
23
|
+
key: 2,
|
24
|
+
class: "flex-v-center flex-nowrap flex"
|
25
|
+
}, ae = {
|
26
|
+
__name: "CardEvent",
|
27
|
+
props: ["event", "user", "short", "type"],
|
28
|
+
setup(e) {
|
29
|
+
const t = e;
|
30
|
+
v(/* @__PURE__ */ new Date()), Y(), f(() => t.event.content.find((a) => a.type.name === "ImageUpload")), f(() => t.event.content.find((a) => a.type.name === "Textarea"));
|
31
|
+
const l = f(() => {
|
32
|
+
const a = /* @__PURE__ */ new Date(), o = Date.UTC(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate(), a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds()), r = new Date(t.event.date.start), u = Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate(), r.getUTCHours(), r.getUTCMinutes(), r.getUTCSeconds()) - o;
|
33
|
+
if (u < 0)
|
34
|
+
return "Finished";
|
35
|
+
if (u === 0)
|
36
|
+
return "Starting Now";
|
37
|
+
{
|
38
|
+
const k = Math.floor(u / 1e3), x = Math.floor(k / 60), D = Math.floor(x / 60), E = Math.floor(D / 24);
|
39
|
+
return E > 0 ? `${E} days until event` : D > 0 ? `${D} hours until event` : x > 0 ? `${x} minutes until event` : `${k} seconds until event`;
|
40
|
+
}
|
41
|
+
}), i = f(() => {
|
42
|
+
const a = new Date(t.event.date.start), o = { day: "2-digit", month: "2-digit" };
|
43
|
+
return a.toLocaleDateString(void 0, o);
|
44
|
+
}), m = f(() => {
|
45
|
+
const a = new Date(t.event.date.start), o = new Date(t.event.date.end), r = new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).format(a), w = new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).format(o);
|
46
|
+
return `${r}-${w}`;
|
47
|
+
}), p = f(() => {
|
48
|
+
const a = t.event.name;
|
49
|
+
return a.length > 26 ? `${a.substring(0, 22)}…` : a;
|
50
|
+
});
|
51
|
+
return (a, o) => (n(), s("article", {
|
52
|
+
class: y({
|
53
|
+
"flex-nowrap flex-v-center flex": e.type === "short"
|
54
|
+
})
|
55
|
+
}, [
|
56
|
+
T(B, {
|
57
|
+
class: y({
|
58
|
+
"mn-small pd-medium": e.type !== "short",
|
59
|
+
"flex-child-order-last flex-child mn-l-small": e.type === "short"
|
60
|
+
}),
|
61
|
+
owner: e.event.owner,
|
62
|
+
creator: e.event.creator,
|
63
|
+
members: e.event.numberOfTickets,
|
64
|
+
membersPhotos: e.event.participantsPhotos,
|
65
|
+
type: e.type,
|
66
|
+
dateFormatted: C(l)
|
67
|
+
}, null, 8, ["class", "owner", "creator", "members", "membersPhotos", "type", "dateFormatted"]),
|
68
|
+
e.event.cover && e.type !== "short" ? (n(), s("div", q, [
|
69
|
+
g("img", {
|
70
|
+
src: e.event.cover,
|
71
|
+
alt: "Event image",
|
72
|
+
class: "z-index-1 d-block mn-auto h-20r"
|
73
|
+
}, null, 8, G),
|
74
|
+
g("img", {
|
75
|
+
src: e.event.cover,
|
76
|
+
alt: "Event image",
|
77
|
+
class: "z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",
|
78
|
+
style: { transform: "scale(1.5)", filter: "blur(2rem)", "-webkit-filter": "blur(2rem)" }
|
79
|
+
}, null, 8, J)
|
80
|
+
])) : c("", !0),
|
81
|
+
g("section", {
|
82
|
+
class: y(["w-100", { "pd-t-zero pd-medium": e.type !== "short" }])
|
83
|
+
}, [
|
84
|
+
g("div", {
|
85
|
+
class: y([{ "mn-small": e.type !== "short" }, "flex-v-center flex-nowrap flex"])
|
86
|
+
}, [
|
87
|
+
g("div", K, [
|
88
|
+
e.type !== "short" ? (n(), s("span", Q, h(C(i)) + " | ", 1)) : c("", !0),
|
89
|
+
g("span", W, h(C(m)), 1)
|
90
|
+
]),
|
91
|
+
e.type === "short" ? (n(), s("span", X, h(C(p)), 1)) : c("", !0)
|
92
|
+
], 2),
|
93
|
+
e.type !== "short" ? (n(), s("h3", Z, h(e.event.name), 1)) : c("", !0),
|
94
|
+
e.type !== "short" ? (n(), s("p", ee, h(e.event.description), 1)) : c("", !0),
|
95
|
+
O(a.$slots, "default"),
|
96
|
+
e.type !== "short" ? (n(), s("div", te, [
|
97
|
+
(n(!0), s(_, null, M(e.event.tags, (r, w) => (n(), s("div", {
|
98
|
+
class: y(["pd-thin radius-small t-semi bg-white", { "mn-r-thin": w !== e.event.tags.length - 1 }])
|
99
|
+
}, h(r), 3))), 256))
|
100
|
+
])) : c("", !0)
|
101
|
+
], 2)
|
102
|
+
], 2));
|
103
|
+
}
|
104
|
+
}, re = {}, ne = {
|
105
|
+
width: "100%",
|
106
|
+
height: "20rem",
|
107
|
+
xmlns: "http://www.w3.org/2000/svg"
|
108
|
+
}, se = /* @__PURE__ */ F('<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), le = [
|
109
|
+
se
|
110
|
+
];
|
111
|
+
function ie(e, t) {
|
112
|
+
return n(), s("svg", ne, le);
|
113
|
+
}
|
114
|
+
const ce = /* @__PURE__ */ H(re, [["render", ie]]), U = A.create({ baseURL: process.env.API_URL, withCredentials: !0 }), d = I({
|
115
|
+
all: [],
|
116
|
+
filter: {
|
117
|
+
// query
|
118
|
+
tags: [],
|
119
|
+
period: "",
|
120
|
+
date: null
|
121
|
+
// pagination
|
122
|
+
},
|
123
|
+
pagination: {
|
124
|
+
page: 1,
|
125
|
+
perPage: 18
|
126
|
+
},
|
127
|
+
// Sort
|
128
|
+
sort: {
|
129
|
+
current: "popularity",
|
130
|
+
ascending: !1
|
131
|
+
},
|
132
|
+
current: {
|
133
|
+
_id: "",
|
134
|
+
url: "",
|
135
|
+
status: "",
|
136
|
+
name: "",
|
137
|
+
tags: [],
|
138
|
+
owner: {},
|
139
|
+
date: "",
|
140
|
+
views: 0,
|
141
|
+
content: []
|
142
|
+
}
|
143
|
+
});
|
144
|
+
async function z(e = {}) {
|
145
|
+
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.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;
|
146
|
+
try {
|
147
|
+
console.log("Request params:" + e.params);
|
148
|
+
const t = await U.get("/api/events/read", { params: e.params });
|
149
|
+
return console.log(e.params), e.url ? b(t.data, "current") : b(t.data, "all"), Promise.resolve(t.data);
|
150
|
+
} catch (t) {
|
151
|
+
return S(t), Promise.reject(t);
|
152
|
+
}
|
153
|
+
}
|
154
|
+
async function ue(e) {
|
155
|
+
return U.post("/api/events/create", e).then(
|
156
|
+
(t) => (b(t.data, "current"), Promise.resolve(t.data)),
|
157
|
+
(t) => (S(t), Promise.reject(t))
|
158
|
+
);
|
159
|
+
}
|
160
|
+
async function oe(e) {
|
161
|
+
return U.post("/api/events/update", e).then(
|
162
|
+
(t) => (b(t.data, "current"), Promise.resolve(t.data)),
|
163
|
+
(t) => (S(t), Promise.reject(t))
|
164
|
+
);
|
165
|
+
}
|
166
|
+
async function de(e) {
|
167
|
+
return await U.delete(`/api/events/delete/${e}`).then(
|
168
|
+
(t) => {
|
169
|
+
const l = d.all.findIndex((i) => i._id === e);
|
170
|
+
return l !== -1 && d.all.splice(l, 1), Promise.resolve(t.data);
|
171
|
+
},
|
172
|
+
(t) => (S(t), Promise.reject(t))
|
173
|
+
);
|
174
|
+
}
|
175
|
+
function b(e, t) {
|
176
|
+
d[t] = e;
|
177
|
+
}
|
178
|
+
function me() {
|
179
|
+
d.current = {
|
180
|
+
_id: "",
|
181
|
+
url: "",
|
182
|
+
status: "",
|
183
|
+
name: "",
|
184
|
+
tags: [],
|
185
|
+
author: "",
|
186
|
+
owner: "",
|
187
|
+
date: "",
|
188
|
+
views: 0,
|
189
|
+
content: []
|
190
|
+
};
|
191
|
+
}
|
192
|
+
function fe(e) {
|
193
|
+
const t = {
|
194
|
+
order: d.project.content.length + 1,
|
195
|
+
type: e.type,
|
196
|
+
data: e.data,
|
197
|
+
class: e.class,
|
198
|
+
content: e.content
|
199
|
+
};
|
200
|
+
d.project.content.push(t);
|
201
|
+
}
|
202
|
+
j(d, (e, t) => {
|
203
|
+
});
|
204
|
+
const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
205
|
+
__proto__: null,
|
206
|
+
blockAdd: fe,
|
207
|
+
clean: me,
|
208
|
+
create: ue,
|
209
|
+
read: z,
|
210
|
+
remove: de,
|
211
|
+
set: b,
|
212
|
+
state: d,
|
213
|
+
update: oe
|
214
|
+
}, Symbol.toStringTag, { value: "Module" })), ge = { class: "feed" }, xe = {
|
215
|
+
__name: "Feed",
|
216
|
+
props: {
|
217
|
+
category: {
|
218
|
+
type: String,
|
219
|
+
default: null
|
220
|
+
},
|
221
|
+
selectedDate: {
|
222
|
+
type: String,
|
223
|
+
default: null
|
224
|
+
},
|
225
|
+
organization: {
|
226
|
+
type: String,
|
227
|
+
default: null
|
228
|
+
},
|
229
|
+
owner: {
|
230
|
+
type: String,
|
231
|
+
default: null
|
232
|
+
},
|
233
|
+
user: {
|
234
|
+
type: [String, Number],
|
235
|
+
default: null
|
236
|
+
},
|
237
|
+
sortOrder: {
|
238
|
+
type: String,
|
239
|
+
default: "desc"
|
240
|
+
},
|
241
|
+
participant: {
|
242
|
+
type: String,
|
243
|
+
default: null
|
244
|
+
},
|
245
|
+
period: {
|
246
|
+
type: String,
|
247
|
+
default: null
|
248
|
+
},
|
249
|
+
status: {
|
250
|
+
type: String,
|
251
|
+
default: null
|
252
|
+
}
|
253
|
+
},
|
254
|
+
setup(e) {
|
255
|
+
const t = e, l = v([]), i = v(!1), m = v(!0), p = v(0), a = v(20), o = async () => {
|
256
|
+
if (i.value) {
|
257
|
+
p.value += a.value;
|
258
|
+
const r = await z({
|
259
|
+
skip: p.value,
|
260
|
+
limit: a.value,
|
261
|
+
category: t.category,
|
262
|
+
sortOrder: t.sortOrder,
|
263
|
+
participant: t.participant,
|
264
|
+
user: t.user,
|
265
|
+
date: t.selectedDate,
|
266
|
+
owner: t.owner,
|
267
|
+
organization: t.organization,
|
268
|
+
period: t.period,
|
269
|
+
status: t.status
|
270
|
+
});
|
271
|
+
r.length === 0 ? i.value = !1 : i.value = !0, l.value = [...l.value, ...r];
|
272
|
+
}
|
273
|
+
};
|
274
|
+
return L(async () => {
|
275
|
+
m.value = !0, console.log(t.selectedDate);
|
276
|
+
const r = await z({
|
277
|
+
skip: p.value,
|
278
|
+
limit: a.value,
|
279
|
+
category: t.category,
|
280
|
+
participant: t.participant,
|
281
|
+
sortOrder: t.sortOrder,
|
282
|
+
user: t.user,
|
283
|
+
owner: t.owner,
|
284
|
+
date: t.selectedDate,
|
285
|
+
organization: t.organization,
|
286
|
+
period: t.period,
|
287
|
+
status: t.status
|
288
|
+
});
|
289
|
+
r.length === 0 ? i.value = !1 : i.value = !0, l.value = r, m.value = !1;
|
290
|
+
}), (r, w) => (n(), s("section", ge, [
|
291
|
+
T(N, {
|
292
|
+
tag: "ul",
|
293
|
+
name: "fade",
|
294
|
+
class: "o-hidden bg-grey radius-big"
|
295
|
+
}, {
|
296
|
+
default: $(() => [
|
297
|
+
m.value ? (n(!0), s(_, { key: 0 }, M(a.value, (u) => (n(), P(ce, { key: u }))), 128)) : c("", !0)
|
298
|
+
]),
|
299
|
+
_: 1
|
300
|
+
}),
|
301
|
+
T(R, { name: "fade" }, {
|
302
|
+
default: $(() => [
|
303
|
+
!m.value && l.value.length < 1 ? (n(), P(V, {
|
304
|
+
key: 0,
|
305
|
+
title: "No Events Found",
|
306
|
+
description: "Currently, there are no events available. Please check back later.",
|
307
|
+
class: "pd-medium mn-thin bg-grey radius-big"
|
308
|
+
})) : c("", !0)
|
309
|
+
]),
|
310
|
+
_: 1
|
311
|
+
}),
|
312
|
+
T(N, {
|
313
|
+
tag: "ul",
|
314
|
+
name: "fade",
|
315
|
+
class: "container"
|
316
|
+
}, {
|
317
|
+
default: $(() => [
|
318
|
+
!m.value && l.value.length > 0 ? (n(!0), s(_, { key: 0 }, M(l.value, (u, k) => (n(), P(ae, {
|
319
|
+
onClick: (x) => r.$router.push({ name: "Event", params: { url: u.url } }),
|
320
|
+
key: u._id,
|
321
|
+
event: u,
|
322
|
+
owner: e.user,
|
323
|
+
type: "normal",
|
324
|
+
class: y(["bg-grey radius-big mn-medium", {
|
325
|
+
"br-b br-solid br-black-transp-10": k !== l.value.length - 1
|
326
|
+
}])
|
327
|
+
}, null, 8, ["onClick", "event", "owner", "class"]))), 128)) : c("", !0),
|
328
|
+
i.value && l.value.length > 0 ? (n(), s("button", {
|
329
|
+
key: 1,
|
330
|
+
onClick: o,
|
331
|
+
class: "w-100 bg-main button"
|
332
|
+
}, "Load more")) : c("", !0)
|
333
|
+
]),
|
334
|
+
_: 1
|
335
|
+
})
|
336
|
+
]));
|
337
|
+
}
|
338
|
+
};
|
339
|
+
export {
|
340
|
+
ce as S,
|
341
|
+
xe as _,
|
342
|
+
ae as a,
|
343
|
+
ke as e,
|
344
|
+
z as r,
|
345
|
+
d as s
|
346
|
+
};
|