Merge pull request 'Use available public artwork for clan rebellion decisions' (#443) from feature/rebellion-quest-flow-20261120 into main
All checks were successful
DuneRealms Web CI / web (push) Successful in 2m33s
All checks were successful
DuneRealms Web CI / web (push) Successful in 2m33s
This commit is contained in:
commit
2643a969e7
1 changed files with 1 additions and 1 deletions
|
|
@ -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;}}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff