liquid_feedback_frontend
view app/main/index/download.lua @ 1228:554b739f86d6
Removed developer settings
| author | bsw | 
|---|---|
| date | Tue Dec 01 17:43:16 2015 +0100 (2015-12-01) | 
| parents | 3f52e99b444d | 
| children | 32cc544d5a5b | 
 line source
     1 if not config.download_dir then
     2   error("feature not enabled")
     3 end
     5 local file_list = extos.listdir(config.download_dir)
     7 local tmp = {}
     8 for i, filename in ipairs(file_list) do
     9   if not filename:find("^%.") then
    10     tmp[#tmp+1] = filename
    11   end
    12 end
    14 local file_list = tmp
    16 table.sort(file_list, function(a, b) return a > b end)
    19 ui.title(_"Download database export")
    21 ui.section( function()
    23   ui.sectionHead( function()
    24     ui.heading { level = 1, content = _"Download database export" }
    25   end )
    27   if config.download_use_terms then
    28     ui.sectionRow( function()
    29       ui.container{
    30         attr = { class = "wiki use_terms" },
    31         content = function()
    32           slot.put(config.download_use_terms)
    33         end
    34       }
    35     end )
    36   end
    38   ui.sectionRow( function()
    40     ui.list{
    41       records = file_list,
    42       columns = {
    43         {
    44           content = function(filename)
    45             ui.tag{ content = filename }
    46           end
    47         },
    48         {
    49           content = function(filename)
    50             ui.link{
    51               content = _"Download",
    52               module = "index",
    53               view = "download_file",
    54               params = { filename = filename }
    55             }
    56           end
    57         }
    58       }
    59     }
    60   end)
    61 end)
