liquid_feedback_frontend
changeset 1059:3f52e99b444d
Added missing feature database download again
author | bsw |
---|---|
date | Wed Jul 16 21:49:21 2014 +0200 (2014-07-16) |
parents | bd2509e7f627 |
children | d6ab5f231178 |
files | app/main/index/_sidebar_whatcanido.lua app/main/index/download.lua |
line diff
1.1 --- a/app/main/index/_sidebar_whatcanido.lua Wed Jul 16 21:48:19 2014 +0200 1.2 +++ b/app/main/index/_sidebar_whatcanido.lua Wed Jul 16 21:49:21 2014 +0200 1.3 @@ -49,6 +49,19 @@ 1.4 end } 1.5 end } 1.6 end ) 1.7 + if config.download_dir then 1.8 + ui.sidebarSection( function() 1.9 + ui.heading { level = 3, content = _"I want to download all data" } 1.10 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.11 + ui.tag { tag = "li", content = function () 1.12 + ui.link{ 1.13 + module = "index", view = "download", 1.14 + text = _"download database" 1.15 + } 1.16 + end } 1.17 + end } 1.18 + end ) 1.19 + end 1.20 ui.sidebarSection( function() 1.21 ui.heading { level = 3, content = _"I want to learn more about LiquidFeedback" } 1.22 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
2.1 --- a/app/main/index/download.lua Wed Jul 16 21:48:19 2014 +0200 2.2 +++ b/app/main/index/download.lua Wed Jul 16 21:49:21 2014 +0200 2.3 @@ -2,27 +2,6 @@ 2.4 error("feature not enabled") 2.5 end 2.6 2.7 -slot.put_into("title", _"Download database export") 2.8 - 2.9 -slot.select("actions", function() 2.10 - ui.link{ 2.11 - content = function() 2.12 - ui.image{ static = "icons/16/cancel.png" } 2.13 - slot.put(_"Cancel") 2.14 - end, 2.15 - module = "index", 2.16 - view = "index" 2.17 - } 2.18 -end) 2.19 - 2.20 -ui.container{ 2.21 - attr = { class = "wiki use_terms" }, 2.22 - content = function() 2.23 - slot.put(config.download_use_terms) 2.24 - end 2.25 -} 2.26 - 2.27 - 2.28 local file_list = extos.listdir(config.download_dir) 2.29 2.30 local tmp = {} 2.31 @@ -36,23 +15,47 @@ 2.32 2.33 table.sort(file_list, function(a, b) return a > b end) 2.34 2.35 -ui.list{ 2.36 - records = file_list, 2.37 - columns = { 2.38 - { 2.39 - content = function(filename) 2.40 - slot.put(encode.html(filename)) 2.41 - end 2.42 - }, 2.43 - { 2.44 - content = function(filename) 2.45 - ui.link{ 2.46 - content = _"Download", 2.47 - module = "index", 2.48 - view = "download_file", 2.49 - params = { filename = filename } 2.50 + 2.51 +ui.title(_"Download database export") 2.52 + 2.53 +ui.section( function() 2.54 + 2.55 + ui.sectionHead( function() 2.56 + ui.heading { level = 1, content = _"Download database export" } 2.57 + end ) 2.58 + 2.59 + if config.download_use_terms then 2.60 + ui.sectionRow( function() 2.61 + ui.container{ 2.62 + attr = { class = "wiki use_terms" }, 2.63 + content = function() 2.64 + slot.put(config.download_use_terms) 2.65 + end 2.66 + } 2.67 + end ) 2.68 + end 2.69 + 2.70 + ui.sectionRow( function() 2.71 + 2.72 + ui.list{ 2.73 + records = file_list, 2.74 + columns = { 2.75 + { 2.76 + content = function(filename) 2.77 + ui.tag{ content = filename } 2.78 + end 2.79 + }, 2.80 + { 2.81 + content = function(filename) 2.82 + ui.link{ 2.83 + content = _"Download", 2.84 + module = "index", 2.85 + view = "download_file", 2.86 + params = { filename = filename } 2.87 + } 2.88 + end 2.89 } 2.90 - end 2.91 + } 2.92 } 2.93 - } 2.94 -} 2.95 \ No newline at end of file 2.96 + end) 2.97 +end) 2.98 \ No newline at end of file