res #41
This commit is contained in:
@ -6,7 +6,7 @@ export const lim_re = 64
|
||||
export const lim_sec = 8
|
||||
export const lim_uid_def = lim_re
|
||||
export const lim_uid_max = lim_re * lim_sec / req_re
|
||||
export const lim_res_def = 0
|
||||
export const lim_res_def = 16
|
||||
export const lim_res_max = 64
|
||||
|
||||
export const len_code = 6
|
||||
|
@ -139,8 +139,8 @@ function is_put_idrel(
|
||||
else if ("rol" in p) switch (p.rol) {
|
||||
case "sec": return is_pre_rel(pas)
|
||||
case "uid": return "uid" in p && p.uid === pas.uid && p.add === false || is_sec(pas, id)
|
||||
case "res": return "uid" in p && p.uid === pas.uid && (p.add === false || is_re(pas))
|
||||
|| !("uid" in p) && is_sec(pas, id)
|
||||
case "res": return "uid" in p && p.uid === pas.uid && (p.add === false || !is_rej(pas))
|
||||
|| !("uid" in p) && (is_aut(pas.aut, "aut") || is_sec(pas, id))
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ window.addEventListener("hashchange", () => {
|
||||
|
||||
export async function load(
|
||||
) {
|
||||
console.log("ismism-20230308")
|
||||
console.log("ismism-20230311")
|
||||
console.log(`\n主义主义开发小组!成员招募中!\n\n发送自我介绍至网站维护邮箱,或微信联系 728 万大可\n \n`)
|
||||
await navpas()
|
||||
window.dispatchEvent(new Event("hashchange"))
|
||||
|
@ -6,7 +6,7 @@ import { adm, adm1_def, adm2_def } from "../../src/ont/adm.ts"
|
||||
import { utc_medium } from "../../src/ont/utc.ts"
|
||||
import { nav, navpas } from "./nav.ts"
|
||||
import { bind, pos, que, Section, utc_refresh } from "./template.ts"
|
||||
import { is_re, is_ref, is_rej, is_sec } from "../../src/pra/con.ts"
|
||||
import { is_ref, is_rej, is_sec } from "../../src/pra/con.ts"
|
||||
import { is_aut, lim_re, lim_sec } from "../../src/eid/is.ts"
|
||||
|
||||
export function label(
|
||||
@ -280,9 +280,14 @@ export function putrel(
|
||||
},
|
||||
alert: `无效志愿者名或志愿者已满\n增删的志愿者需先作为申请人或志愿者出现在${id === "sid" ? "社团" : "活动"}名单`,
|
||||
refresh: async () => { await navpas(); refresh() },
|
||||
}); else t.putuid.remove()
|
||||
}); else t.putuid.remove() // deno-lint-ignore no-explicit-any
|
||||
if (is_aut(nav.pas.aut, "aut") || is_sec(nav.pas, { [id]: d._id } as any)) btn(t.putresn, t.putresn.innerText, d.res.length > 0 ? {
|
||||
confirm: "清空申请人名单?",
|
||||
pos: () => pos<DocU>("put", { [id]: d._id, rol: "res" }),
|
||||
refresh,
|
||||
} : undefined); else t.putresn.remove()
|
||||
const [isuid, isres] = [d.uid.includes(nav.pas.uid), d.res.includes(nav.pas.uid)]
|
||||
if (!isuid && is_re(d) || isres) btn(t.putres, isres ? "取消申请" : "申请加入", !isres && d.res.length >= d.reslim ? undefined : {
|
||||
if (!isuid && !is_rej(d) || isres) btn(t.putres, isres ? "取消申请" : "申请加入", !isres && d.res.length >= d.reslim ? undefined : {
|
||||
pos: () => pos<DocU>("put", { [id]: d._id, rol: "res", uid: nav.pas!.uid, add: !isres }),
|
||||
refresh,
|
||||
alert: "申请人已满",
|
||||
|
@ -73,7 +73,7 @@ const section = {
|
||||
},
|
||||
|
||||
putrel: {
|
||||
putrel: t("section"), putsec: t("button"), putuid: t("button"), putres: t("button"),
|
||||
putrel: t("section"), putsec: t("button"), putuid: t("button"), putresn: t("button"), putres: t("button"),
|
||||
},
|
||||
|
||||
putpro: {
|
||||
|
@ -159,6 +159,7 @@
|
||||
<section class="putrel flex">
|
||||
<button class="putsec">增删联络员</button>
|
||||
<button class="putuid">增删志愿者</button>
|
||||
<button class="putresn">清空申请人</button>
|
||||
<button class="putres">申请加入</button>
|
||||
</section>
|
||||
<hr>
|
||||
@ -257,6 +258,7 @@
|
||||
<section class="putrel flex">
|
||||
<button class="putsec">增删联络员</button>
|
||||
<button class="putuid">增删志愿者</button>
|
||||
<button class="putresn">清空申请人</button>
|
||||
<button class="putres">申请加入</button>
|
||||
</section>
|
||||
<hr>
|
||||
|
Reference in New Issue
Block a user