liquid_feedback_frontend
view app/main/unit/_sidebar_whatcanido.lua @ 1448:969d6aa521d6
Changed order in admin sidebar, added whitespace between links
| author | bsw | 
|---|---|
| date | Thu Oct 18 17:13:59 2018 +0200 (2018-10-18) | 
| parents | 32cc544d5a5b | 
| children | 32b9e4070777 | 
 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.container { attr = { class = "right" }, content = function()
    48               local member = Member:by_id(unit.delegation_info.first_trustee_id)
    49               execute.view{
    50                 module = "member_image",
    51                 view = "_show",
    52                 params = {
    53                   member = member,
    54                   image_type = "avatar",
    55                   show_dummy = true
    56                 }
    57               }
    58             end }
    59             ui.tag{ content = _"You delegated this unit" }
    61             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    62               ui.tag { tag = "li", content = function ()
    63                 ui.link {
    64                   module = "delegation", view = "show", params = {
    65                     unit_id = unit.id,
    66                   },
    67                   content = _("change/revoke delegation", {
    68                     unit_name = unit.name
    69                   })
    70                 }
    71               end }
    72             end }
    73           end
    74         end }
    75       end
    77       ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
    78         ui.tag{
    79           content = _"I want to vote" 
    80         }
    81         ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
    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." }
    83         end }
    84       end }
    86     else
    87       ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
    88         ui.tag{ content = _"You are not entitled to vote in this unit" }
    89         ui.tag{ tag = "ul", content = function()
    90           ui.tag{ tag = "li", content = function()
    91             ui.link{ module = "index", view = "login", content = _"Login" }
    92           end }
    93         end }
    94       end }
    95     end
    97     if not config.voting_only and app.session.member_id and app.session.member:has_initiative_right_for_unit_id ( unit.id ) then
    98       ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
    99         ui.tag{ content = _"I want to start a new initiative" }
   100         ui.tag{ tag = "ul", attr = { class = "ul" }, content = function ()
   101           ui.tag { tag = "li", content = _"open the appropriate subject area for your issue and follow the instruction on that page." }
   102         end } 
   103       end }
   104     end
   106   end }
   108 end }
