Compare commits
No commits in common. "b47f7c8e75c7274ac05e3c4e06dc57f2ee37de56" and "692747abc5e17601ae8543504b244292d9f7c6cd" have entirely different histories.
b47f7c8e75
...
692747abc5
@ -18,7 +18,7 @@ local function Latesthandler(self)
|
||||
local file_data = {}
|
||||
|
||||
file_data["name"] = latest_name[i]
|
||||
file_data["url"] = data_path .. file
|
||||
file_data["url"] = data_path .. escape(file)
|
||||
|
||||
table.insert(latest_json["files"], file_data)
|
||||
end
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
local lfs = require 'lfs_ffi'
|
||||
local config = require("lapis.config").get()
|
||||
local escape = require("lapis.util").escape
|
||||
|
||||
|
||||
-- setup
|
||||
@ -64,17 +63,17 @@ utils['these_files'] = function( path )
|
||||
if utils.match_ext( file, type_image ) then
|
||||
table.insert( images, file )
|
||||
elseif utils.match_ext( file, type_media ) then
|
||||
table.insert( files, {sane=escape(file), file=file} )
|
||||
table.insert( files, file )
|
||||
end
|
||||
elseif lfs.attributes( path .. file, "mode" ) == "directory" then
|
||||
table.insert( dirs, {sane=escape(file), dir=file} )
|
||||
table.insert( dirs, file )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
table.sort( images )
|
||||
-- table.sort( files )
|
||||
-- table.sort( dirs )
|
||||
table.sort( files )
|
||||
table.sort( dirs )
|
||||
|
||||
local stuff = {
|
||||
files = files,
|
||||
@ -89,7 +88,7 @@ utils['these_latest'] = function( path )
|
||||
local latest_path, latest_name = {}, {}
|
||||
|
||||
for i, file_path in ipairs( utils.latest_files( path ) ) do
|
||||
table.insert( latest_path, escape(file_path))
|
||||
table.insert( latest_path, file_path)
|
||||
|
||||
local temp = ""
|
||||
local result = ""
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
<br>
|
||||
<h1 class="h1">Latest uploads:</h1>
|
||||
<% for i, file in ipairs(latestpath) do %>
|
||||
<a class="amixlink" href="<%= '/data/' .. titles.url .. '/' .. file %>">
|
||||
<a class="amixlink" href="<%= '/data/' .. titles.url .. '/' .. file:gsub("#", "%%23") %>">
|
||||
<span class="mixlink"><%= latestname[i] %></span>
|
||||
</a>
|
||||
</br>
|
||||
|
||||
@ -10,14 +10,14 @@
|
||||
|
||||
<% for i, dir in ipairs(dirs) do %>
|
||||
<br>
|
||||
<a href="<%= uri .. dir["sane"] %>" class="djsection"><span><%= dir["dir"] %></span></a>
|
||||
<a href="<%= uri .. dir %>" class="djsection"><span><%= dir %></span></a>
|
||||
<br>
|
||||
<% end %>
|
||||
<br>
|
||||
|
||||
<% for i, file in ipairs(files) do %>
|
||||
<a class="amixlink" href="<%= path .. file["sane"] %>">
|
||||
<span class="mixlink"><%= file["file"] %></span>
|
||||
<a class="amixlink" href="<%= path .. file:gsub("#", "%%23") %>">
|
||||
<span class="mixlink"><%= file %></span>
|
||||
</a>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user