liquid_feedback_frontend

view app/main/index/document.lua @ 1304:0bae319805ff

Added tag v3.2.1 for changeset 0160d9a01d0a
author jbe
date Fri May 06 09:44:16 2016 +0200 (2016-05-06)
parents 701a5cf6b067
children 32cc544d5a5b
line source
1 if not config.document_dir then
2 error("feature not enabled")
3 end
5 slot.put_into("title", _"Download documents")
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 local file_list = extos.listdir(config.document_dir)
20 local tmp = {}
21 for i, filename in ipairs(file_list) do
22 if not filename:find("^%.") then
23 tmp[#tmp+1] = filename
24 end
25 end
27 local file_list = tmp
29 table.sort(file_list, function(a, b) return a > b end)
31 ui.list{
32 records = file_list,
33 columns = {
34 {
35 content = function(filename)
36 slot.put(encode.html(filename))
37 end
38 },
39 {
40 content = function(filename)
41 ui.link{
42 content = _"Download",
43 module = "index",
44 view = "document_file",
45 params = { filename = filename }
46 }
47 slot.put(" ")
48 ui.link{
49 content = _"Show",
50 module = "index",
51 view = "document_file",
52 params = { filename = filename, inline = true }
53 }
54 end
55 }
56 }
57 }

Impressum / About Us