This commit is contained in:
iriska-gri committed 2024-02-02 09:44:05 +03:00
1 parent cddd9a9982
commit 0a692990d5
57 files changed
+90 -57

No files matched your search

+1
View File
@@ -0,0 +1 @@
import{_ as W,B as Y,r as h,aP as Z,w as Q,Y as X,Z as $,$ as ll,D as d,a0 as _,G as l,F as t,M as i,U,a7 as N,aE as O,a8 as w,N as o,T as v,K as el,H as m,a6 as c,V,I as j,W as u,a4 as F,a5 as B,L as D,E as g,a1 as H,a2 as z,J as x,aF as R}from"./index-f96028ce.js";import{i as tl}from"./icoUser-b8581e44.js";import{f as al}from"./index-ba42aa01.js";import{V as ol}from"./VSwitch-98a5951b.js";import{V as E}from"./VTooltip-dffba9d9.js";import{V as nl}from"./VListItem-68d518f4.js";import{V as sl}from"./VTextarea-88462b0f.js";import{V as il}from"./VAlert-aac88996.js";import"./index-25008131.js";import"./VInput-e114e8ce.js";import"./VSelectionControl-9f7f7a4b.js";/* empty css */const L=Y(),rl={components:{icoUser:tl},setup(){const b=h(""),s=Z(),f=h([]),e=h(!1),S=O.slice(0,-1);(()=>{w.get(`api/navigation/newscrossroad/?id=${s.query.id}`).then(n=>{f.value=n.data.result[0],f.value.gallery.length>0&&(e.value=!0)})})();const C=n=>n.familyname+" "+n.name[0]+"."+n.parentname[0]+".",a=n=>n.replaceAll('src="/media/uploads',`src="${O}media/uploads`),p=n=>al(new Date(n),"dd.MM.yyyy HH:mm"),A=n=>{w.post("api/navigation/newscrossroad/",{news:n,text:b.value}).then(r=>{f.value.comment=r.data.comment}),b.value=""},q=(n,r)=>{w.post("api/navigation/newscrossroad/",{delid:n,news:r}).then(y=>{f.value.comment=y.data.comment})},G=n=>n.likes.filter(r=>r.user==L.user.login).length==1,k=h([]),M=h(!1),T=h(!1),I=h(""),J=n=>{M.value=!0,I.value=f.value.gallery.findIndex(r=>r.id==n)},K=n=>{T.value=!0,k.value=n};return Q(()=>I,(n,r)=>{n&&(k.value=f.value.gallery[n.value])},{deep:!0}),{route:s,newsFull:f,gallery:e,burl:S,checkremote:X,spravURL:$,splitname:C,accountStore:L,formatText:a,dateformat:p,textcomment:b,addComment:A,deletComment:q,heartIcoAll:G,heartIco:()=>k.value.likes.filter(n=>n.user==L.user.login).length==1,toggleLikeAll:n=>{w.post("api/navigation/gallery/",{image:n}).then(r=>{f.value.gallery.filter(y=>y.id==n)[0].likes=r.data})},toggleLike:n=>{w.post("api/navigation/gallery/",{image:n}).then(r=>{k.value.likes=r.data})},openImg:J,dialogfoto:M,galleryimges:k,indximg:I,toggleIncrementLike:(n,r)=>{w.post("api/navigation/news/",{news:n,scores:r}).then(y=>{f.value.scores=y.data})},openOneImg:K,dialogfotoOne:T}}},dl={key:0,class:"d-flex flex-column flex-fill"},cl={class:"pl-3"},ul=u("span",null," Чат ",-1),fl={class:"pl-3"},ml=u("span",null," Галерея ",-1),gl={class:"justify-self-end"},xl={class:"subheading me-2"},hl=u("span",{class:"me-1"}," · ",-1),_l={class:"subheading me-2"},wl=["innerHTML"],vl={key:1},pl={class:"flex-column d-flex ma-3"},kl={class:"h-100 w-100 flex-column d-flex"},yl=u("div",{class:"text-subtitle-2"},null,-1);function bl(b,s,f,e,S,P){const C=ll("ico-user");return Object.keys(e.newsFull).length>0?(d(),_("div",dl,[l(i,{class:"d-flex flex-row ma-0"},{default:t(()=>[l(o,{class:"flex-column d-flex"},{default:t(()=>[l(i,{class:"flex-grow-0"},{default:t(()=>[l(o,{class:"pb-0 pr-0"},{default:t(()=>[l(v,{height:"350px",class:"rounded-b-0"},{default:t(()=>[l(el,{class:"pt-0 pb-1 flex-column d-flex"},{default:t(()=>[l(i,null,{default:t(()=>[l(o,{lg:"9",class:"pt-4"},{default:t(()=>[m(c(e.newsFull.title),1)]),_:1}),l(o,{class:"pa-0 pr-3 pt-1 flex-grow-1 d-flex flex-column flex-wrap"},{default:t(()=>[l(ol,{modelValue:e.gallery,"onUpdate:modelValue":s[0]||(s[0]=a=>e.gallery=a),class:"align-self-end comgal","hide-details":""},{prepend:t(()=>[l(E,{location:"top"},{activator:t(({props:a})=>[l(V,j(a,{icon:"mdi-message-text-outline",color:"pink-darken-4"}),null,16),u("span",cl,c(e.newsFull.comment.length),1)]),default:t(()=>[ul]),_:1})]),append:t(()=>[l(E,{location:"top"},{activator:t(({props:a})=>[l(V,j(a,{icon:"mdi-image",color:"teal-darken-2"}),null,16),u("span",fl,c(e.newsFull.gallery.length),1)]),default:t(()=>[ml]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(F,{src:`${e.burl}${e.newsFull.link}`,height:"450px",width:"96%",class:"mx-auto",cover:"",onClick:s[1]||(s[1]=a=>e.openOneImg(e.newsFull.link))},null,8,["src"])]),_:1})]),_:1})]),_:1}),l(i,null,{default:t(()=>[l(o,{class:"pt-0 pr-0"},{default:t(()=>[l(v,{class:"rounded-t-0 flex-column d-flex h-100"},{default:t(()=>[l(nl,{class:"w-100"},{prepend:t(()=>[l(C,{author:e.newsFull.author},null,8,["author"])]),append:t(()=>[u("div",gl,[l(V,{class:"me-1",icon:e.newsFull.scores.filter(a=>a.user==e.accountStore.user.login&&a.score==!0).length>0?"mdi-thumb-up":"mdi-thumb-up-outline",onClick:s[2]||(s[2]=a=>e.toggleIncrementLike(e.newsFull.id,!0))},null,8,["icon"]),u("span",xl,c(e.newsFull.scores.filter(a=>a.score==!0).length),1),hl,l(V,{class:"me-1",icon:e.newsFull.scores.filter(a=>a.user==e.accountStore.user.login&&a.score==!1).length>0?"mdi-thumb-down":"mdi-thumb-down-outline",onClick:s[3]||(s[3]=a=>e.toggleIncrementLike(e.newsFull.id,!1))},null,8,["icon"]),u("span",_l,c(e.newsFull.scores.filter(a=>a.score==!1).length),1)])]),_:1}),l(B),l(i,{class:"ma-0 my-3 overflow-auto h-0"},{default:t(()=>[l(o,{class:"pa-0"},{default:t(()=>[l(D,{class:"pt-0Line truncated