forked from unimatrix/web
Build central Political CP with campaign cards and imperial artwork
This commit is contained in:
parent
e7c8951511
commit
84edcf31e7
1 changed files with 148 additions and 35 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const houses={atreides:'House Aerdrecht',harkonnen:'House Harkveen',corrino:'House Korenholt',ordos:'House Oordwijk',fremen:'House Vrijduin',veiled_concord:'Veiled Concord'};
|
||||
export function rollRow(r){return {username:r.username,election:(r.kind==='imperial'?'Emperor':houses[r.faction]||r.faction)+' · '+new Date(Number(r.election_start)).toISOString().slice(0,10)+' · Round '+(Number(r.round_number)+1),votes:Number(r.votes)};}
|
||||
export function rollRow(r){return {username:r.username,election:(({imperial:'Emperor',bene:'Bene Gesserit',guild:'Spacing Guild',clan_delegate:'Clan Delegate'})[r.kind]||houses[r.faction]||r.faction)+' · '+new Date(Number(r.election_start)).toISOString().slice(0,10)+' · Round '+(Number(r.round_number)+1),votes:Number(r.votes)};}
|
||||
export async function votingHonour(db,userId,now=Date.now()){
|
||||
const row=await db.prepare(`SELECT MAX(r.closes_at) AS expires_at FROM political_election_rounds r
|
||||
WHERE r.status='open' AND r.opens_at<=? AND r.closes_at>?
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff