xrforge-v2/src/page/dir.html

66 lines
2 KiB
HTML
Raw Normal View History

2026-07-23 10:01:34 +02:00
${header}
2026-07-30 20:53:12 +02:00
{if parent ~= nil and parent.parent == nil then
print([[
2026-07-31 19:32:19 +02:00
<div style="height:90px;" class="jumbotron">
<h1 style="display:none">${opts.title}</h1>
<br>
2026-08-04 12:17:33 +02:00
<center class="col3">${opts.plugin_global_subtitle}</center>
2026-07-30 20:53:12 +02:00
</div>
2026-07-31 19:32:19 +02:00
<hr style="margin-top:0"/>
2026-07-30 20:53:12 +02:00
]])
end}
2026-07-30 20:53:12 +02:00
{if parent ~= nil and parent.parent ~= nil then
print([[
2026-07-31 19:32:19 +02:00
<h2><span class="col1">//</span> ${parent.name}</h2>
2026-07-30 20:53:12 +02:00
]])
end}
2026-07-23 10:01:34 +02:00
<div class="grid">
2026-07-31 14:41:34 +02:00
{if items then
for i=1,#items do
local item = items[i]
2026-07-31 19:32:19 +02:00
local icon = 'list-tree'
local thumbnail = ''
2026-08-02 14:00:56 +02:00
if #item.thumbnail > 0 then thumbnail = 'style="background-image: url(' .. EscapeFragment(item.thumbnail) .. ');"' end
2026-07-31 14:41:34 +02:00
if item.view3D or item.portal3D == false then icon = 'play' end
print([[
<div class="tile">
<a href="]] .. item.url .. [[">
2026-07-31 19:32:19 +02:00
<div class="img" ]] .. thumbnail .. [[></div>
2026-07-31 14:41:34 +02:00
<div class="text">
2026-07-31 19:32:19 +02:00
<img src="img/]] .. icon .. [[.svg" class="icon ]] .. icon .. [["/>&nbsp;<a href="]] .. item.url .. [[">]] .. item.title .. [[</a>
2026-07-31 14:41:34 +02:00
</div>
</a>
</div>
]])
end
end}
{if parent.parent == nil then
for i=1,5 do
local urls = app.opts[ 'plugin_federation_url_' .. i]
if #urls > 0 then
local title = urls:gsub(' .*','')
local fediurl = '/?url=' .. EscapeFragment(title)
local thumburl = urls:gsub('.* ','')
local icon = 'list-tree'
local thumbnail = ''
if #thumburl > 0 then thumbnail = 'style="background-image: url(' .. EscapeFragment(thumburl) .. ');"' end
print([[
<div class="tile">
<a href="]] .. fediurl .. [[">
<div class="img" ]] .. thumbnail .. [[></div>
<div class="text">
<img src="img/]] .. icon .. [[.svg" class="icon ]] .. icon .. [["/>&nbsp;<a href="]] .. fediurl .. [[">]] .. title .. [[</a>
</div>
</a>
</div>
]])
end
end
end}
2026-07-23 10:01:34 +02:00
</div>
${footer}