liquid_feedback_frontend
diff app/main/unit/_sidebar_whatcanido.lua @ 1309:32cc544d5a5b
Cumulative patch for upcoming frontend version 4
| author | bsw/jbe | 
|---|---|
| date | Sun Jul 15 14:07:29 2018 +0200 (2018-07-15) | 
| parents | 701a5cf6b067 | 
| children | 32b9e4070777 | 
   line diff
1.1 --- a/app/main/unit/_sidebar_whatcanido.lua Thu Jun 23 03:30:57 2016 +0200 1.2 +++ b/app/main/unit/_sidebar_whatcanido.lua Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -1,69 +1,108 @@ 1.4 local unit = param.get ( "unit", "table" ) 1.5 +unit:load_delegation_info_once_for_member_id(app.session.member_id) 1.6 1.7 -ui.sidebar ( "tab-whatcanido", function () 1.8 +ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 1.9 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 1.10 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" } 1.11 + end } 1.12 + ui.container{ attr = { class = "what-can-i-do-here" }, content = function() 1.13 1.14 - ui.sidebarHeadWhatCanIDo() 1.15 - 1.16 - if app.session.member then 1.17 - 1.18 - if app.session.member:has_voting_right_for_unit_id ( unit.id ) then 1.19 - ui.sidebarSection( function () 1.20 - 1.21 - if not unit.delegation_info.first_trustee_id then 1.22 - ui.heading{ level = 3, content = _"I want to delegate this organizational unit" } 1.23 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.24 + if app.session.member and app.session.member:has_voting_right_for_unit_id ( unit.id ) then 1.25 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.26 + ui.tag{ content = _"I want to stay informed" } 1.27 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.28 + ui.tag { tag = "li", content = function () 1.29 + ui.tag{ content = _"check your " } 1.30 + ui.link{ 1.31 + module = "member", view = "settings_notification", 1.32 + params = { return_to = "home" }, 1.33 + text = _"notifications settings" 1.34 + } 1.35 + end } 1.36 + if not config.voting_only then 1.37 ui.tag { tag = "li", content = function () 1.38 - ui.link { 1.39 - module = "delegation", view = "show", params = { 1.40 - unit_id = unit.id, 1.41 - }, 1.42 - content = _("choose delegatee", { 1.43 - unit_name = unit.name 1.44 - }) 1.45 + ui.tag{ content = _"subscribe subject areas or add your interested to issues and you will be notified about changes (follow the instruction on the area or issue page)" } 1.46 + end } 1.47 + end 1.48 + end } 1.49 + end } 1.50 + 1.51 + if not config.disable_delegations then 1.52 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.53 + if not unit.delegation_info.first_trustee_id then 1.54 + ui.tag{ content = _"I want to delegate this organizational unit" } 1.55 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.56 + ui.tag { tag = "li", content = function () 1.57 + ui.link { 1.58 + module = "delegation", view = "show", params = { 1.59 + unit_id = unit.id, 1.60 + }, 1.61 + content = _("choose delegatee", { 1.62 + unit_name = unit.name 1.63 + }) 1.64 + } 1.65 + end } 1.66 + end } 1.67 + else 1.68 + ui.container { attr = { class = "right" }, content = function() 1.69 + local member = Member:by_id(unit.delegation_info.first_trustee_id) 1.70 + execute.view{ 1.71 + module = "member_image", 1.72 + view = "_show", 1.73 + params = { 1.74 + member = member, 1.75 + image_type = "avatar", 1.76 + show_dummy = true 1.77 + } 1.78 } 1.79 end } 1.80 - end } 1.81 - else 1.82 - ui.container { attr = { class = "right" }, content = function() 1.83 - local member = Member:by_id(unit.delegation_info.first_trustee_id) 1.84 - execute.view{ 1.85 - module = "member_image", 1.86 - view = "_show", 1.87 - params = { 1.88 - member = member, 1.89 - image_type = "avatar", 1.90 - show_dummy = true 1.91 - } 1.92 - } 1.93 - end } 1.94 - ui.heading{ level = 3, content = _"You delegated this unit" } 1.95 + ui.tag{ content = _"You delegated this unit" } 1.96 1.97 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.98 - ui.tag { tag = "li", content = function () 1.99 - ui.link { 1.100 - module = "delegation", view = "show", params = { 1.101 - unit_id = unit.id, 1.102 - }, 1.103 - content = _("change/revoke delegation", { 1.104 - unit_name = unit.name 1.105 - }) 1.106 - } 1.107 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.108 + ui.tag { tag = "li", content = function () 1.109 + ui.link { 1.110 + module = "delegation", view = "show", params = { 1.111 + unit_id = unit.id, 1.112 + }, 1.113 + content = _("change/revoke delegation", { 1.114 + unit_name = unit.name 1.115 + }) 1.116 + } 1.117 + end } 1.118 end } 1.119 - end } 1.120 - end 1.121 - end ) 1.122 + end 1.123 + end } 1.124 + end 1.125 + 1.126 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.127 + ui.tag{ 1.128 + content = _"I want to vote" 1.129 + } 1.130 + ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.131 + ui.tag { tag = "li", content = _"check the issues on the right, and click on 'Vote now' to vote on an issue which is in voting phase." } 1.132 + end } 1.133 + end } 1.134 1.135 - ui.sidebarSection( function() 1.136 - ui.heading { level = 3, content = _"I want to start a new initiative" } 1.137 - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () 1.138 - ui.tag { tag = "li", content = _"Open the appropriate subject area where your issue fits in and follow the instruction on that page." } 1.139 - end } 1.140 - end ) 1.141 + else 1.142 + ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function () 1.143 + ui.tag{ content = _"You are not entitled to vote in this unit" } 1.144 + ui.tag{ tag = "ul", content = function() 1.145 + ui.tag{ tag = "li", content = function() 1.146 + ui.link{ module = "index", view = "login", content = _"Login" } 1.147 + end } 1.148 + end } 1.149 + end } 1.150 + end 1.151 1.152 - else 1.153 - ui.sidebarSection( _"You are not entitled to vote in this unit" ) 1.154 + if not config.voting_only and app.session.member_id and app.session.member:has_initiative_right_for_unit_id ( unit.id ) then 1.155 + ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() 1.156 + ui.tag{ content = _"I want to start a new initiative" } 1.157 + ui.tag{ tag = "ul", attr = { class = "ul" }, content = function () 1.158 + ui.tag { tag = "li", content = _"open the appropriate subject area for your issue and follow the instruction on that page." } 1.159 + end } 1.160 + end } 1.161 end 1.162 - 1.163 - end 1.164 + 1.165 + end } 1.166 1.167 -end ) 1.168 \ No newline at end of file 1.169 +end }