PageSourceSearch

https://jgg-berlin.de/_nuxt/Co7Tzbl5.js

js jgg-berlin.de collected 2026-10-05 19:28:11 UTC 5,387 bytes, 1 lines download raw bytes

1import{j as te,k as g,p as H}from"./Dvw6pq8M.js";import{r as oe,g as ae,d as h}from"./BYtaZRxg.js";import{q as se,r as re,U as ne,V as le,E as w,a3 as u,aL as ie,a4 as ue,v as de,p as P,a5 as ce,a6 as pe,y as b,o as l,D as ve,w as F,A as e,a7 as me,B as z,a as c,t as k,z as d,c as y,$ as fe,a8 as N,b as ge,a1 as be,n as ye}from"./D3XdDhnb.js";import{d as he}from"./Cp2ysxOb.js";import{u as we}from"./DDvmgmLK.js";import{u as ke}from"./BcXorHaC.js";import{g as Ce,b as Le,i as I}from"./Duvzurvh.js";import{p as x}from"./DPXK57AA.js";import{w as xe}from"./BkPw9_Jt.js";import{u as $e,g as Ue}from"./D2nfcdar.js";import{r as De}from"./Dc3qqRIw.js";import{H as Be}from"./w6oId86p.js";import{u as Se}from"./JFbi8ONY.js";import"./CEVJ7K31.js";import"./BZqcCGZC.js";const _e={class:"sticky top-0 z-[31] flex min-h-[6.25rem] items-center justify-between gap-8 bg-gray-50/75 p-8 backdrop-blur backdrop-filter"},Ae={class:"truncate text-xl"},Oe={class:"flex gap-2"},je={key:0,class:"!absolute right-1.5 top-1.5 h-1 w-1 rounded-full bg-white"},Ee={key:1,class:"scrollbar-thin sticky top-[6.25rem] flex h-[calc(100vh-9.75rem)] w-full max-w-xs shrink-0 flex-col gap-4 overflow-auto px-2 pb-8 text-sm"},Re={key:2,class:"mb-8 min-w-0 flex-1 rounded-md border bg-white p-4 text-sm text-gray-400"},Ye=se({__name:"SingleCollectionsOverview",async setup(Te){var T,V,q;let $,U;const D=we(),C=ke(),v=re(),B=$e(),M=ae();[$,U]=ne(()=>le("pruvious-dashboard")),await $,U();const S=(V=(T=oe)[C.value.collection])==null?void 0:V.call(T),s=C.value.collections[C.value.collection],i=w({}),m=w(""),G=Object.fromEntries(te.map(({code:o,name:t})=>[o,t])),a=w({}),_=w({}),L=u("pruvious-dashboard",ie(s.label.collection.plural,!1)),J=Ue(B.value),n=new Be(a.value),f=((q=B.value)==null?void 0:q.isAdmin)||J[`collection-${s.name}-update`],K=h.Base(),Q=h.CollectionTranslations(),W=h.FieldLayout(),X=h.HistoryButtons();Se({title:L}),ue("keydown",async o=>{const t=Ce(o);t&&(o.preventDefault(),o.stopPropagation(),t==="save"?(Le(),await E()):t==="undo"?O():t==="redo"&&j())}),de(()=>v.query,async()=>{var o;i.value={},m.value=g.includes(((o=v.query.language)==null?void 0:o.toString())??"")?v.query.language.toString():H,s.translatable&&(D.value=m.value),a.value=await Y(),n.reset().add(a.value),await p(),xe(n)},{immediate:!0});async function Y(){const o=await P(`collections/${s.name}?language=${m.value}`);return o.success?o.data:{}}async function p(){_.value=await De(a.value,s.fields)}const A=he((o=!1)=>{p(),n.add(a.value,o)},50);function O(){a.value=n.undo()??a.value,i.value={},p()}function j(){a.value=n.redo()??a.value,i.value={},p()}async function E(){if(!f)return;i.value={};const o=await P(`collections/${s.name}?language=${m.value}`,{method:"patch",body:a.value});o.success?(a.value=o.data,n.add(a.value),n.setInitialState(a.value),p(),x({message:u("pruvious-dashboard","$item updated",{item:L})}
1)):ce(o.error)&&(i.value=o.error,x({message:u("pruvious-dashboard","$count $errors found",{count:Object.keys(o.error).length}),type:"error"}))}function Z(){a.value=Object.fromEntries(Object.entries(s.fields).map(([o,t])=>[o,be(t.default)])),n.add(a.value),p(),x({message:u("pruvious-dashboard","All fields have been reset to their default values")})}async function R(o){await ye({path:v.path,query:{...v.query,language:o!==H?o:void 0}}),D.value=o}return(o,t)=>{const ee=pe("pruvious-tooltip");return l(),b(e(K),null,ve({default:F(()=>[c("div",_e,[c("h1",Ae,k(e(L)),1),c("div",Oe,[e(f)?(l(),b(e(X),{key:0,history:e(n),onRedo:t[1]||(t[1]=r=>j()),onUndo:t[2]||(t[2]=r=>O())},null,8,["history"])):d("",!0),e(S)?(l(),b(z(e(S)),{key:1,record:e(a),"onUpdate:record":t[3]||(t[3]=r=>e(A)(!e(I)()))},null,40,["record"])):d("",!0),e(f)?(l(),y("button",{key:2,onClick:t[4]||(t[4]=r=>Z()),type:"button",class:"button button-white"},[c("span",null,k(e(u)("pruvious-dashboard","Restore defaults")),1)])):d("",!0),e(f)?(l(),y("button",{key:3,onClick:t[5]||(t[5]=r=>E()),type:"button",class:"button"},[e(n).isDirty.value?(l(),y("span",je)):d("",!0),c("span",null,k(e(u)("pruvious-dashboard","Save")),1)])):d("",!0)])]),c("div",{class:fe(["flex items-start gap-6 p-8 pb-0 pt-0",{"pr-6":e(s).translatable&&e(g).length>1,"pr-8":!e(s).translatable||e(g).length===1}])},[e(s).dashboard.fieldLayout.length?(l(),b(e(W),{key:0,errors:e(i),"onUpdate:errors":t[6]||(t[6]=r=>N(i)?i.value=r:null),record:e(a),"onUpdate:record":[t[7]||(t[7]=r=>N(a)?a.value=r:null),t[8]||(t[8]=r=>e(A)(!e(I)()))],canUpdate:e(f),collectionRecord:e(a),fieldLayout:e(s).dashboard.fieldLayout,fieldsDeclaration:e(s).fields,history:e(n),resolvedConditionalLogic:e(_),stickyTopBorder:!0,class:"mb-8"},null,8,["errors","record","canUpdate","collectionRecord","fieldLayout","fieldsDeclaration","history","resolvedConditionalLogic"])):d("",!0),e(s).translatable&&e(g).length>1?(l(),y("div",Ee,[ge(e(Q),{record:e(a),onChangeLanguage:t[9]||(t[9]=r=>R(r))},null,8,["record"])])):d("",!0),e(s).dashboard.fieldLayout.length?d("",!0):(l(),y("div",Re,[c("p",null,k(e(u)("pruvious-dashboard","No fields to display")),1)]))],2)]),_:2},[e(s).translatable&&e(g).length>1?{name:"language-switcher",fn:F(()=>[me((l(),b(z(e(M)),{modelValue:e(m),options:{choices:e(G)},"onUpdate:modelValue":t[0]||(t[0]=r=>R(r)),class:"!w-32"},null,8,["modelValue","options"])),[[ee,{content:e(u)("pruvious-dashboard","Language"),offset:[0,9]}]])]),key:"0"}:void 0]),1024)}}});export{Ye as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.