{% local obj, files, owner if DB.isobjhexvalid(request:path():sub(7, 7 + 31)) then obj = DB.getobj(DB.objshowid(request:path():sub(7, 7 + 31))) end if obj then local virt = "/objd/" .. DB.objhideid(obj.id) .. "/" local phys = DB.urltophysical(virt) files = {} for f in LFS.dir(phys) do if f ~= "." and f ~= ".." then local attribs = LFS.attributes(phys .. f) table.insert(files, {name = f, size = attribs.size, modtime = attribs.modification, phys = phys .. f, virt = virt .. f}) end end table.sort(files, function(a,b) if a.modtime == b.modtime then return a.name < b.name else return a.modtime < b.modtime end end) if verified and request:post() and request:post().csrf and DB.csrfverify(verified.id, Escapes.urlunescape(request:post().csrf)) then if request:post().comment then DB.postcomment(obj.id, verified.id, Escapes.urlspunescape(request:post().comment)) end end owner = DB.getuserbyid(obj.owner) end title = BigGlobe.cfg.sitename .. " - " .. (obj and obj.name or "Object not found") %} {% function content() %} {% if obj then %}

{{ Escapes.htmlescape(obj.name) }}{% if verified and verified.id == obj.owner then %} (edit){% end %}

{{ Escapes.htmlescape(owner.displayname) }} {{ obj.createtime }}

Object has {{#files-1}} files:

{% for _,tag in pairs(DB.getobjtags(obj.id)) do %}
{{ Escapes.htmlescape(tag.name) }}
{% end %}
{% if verified and verified.privs >= DB.USER_PRIVS_APPROVED then %}

(report)

{% end %}

{% if verified and verified.privs >= DB.USER_PRIVS_MOD then %} {% local csrfval = Escapes.htmlescape(DB.csrf(verified.id)) %} {% if owner.privs < verified.privs then %}

Delete object?







{% end %} {% if not obj.approved then %}

Approve object?





{% end %} {% end %}
{% for _, c in pairs(DB.getcomments(obj.id)) do %}
{{ Escapes.htmlescape(c.authordisplayname) }} {{ c.createtime }}

{{ Escapes.htmlescape(c.content):gsub("\n\n", "

") }}

(report)
{% end %} {% if verified then %}
{% end %}
{% else %}

Object was not found.

{% end %} {% end %} {# base.inc