25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
end
if path.ct >= 3 and path(1):cmp('a') then
var id, idok = lib.math.shorthand.parse(path(2).ptr, path(2).ct)
if not idok then goto e404 end
var art = co.srv:artifact_fetch(uid, id)
if not art then goto e404 end
if path.ct == 3 then
-- sniff out the artifact type and display the appropriate viewer
var artid = cs(art(0).url)
var btns: lib.str.acc
if owner then
btns:pcompose(&co.srv.pool,'<a class="neg button" href="',pfx,'/media/a/',artid,'/del">delete</a><a class="button" href="',pfx,'/media/a/',artid,'/edit">alter</a>')
else
|
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
end
if path.ct >= 3 and path(1):cmp('a') then
var id, idok = lib.math.shorthand.parse(path(2).ptr, path(2).ct)
if not idok then goto e404 end
var art = co.srv:artifact_fetch(uid, id)
if not art then goto e404 end
defer art:free()
if path.ct == 3 then
-- sniff out the artifact type and display the appropriate viewer
var artid = cs(art(0).url)
var btns: lib.str.acc
if owner then
btns:pcompose(&co.srv.pool,'<a class="neg button" href="',pfx,'/media/a/',artid,'/del">delete</a><a class="button" href="',pfx,'/media/a/',artid,'/edit">alter</a>')
else
|