forked from unimatrix/web
Use shared illustrated cards for organisation Exchange panels
This commit is contained in:
parent
9b72de835d
commit
1158d0a384
1 changed files with 2 additions and 1 deletions
|
|
@ -14,9 +14,10 @@ export function mountJarvisRecruitment({mine,post,applications,promotions,banner
|
|||
catch(error){if(!active)return;banner.textContent=error.message;eligibility.textContent='Organisation authority could not be confirmed. Publishing remains unavailable.';for(const host of [mine,post,applications,promotions])host.replaceChildren(el('p',error.message));}
|
||||
}
|
||||
function renderOrganisationContext(){
|
||||
for(const host of [mine,post,applications,promotions])host.classList.add('jarvis-listing-card');
|
||||
const company=context.kind==='company',noun=company?'Company':'Political House';banner.textContent='J.A.R.V.I.S. · '+context.name;eligibility.textContent=company?'Company management · verified founder or CEO.':'Current office deed · membership follows the election register.';
|
||||
renderMine();post.replaceChildren(el('h3',noun+' listings'),el('p',context.publishingReason));applications.replaceChildren(el('h3',noun+' applications'),el('p',context.applicationReason));promotions.replaceChildren(el('h3','Promotions & delivery'),el('p','Promotions become available with supported organisation listings. No fee or credit is charged.'));
|
||||
for(const [host,key,label]of [[post,'settings','Open organisation settings →'],[applications,'elections','Open elections →']])if(context.links?.[key]){const a=el('a',label);a.href=context.links[key];host.append(a);}
|
||||
for(const [host,key,label]of [[post,'settings','Open organisation settings →'],[applications,'elections','Open elections →']])if(context.links?.[key]){const a=el('a',label,'jarvis-action');a.href=context.links[key];host.append(a);}
|
||||
if(context.officeDeed){const box=el('dl');for(const [name,value]of [['Authority','Current office deed'],['Term ends',new Date(context.officeDeed.expiresAt).toLocaleString('en-GB')]])box.append(el('dt',name),el('dd',value));applications.append(box);}
|
||||
}
|
||||
function renderMine(){mine.replaceChildren(el('h3',context.kind==='clan'?'My recruitment listings':'My organisation listings'));const {wrap,body}=table(['Listing','State','Publishing fee','Action']);for(const listing of context.listings){const row=el('tr'),controls=el('td');if(listing.state==='open'&&context.canPublish)controls.append(action('Close listing',async()=>{if(busy||!await confirmAction('Close this listing?','The advertisement will be removed. An incurred publishing fee remains payable.'))return;busy=true;try{await request('/api/jarvis/cancel',{id:listing.id,revision:listing.revision});await refresh(true);}catch(error){banner.textContent=error.message;}finally{busy=false;}}));row.append(el('td',listing.title),el('td',listing.state),el('td',listing.feeMinor?amount(listing.feeMinor):'Free'),controls);body.append(row);}if(!context.listings.length){const row=el('tr'),cell=el('td','No listings have been published.');cell.colSpan=4;row.append(cell);body.append(row);}mine.append(wrap);}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff