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