diff --git a/website/control-panel/public/cp-v2/cp-v2-rebellions.mjs b/website/control-panel/public/cp-v2/cp-v2-rebellions.mjs index c2feff23..241a1adf 100644 --- a/website/control-panel/public/cp-v2/cp-v2-rebellions.mjs +++ b/website/control-panel/public/cp-v2/cp-v2-rebellions.mjs @@ -8,7 +8,7 @@ const date=n=>new Date(n).toLocaleString('en-GB'); export function mountClanRebellions(host,{fetcher=fetch,clanId=null}={}){ const controller=new AbortController(),api=createUserAPI(fetcher,controller.signal);let active=true,busy=false; const decisions=el('div'),journal=el('div'),status=el('p','Reading your clan decisions…');status.setAttribute('role','status'); - const {root}=createCPV2Page({title:'Clan decisions',description:'Declare open rebellion. Capture the incumbent main-clan Home Block to claim the remaining office term.',artwork:'organisation-deed-keys-v1.png',shellHost:host,tabs:[{id:'rebellion-decisions',label:'Open rebellion',content:decisions},{id:'rebellion-journal',label:'Quest journal',content:journal}]}); + const {root}=createCPV2Page({title:'Clan decisions',description:'Declare open rebellion. Capture the incumbent main-clan Home Block to claim the remaining office term.',artwork:'nav-clan-v2.webp',shellHost:host,tabs:[{id:'rebellion-decisions',label:'Open rebellion',content:decisions},{id:'rebellion-journal',label:'Quest journal',content:journal}]}); const css=el('link');css.rel='stylesheet';css.href=new URL('./cp-v2-rebellions.css',import.meta.url).href; const refresh=el('button','Refresh decisions');refresh.type='button';root.prepend(css,status);root.append(refresh);host.replaceChildren(root); async function write(body){if(busy)return;busy=true;root.setAttribute('aria-busy','true');for(const b of root.querySelectorAll('button'))b.disabled=true;try{await api.request(endpoint,body);if(active)await load();}catch(error){if(active)status.textContent=error.message+(error.uncertain?' Refresh the journal before submitting again.':'');}finally{busy=false;if(active){root.removeAttribute('aria-busy');for(const b of root.querySelectorAll('button'))b.disabled=false;}}}