liquid_feedback_frontend
view app/main/index/download.lua @ 1466:f921269f7788
Fixed heading of admin newsletter edit view
| author | bsw | 
|---|---|
| date | Thu Oct 18 17:37:33 2018 +0200 (2018-10-18) | 
| parents | 32cc544d5a5b | 
| children | 
 line source
     1 if not config.download_dir then
     2   return execute.view { module = "index", view = "404" }
     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)
