liquid_feedback_frontend

annotate 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
rev   line source
bsw@1045 1 local unit = param.get ( "unit", "table" )
bsw/jbe@1309 2 unit:load_delegation_info_once_for_member_id(app.session.member_id)
bsw@1045 3
bsw/jbe@1309 4 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw/jbe@1309 5 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
bsw/jbe@1309 6 ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" }
bsw/jbe@1309 7 end }
bsw/jbe@1309 8 ui.container{ attr = { class = "what-can-i-do-here" }, content = function()
bsw@1045 9
bsw/jbe@1309 10 if app.session.member and app.session.member:has_voting_right_for_unit_id ( unit.id ) then
bsw/jbe@1309 11 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309 12 ui.tag{ content = _"I want to stay informed" }
bsw/jbe@1309 13 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 14 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 15 ui.tag{ content = _"check your " }
bsw/jbe@1309 16 ui.link{
bsw/jbe@1309 17 module = "member", view = "settings_notification",
bsw/jbe@1309 18 params = { return_to = "home" },
bsw/jbe@1309 19 text = _"notifications settings"
bsw/jbe@1309 20 }
bsw/jbe@1309 21 end }
bsw/jbe@1309 22 if not config.voting_only then
bsw@1045 23 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 24 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)" }
bsw/jbe@1309 25 end }
bsw/jbe@1309 26 end
bsw/jbe@1309 27 end }
bsw/jbe@1309 28 end }
bsw/jbe@1309 29
bsw/jbe@1309 30 if not config.disable_delegations then
bsw/jbe@1309 31 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309 32 if not unit.delegation_info.first_trustee_id then
bsw/jbe@1309 33 ui.tag{ content = _"I want to delegate this organizational unit" }
bsw/jbe@1309 34 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 35 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 36 ui.link {
bsw/jbe@1309 37 module = "delegation", view = "show", params = {
bsw/jbe@1309 38 unit_id = unit.id,
bsw/jbe@1309 39 },
bsw/jbe@1309 40 content = _("choose delegatee", {
bsw/jbe@1309 41 unit_name = unit.name
bsw/jbe@1309 42 })
bsw/jbe@1309 43 }
bsw/jbe@1309 44 end }
bsw/jbe@1309 45 end }
bsw/jbe@1309 46 else
bsw/jbe@1309 47 ui.container { attr = { class = "right" }, content = function()
bsw/jbe@1309 48 local member = Member:by_id(unit.delegation_info.first_trustee_id)
bsw/jbe@1309 49 execute.view{
bsw/jbe@1309 50 module = "member_image",
bsw/jbe@1309 51 view = "_show",
bsw/jbe@1309 52 params = {
bsw/jbe@1309 53 member = member,
bsw/jbe@1309 54 image_type = "avatar",
bsw/jbe@1309 55 show_dummy = true
bsw/jbe@1309 56 }
bsw@1045 57 }
bsw@1045 58 end }
bsw/jbe@1309 59 ui.tag{ content = _"You delegated this unit" }
bsw@1045 60
bsw/jbe@1309 61 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 62 ui.tag { tag = "li", content = function ()
bsw/jbe@1309 63 ui.link {
bsw/jbe@1309 64 module = "delegation", view = "show", params = {
bsw/jbe@1309 65 unit_id = unit.id,
bsw/jbe@1309 66 },
bsw/jbe@1309 67 content = _("change/revoke delegation", {
bsw/jbe@1309 68 unit_name = unit.name
bsw/jbe@1309 69 })
bsw/jbe@1309 70 }
bsw/jbe@1309 71 end }
bsw@1045 72 end }
bsw/jbe@1309 73 end
bsw/jbe@1309 74 end }
bsw/jbe@1309 75 end
bsw/jbe@1309 76
bsw/jbe@1309 77 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309 78 ui.tag{
bsw/jbe@1309 79 content = _"I want to vote"
bsw/jbe@1309 80 }
bsw/jbe@1309 81 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 82 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." }
bsw/jbe@1309 83 end }
bsw/jbe@1309 84 end }
bsw@1045 85
bsw/jbe@1309 86 else
bsw/jbe@1309 87 ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw/jbe@1309 88 ui.tag{ content = _"You are not entitled to vote in this unit" }
bsw/jbe@1309 89 ui.tag{ tag = "ul", content = function()
bsw/jbe@1309 90 ui.tag{ tag = "li", content = function()
bsw/jbe@1309 91 ui.link{ module = "index", view = "login", content = _"Login" }
bsw/jbe@1309 92 end }
bsw/jbe@1309 93 end }
bsw/jbe@1309 94 end }
bsw/jbe@1309 95 end
bsw@1045 96
bsw/jbe@1309 97 if not config.voting_only and app.session.member_id and app.session.member:has_initiative_right_for_unit_id ( unit.id ) then
bsw/jbe@1309 98 ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309 99 ui.tag{ content = _"I want to start a new initiative" }
bsw/jbe@1309 100 ui.tag{ tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309 101 ui.tag { tag = "li", content = _"open the appropriate subject area for your issue and follow the instruction on that page." }
bsw/jbe@1309 102 end }
bsw/jbe@1309 103 end }
bsw@1045 104 end
bsw/jbe@1309 105
bsw/jbe@1309 106 end }
bsw@1045 107
bsw/jbe@1309 108 end }

Impressum / About Us