liquid_feedback_frontend

view app/main/index/download.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents f49cdfb72567
children 3f52e99b444d
line source
1 if not config.download_dir then
2 error("feature not enabled")
3 end
5 slot.put_into("title", _"Download database export")
7 slot.select("actions", function()
8 ui.link{
9 content = function()
10 ui.image{ static = "icons/16/cancel.png" }
11 slot.put(_"Cancel")
12 end,
13 module = "index",
14 view = "index"
15 }
16 end)
18 ui.container{
19 attr = { class = "wiki use_terms" },
20 content = function()
21 slot.put(config.download_use_terms)
22 end
23 }
26 local file_list = extos.listdir(config.download_dir)
28 local tmp = {}
29 for i, filename in ipairs(file_list) do
30 if not filename:find("^%.") then
31 tmp[#tmp+1] = filename
32 end
33 end
35 local file_list = tmp
37 table.sort(file_list, function(a, b) return a > b end)
39 ui.list{
40 records = file_list,
41 columns = {
42 {
43 content = function(filename)
44 slot.put(encode.html(filename))
45 end
46 },
47 {
48 content = function(filename)
49 ui.link{
50 content = _"Download",
51 module = "index",
52 view = "download_file",
53 params = { filename = filename }
54 }
55 end
56 }
57 }
58 }

Impressum / About Us