11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
{url = 'qnt', title = 'quarantine', render = 'quarantine'};
{url = 'acl', title = 'access control shortcuts', render = 'acl'};
{url = 'rooms', title = 'chatrooms', render = 'rooms'};
{url = 'circles', title = 'circles', render = 'circles'};
{url = 'srv', title = 'server settings', render = 'srv'};
{url = 'brand', title = 'instance branding', render = 'rebrand'};
{url = 'censor', title = 'censorship & badthink suppression', render = 'rebrand'};
{url = 'users', title = 'user accounting', render = 'users'};
}
local path = symbol(lib.mem.ptr(pref))
local co = symbol(&lib.srv.convo)
................................................................................
local terra
render_conf([co], [path], notify: pstr)
var menu: lib.str.acc menu:init(64):lpush('<hr>') defer menu:free()
-- build menu
do var p = co.who.rights.powers
if p.config() then menu:lpush '<a href="/conf/srv">server settings</a>' end
if p.rebrand() then menu:lpush '<a href="/conf/brand">instance branding</a>' end
if p.censor() then menu:lpush '<a href="/conf/censor">badthink alerts</a>' end
if p:affect_users() then menu:lpush '<a href="/conf/users">users</a>' end
end
-- select the appropriate panel
var [panel] = pstr { ptr = ''; ct = 0 }
if path.ct >= 2 then [invoker] end
-- avoid the hr if we didn't add any elements
|
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
{url = 'qnt', title = 'quarantine', render = 'quarantine'};
{url = 'acl', title = 'access control shortcuts', render = 'acl'};
{url = 'rooms', title = 'chatrooms', render = 'rooms'};
{url = 'circles', title = 'circles', render = 'circles'};
{url = 'srv', title = 'server settings', render = 'srv'};
{url = 'brand', title = 'instance branding', render = 'rebrand'};
{url = 'badge', title = 'user badges', render = 'badge'};
{url = 'emoji', title = 'custom emoji packs', render = 'emojo'};
{url = 'censor', title = 'censorship & badthink suppression', render = 'rebrand'};
{url = 'users', title = 'user accounting', render = 'users'};
}
local path = symbol(lib.mem.ptr(pref))
local co = symbol(&lib.srv.convo)
................................................................................
local terra
render_conf([co], [path], notify: pstr)
var menu: lib.str.acc menu:init(64):lpush('<hr>') defer menu:free()
-- build menu
do var p = co.who.rights.powers
if p:affect_users() then menu:lpush '<a href="/conf/users">users</a>' end
if p.censor() then menu:lpush '<a href="/conf/censor">badthink alerts</a>' end
if p.config() then menu:lpush([
'<a href="/conf/srv">server & policy</a>' ..
'<a href="/conf/badge">badges</a>' ..
'<a href="/conf/emoji">emoji packs</a>'
]) end
if p.rebrand() then menu:lpush '<a href="/conf/brand">instance branding</a>' end
end
-- select the appropriate panel
var [panel] = pstr { ptr = ''; ct = 0 }
if path.ct >= 2 then [invoker] end
-- avoid the hr if we didn't add any elements
|