liquid_feedback_frontend
view app/main/index/document.lua @ 1092:5b65ea5c24f5
Fixed free timings in poll mode
| author | bsw | 
|---|---|
| date | Fri Oct 17 13:03:31 2014 +0200 (2014-10-17) | 
| 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 }
