liquid_feedback_frontend
changeset 1820:2e5b303ea68e
Better handling of use terms, added view for privacy policy
author | bsw |
---|---|
date | Wed Jan 26 00:33:21 2022 +0100 (2022-01-26) |
parents | 85ca5a7e46ec |
children | 7978d87b3552 |
files | app/main/_filter/21_auth.lua app/main/_filter_view/30_navigation.lua app/main/index/privacy.lua app/main/index/usage_terms.lua |
line diff
1.1 --- a/app/main/_filter/21_auth.lua Tue Jan 25 00:46:06 2022 +0100 1.2 +++ b/app/main/_filter/21_auth.lua Wed Jan 26 00:33:21 2022 +0100 1.3 @@ -70,7 +70,8 @@ 1.4 or module == "draft" and view == "show" 1.5 or module == "file" and view == "show.jpg" 1.6 or module == "index" and view == "search" 1.7 - or module == "index" and view == "usage_terms" 1.8 + or module == "index" and view == "usage_terms" and config.use_terms_public_access == true 1.9 + or module == "index" and view == "privacy" and config.use_terms_public_access == true 1.10 or module == "help" and view == "introduction" 1.11 or module == "style" 1.12 then
2.1 --- a/app/main/_filter_view/30_navigation.lua Tue Jan 25 00:46:06 2022 +0100 2.2 +++ b/app/main/_filter_view/30_navigation.lua Wed Jan 26 00:33:21 2022 +0100 2.3 @@ -155,16 +155,25 @@ 2.4 view = 'about' 2.5 } 2.6 end } 2.7 - if not config.extra_footer_func then 2.8 - if config.use_terms and app.session.member then 2.9 + if not config.extra_footer_func and (config.use_terms_public_access or app.session.member)then 2.10 + if config.use_terms then 2.11 ui.tag{ tag = "li", content = function() 2.12 ui.link{ 2.13 - text = _"Use terms", 2.14 + text = config.use_terms_linktext or _"Use terms", 2.15 module = 'index', 2.16 view = 'usage_terms' 2.17 } 2.18 end } 2.19 end 2.20 + if config.privacy_policy then 2.21 + ui.tag{ tag = "li", content = function() 2.22 + ui.link{ 2.23 + text = config.privacy_policy_linktext or _"Privacy policy", 2.24 + module = 'index', 2.25 + view = 'privacy' 2.26 + } 2.27 + end } 2.28 + end 2.29 end 2.30 if config.extra_footer_func then 2.31 config.extra_footer_func()
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/app/main/index/privacy.lua Wed Jan 26 00:33:21 2022 +0100 3.3 @@ -0,0 +1,24 @@ 3.4 +if not config.privacy_policy then 3.5 + return execute.view { module = "index", view = "404" } 3.6 +end 3.7 + 3.8 +ui.title(config.privacy_policy_headline or _"Privacy policy") 3.9 + 3.10 +ui.grid{ content = function() 3.11 + ui.cell_main{ content = function() 3.12 + ui.container { attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function() 3.13 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 3.14 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = function() 3.15 + ui.tag{ content = config.privacy_policy_headline or _"Privacy policy" } 3.16 + if config.privacy_policy_subheadline then 3.17 + slot.put("<br>") 3.18 + ui.tag{ attr = { style = "font-size: 75%;" }, content = config.privacy_policy_subheadline } 3.19 + end 3.20 + end } 3.21 + end } 3.22 + ui.container{ attr = { class = "mdl-card__content draft" }, content = function() 3.23 + slot.put(config.privacy_policy) 3.24 + end } 3.25 + end } 3.26 + end } 3.27 +end }
4.1 --- a/app/main/index/usage_terms.lua Tue Jan 25 00:46:06 2022 +0100 4.2 +++ b/app/main/index/usage_terms.lua Wed Jan 26 00:33:21 2022 +0100 4.3 @@ -1,19 +1,24 @@ 4.4 -ui.title(_"Terms of use") 4.5 - 4.6 -ui.section( function() 4.7 +if not config.use_terms then 4.8 + return execute.view { module = "index", view = "404" } 4.9 +end 4.10 4.11 - ui.sectionHead( function() 4.12 - ui.heading { level = 1, content = _"Terms of use" } 4.13 - end ) 4.14 - 4.15 - ui.sectionRow( function() 4.16 +ui.title(config.use_terms_headline or _"Terms of use") 4.17 4.18 - ui.container{ 4.19 - attr = { class = "wiki use_terms" }, 4.20 - content = function() 4.21 +ui.grid{ content = function() 4.22 + ui.cell_main{ content = function() 4.23 + ui.container { attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function() 4.24 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 4.25 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = function() 4.26 + ui.tag{ content = config.use_terms_headline or _"Terms of use" } 4.27 + if config.use_terms_subheadline then 4.28 + slot.put("<br>") 4.29 + ui.tag{ attr = { style = "font-size: 75%;" }, content = config.use_terms_subheadline } 4.30 + end 4.31 + end } 4.32 + end } 4.33 + ui.container{ attr = { class = "mdl-card__content draft" }, content = function() 4.34 slot.put(config.use_terms) 4.35 - end 4.36 - } 4.37 - 4.38 - end ) 4.39 -end ) 4.40 \ No newline at end of file 4.41 + end } 4.42 + end } 4.43 + end } 4.44 +end }