liquid_feedback_frontend
view app/main/unit/_sidebar_whatcanido.lua @ 1635:bbb537ba81b2
Added new API endpoint avatar
| author | bsw | 
|---|---|
| date | Mon Feb 08 16:26:21 2021 +0100 (2021-02-08) | 
| parents | 52545dba4205 | 
| children | 58e1e8d6f596 | 
 line source
     1 local unit = param.get ( "unit", "table" )
     2 unit:load_delegation_info_once_for_member_id(app.session.member_id)
     4 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
     5   ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
     6     ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" }
     7   end }
     8   ui.container{ attr = { class = "what-can-i-do-here" }, content = function()
    10     if app.session.member and app.session.member:has_voting_right_for_unit_id ( unit.id ) then
    11       ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
    12         ui.tag{ content = _"I want to stay informed" }
    13         ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    14           ui.tag { tag = "li", content = function ()
    15             ui.tag{ content = _"check your " }
    16             ui.link{
    17               module = "member", view = "settings_notification",
    18               params = { return_to = "home" },
    19               text = _"notifications settings"
    20             }
    21           end }
    22           if not config.voting_only then
    23             ui.tag { tag = "li", content = function ()
    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)" }
    25             end }
    26           end
    27         end } 
    28       end }
    30       if not config.disable_delegations then
    31         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
    32           if not unit.delegation_info.first_trustee_id then
    33             ui.tag{ content = _"I want to delegate this organizational unit" }
    34             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    35               ui.tag { tag = "li", content = function ()
    36                 ui.link {
    37                   module = "delegation", view = "show", params = {
    38                     unit_id = unit.id,
    39                   },
    40                   content = _("choose delegatee", {
    41                     unit_name = unit.name
    42                   })
    43                 }
    44               end }
    45             end }
    46           else
    47             ui.tag{ content = _"You delegated this unit" }
    49             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    50               ui.tag { tag = "li", content = function ()
    51                 ui.link {
    52                   module = "delegation", view = "show", params = {
    53                     unit_id = unit.id,
    54                   },
    55                   content = _("change/revoke delegation", {
    56                     unit_name = unit.name
    57                   })
    58                 }
    59               end }
    60             end }
    61           end
    62         end }
    63       end
    65       ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
    66         ui.tag{
    67           content = _"I want to vote" 
    68         }
    69         ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    70           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." }
    71         end }
    72       end }
    74     else
    75       ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
    76         ui.tag{ content = _"You are not entitled to vote in this unit" }
    77         if not app.session.member_id then
    78           ui.tag{ tag = "ul", content = function()
    79             ui.tag{ tag = "li", content = function()
    80               ui.link{ module = "index", view = "login", content = _"Login" }
    81             end }
    82           end }
    83         end
    84       end }
    85     end
    87     if not config.voting_only and app.session.member_id and app.session.member:has_initiative_right_for_unit_id ( unit.id ) then
    88       ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
    89         ui.tag{ content = _"I want to start a new initiative" }
    90         ui.tag{ tag = "ul", attr = { class = "ul" }, content = function ()
    91           ui.tag { tag = "li", content = _"open the appropriate subject area for your issue and follow the instruction on that page." }
    92         end } 
    93       end }
    94     end
    96   end }
    98 end }
