| rev | 
   line source | 
| 
bsw@1045
 | 
     1 local area = param.get ( "area", "table" )
 | 
| 
bsw/jbe@1309
 | 
     2 area:load_delegation_info_once_for_member_id(app.session.member_id)
 | 
| 
bsw@1045
 | 
     3 
 | 
| 
bsw@1045
 | 
     4 local participating_trustee_id
 | 
| 
bsw@1045
 | 
     5 local participating_trustee_name
 | 
| 
bsw/jbe@1309
 | 
     6 if app.session.member then
 | 
| 
bsw@1045
 | 
     7   if area.delegation_info.first_trustee_participation then
 | 
| 
bsw@1045
 | 
     8     participating_trustee_id = area.delegation_info.first_trustee_id
 | 
| 
bsw@1045
 | 
     9     participating_trustee_name = area.delegation_info.first_trustee_name
 | 
| 
bsw@1045
 | 
    10   elseif area.delegation_info.other_trustee_participation then
 | 
| 
bsw@1045
 | 
    11     participating_trustee_id = area.delegation_info.other_trustee_id
 | 
| 
bsw@1045
 | 
    12     participating_trustee_name = area.delegation_info.other_trustee_name
 | 
| 
bsw@1045
 | 
    13   end
 | 
| 
bsw@1045
 | 
    14 end
 | 
| 
bsw@1045
 | 
    15 
 | 
| 
bsw/jbe@1309
 | 
    16 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    17   ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    18     ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" }
 | 
| 
bsw/jbe@1309
 | 
    19   end }
 | 
| 
bsw/jbe@1309
 | 
    20   ui.container{ attr = { class = "what-can-i-do-here" }, content = function()
 | 
| 
bsw@1045
 | 
    21 
 | 
| 
bsw/jbe@1309
 | 
    22     if app.session.member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
 | 
| 
bsw@1250
 | 
    23     
 | 
| 
bsw/jbe@1309
 | 
    24       if not app.session.member.disable_notifications then
 | 
| 
bsw/jbe@1309
 | 
    25         
 | 
| 
bsw/jbe@1309
 | 
    26         local ignored_area = IgnoredArea:by_pk(app.session.member_id, area.id)
 | 
| 
bsw@1250
 | 
    27 
 | 
| 
bsw/jbe@1309
 | 
    28         if not ignored_area then
 | 
| 
bsw/jbe@1309
 | 
    29           ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    30             ui.tag{ content = _"You are receiving updates by email for this subject area" }
 | 
| 
bsw/jbe@1309
 | 
    31             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw/jbe@1309
 | 
    32               ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
    33                 ui.tag { content = function ()
 | 
| 
bsw/jbe@1309
 | 
    34                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
    35                     module = "area", action = "update_ignore",
 | 
| 
bsw/jbe@1309
 | 
    36                     params = { area_id = area.id },
 | 
| 
bsw/jbe@1309
 | 
    37                     routing = { default = {
 | 
| 
bsw/jbe@1309
 | 
    38                       mode = "redirect", module = "index", view = "index", params = { unit = area.unit_id, area = area.id }
 | 
| 
bsw/jbe@1309
 | 
    39                     } },
 | 
| 
bsw/jbe@1309
 | 
    40                     text = _"unsubscribe from update emails about this area"
 | 
| 
bsw/jbe@1309
 | 
    41                   }
 | 
| 
bsw/jbe@1309
 | 
    42                 end }
 | 
| 
bsw@1250
 | 
    43               end }
 | 
| 
bsw@1250
 | 
    44             end }
 | 
| 
bsw@1250
 | 
    45           end }
 | 
| 
bsw/jbe@1309
 | 
    46         end
 | 
| 
bsw/jbe@1309
 | 
    47         
 | 
| 
bsw/jbe@1309
 | 
    48         if ignored_area then
 | 
| 
bsw/jbe@1309
 | 
    49           ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    50             ui.tag{ content = _"I want to stay informed" }
 | 
| 
bsw/jbe@1309
 | 
    51             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw/jbe@1309
 | 
    52               ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
    53                 ui.tag { content = function ()
 | 
| 
bsw/jbe@1309
 | 
    54                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
    55                     module = "area", action = "update_ignore",
 | 
| 
bsw/jbe@1309
 | 
    56                     params = { area_id = area.id, delete = true },
 | 
| 
bsw/jbe@1309
 | 
    57                     routing = { default = {
 | 
| 
bsw/jbe@1309
 | 
    58                       mode = "redirect", module = "index", view = "index", params = { unit = area.unit_id, area = area.id }
 | 
| 
bsw/jbe@1309
 | 
    59                     } },
 | 
| 
bsw/jbe@1309
 | 
    60                     text = _"subscribe for update emails about this area"
 | 
| 
bsw/jbe@1309
 | 
    61                   }
 | 
| 
bsw/jbe@1309
 | 
    62                 end }
 | 
| 
bsw/jbe@1309
 | 
    63               end }
 | 
| 
bsw/jbe@1309
 | 
    64             end }
 | 
| 
bsw/jbe@1309
 | 
    65           end }
 | 
| 
bsw/jbe@1309
 | 
    66         end
 | 
| 
bsw@1250
 | 
    67       
 | 
| 
bsw/jbe@1309
 | 
    68       else
 | 
| 
bsw/jbe@1309
 | 
    69         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    70           ui.tag{ content = _"I want to stay informed about this subject area" }
 | 
| 
bsw@1250
 | 
    71           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw@1250
 | 
    72             ui.tag { tag = "li", content = function ()
 | 
| 
bsw@1250
 | 
    73               ui.tag { content = function ()
 | 
| 
bsw/jbe@1309
 | 
    74                 ui.tag{ content = _"Edit your global " }
 | 
| 
bsw@1250
 | 
    75                 ui.link {
 | 
| 
bsw/jbe@1309
 | 
    76                   module = "member", view = "settings_notification",
 | 
| 
bsw/jbe@1309
 | 
    77                   params = { return_to = "area", return_to_area_id = area.id },
 | 
| 
bsw/jbe@1309
 | 
    78                   text = _"notification settings"
 | 
| 
bsw@1250
 | 
    79                 }
 | 
| 
bsw/jbe@1309
 | 
    80                 ui.tag{ content = _" to receive updates by email" }
 | 
| 
bsw@1250
 | 
    81               end }
 | 
| 
bsw@1250
 | 
    82             end }
 | 
| 
bsw@1250
 | 
    83           end }
 | 
| 
bsw@1250
 | 
    84         end }
 | 
| 
bsw/jbe@1309
 | 
    85       end
 | 
| 
bsw@1045
 | 
    86       
 | 
| 
bsw/jbe@1309
 | 
    87       if app.session.member:has_voting_right_for_unit_id ( area.unit_id ) then
 | 
| 
bsw/jbe@1309
 | 
    88         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    89           ui.tag{ content = _"I want to vote" }
 | 
| 
bsw/jbe@1309
 | 
    90           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw/jbe@1309
 | 
    91             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@1045
 | 
    92           end }
 | 
| 
bsw@1045
 | 
    93         end }
 | 
| 
bsw/jbe@1309
 | 
    94       end
 | 
| 
bsw/jbe@1309
 | 
    95       
 | 
| 
bsw/jbe@1309
 | 
    96       if app.session.member and not app.session.member:has_voting_right_for_unit_id(area.unit_id) then
 | 
| 
bsw/jbe@1309
 | 
    97         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = _"You are not entitled to vote in this unit" }
 | 
| 
bsw/jbe@1309
 | 
    98       end
 | 
| 
bsw@1045
 | 
    99       
 | 
| 
bsw/jbe@1309
 | 
   100       if app.session.member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
 | 
| 
bsw/jbe@1309
 | 
   101 
 | 
| 
bsw/jbe@1309
 | 
   102         if not config.disable_delegations then
 | 
| 
bsw/jbe@1309
 | 
   103           
 | 
| 
bsw/jbe@1309
 | 
   104           ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
   105 
 | 
| 
bsw/jbe@1309
 | 
   106             if not area.delegation_info.first_trustee_id then
 | 
| 
bsw/jbe@1309
 | 
   107               ui.tag{ content = _"I want to delegate this subject area" }
 | 
| 
bsw/jbe@1309
 | 
   108             else
 | 
| 
bsw/jbe@1309
 | 
   109               ui.tag{ content = _"You delegated this subject area" }
 | 
| 
bsw/jbe@1309
 | 
   110             end
 | 
| 
bsw@1045
 | 
   111 
 | 
| 
bsw/jbe@1309
 | 
   112             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw/jbe@1309
 | 
   113               if area.delegation_info.own_delegation_scope == "unit" then
 | 
| 
bsw/jbe@1309
 | 
   114                 ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   115                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
   116                     module = "delegation", view = "show", params = {
 | 
| 
bsw/jbe@1309
 | 
   117                       unit_id = area.unit_id,
 | 
| 
bsw/jbe@1309
 | 
   118                     },
 | 
| 
bsw/jbe@1309
 | 
   119                     content = _("change/revoke delegation of organizational unit")
 | 
| 
bsw/jbe@1309
 | 
   120                   }
 | 
| 
bsw/jbe@1309
 | 
   121                 end }
 | 
| 
bsw/jbe@1309
 | 
   122               end
 | 
| 
bsw/jbe@1309
 | 
   123               
 | 
| 
bsw/jbe@1309
 | 
   124               if area.delegation_info.own_delegation_scope == nil then
 | 
| 
bsw/jbe@1309
 | 
   125                 ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   126                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
   127                     module = "delegation", view = "show", params = {
 | 
| 
bsw/jbe@1309
 | 
   128                       area_id = area.id
 | 
| 
bsw/jbe@1309
 | 
   129                     },
 | 
| 
bsw/jbe@1309
 | 
   130                     content = _"choose subject area delegatee" 
 | 
| 
bsw/jbe@1309
 | 
   131                   }
 | 
| 
bsw/jbe@1309
 | 
   132                 end }
 | 
| 
bsw/jbe@1309
 | 
   133               elseif area.delegation_info.own_delegation_scope == "area" then
 | 
| 
bsw/jbe@1309
 | 
   134                 ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   135                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
   136                     module = "delegation", view = "show", params = {
 | 
| 
bsw/jbe@1309
 | 
   137                       area_id = area.id
 | 
| 
bsw/jbe@1309
 | 
   138                     },
 | 
| 
bsw/jbe@1309
 | 
   139                     content = _"change/revoke area delegation" 
 | 
| 
bsw/jbe@1309
 | 
   140                   }
 | 
| 
bsw/jbe@1309
 | 
   141                 end }
 | 
| 
bsw/jbe@1309
 | 
   142               else
 | 
| 
bsw/jbe@1309
 | 
   143                 ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   144                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
   145                     module = "delegation", view = "show", params = {
 | 
| 
bsw/jbe@1309
 | 
   146                       area_id = area.id
 | 
| 
bsw/jbe@1309
 | 
   147                     },
 | 
| 
bsw/jbe@1309
 | 
   148                     content = _"change/revoke delegation only for this subject area" 
 | 
| 
bsw/jbe@1309
 | 
   149                   }
 | 
| 
bsw/jbe@1309
 | 
   150                 end }
 | 
| 
bsw/jbe@1309
 | 
   151               end
 | 
| 
bsw/jbe@1309
 | 
   152             end }
 | 
| 
bsw/jbe@1309
 | 
   153           end }
 | 
| 
bsw/jbe@1309
 | 
   154         end 
 | 
| 
bsw/jbe@1309
 | 
   155         
 | 
| 
bsw/jbe@1309
 | 
   156         if app.session.member:has_initiative_right_for_unit_id ( area.unit_id ) then
 | 
| 
bsw/jbe@1309
 | 
   157           ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
   158             ui.tag{
 | 
| 
bsw/jbe@1309
 | 
   159               content = _("I want to start a new initiative", {
 | 
| 
bsw/jbe@1309
 | 
   160                 area_name = area.name
 | 
| 
bsw/jbe@1309
 | 
   161               } ) 
 | 
| 
bsw@1045
 | 
   162             }
 | 
| 
bsw/jbe@1309
 | 
   163             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw/jbe@1309
 | 
   164               ui.tag { tag = "li", content = _"Take a look through the existing issues. Maybe someone else started a debate on your topic (and you can join it) or the topic has been decided already in the past." }
 | 
| 
bsw/jbe@1309
 | 
   165               ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   166                 ui.tag { content = function ()
 | 
| 
bsw/jbe@1309
 | 
   167                   ui.tag { content = _"If you cannot find any appropriate existing issue, " }
 | 
| 
bsw/jbe@1309
 | 
   168                   ui.link {
 | 
| 
bsw@1568
 | 
   169                     module = "draft", view = "new",
 | 
| 
bsw/jbe@1309
 | 
   170                     params = { area_id = area.id },
 | 
| 
bsw/jbe@1309
 | 
   171                     text = _"start an initiative in a new issue"
 | 
| 
bsw/jbe@1309
 | 
   172                   }
 | 
| 
bsw/jbe@1309
 | 
   173                 end }
 | 
| 
bsw/jbe@1309
 | 
   174               end }
 | 
| 
bsw/jbe@1309
 | 
   175             end }
 | 
| 
bsw@1045
 | 
   176           end }
 | 
| 
bsw@1045
 | 
   177         end
 | 
| 
bsw/jbe@1309
 | 
   178             
 | 
| 
bsw/jbe@1309
 | 
   179       end
 | 
| 
bsw/jbe@1309
 | 
   180     else
 | 
| 
bsw/jbe@1309
 | 
   181       ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
 | 
| 
bsw/jbe@1309
 | 
   182         ui.tag{ content = _"You are not entitled to vote in this unit" }
 | 
| 
bsw/jbe@1309
 | 
   183         ui.tag{ tag = "ul", content = function()
 | 
| 
bsw/jbe@1309
 | 
   184           ui.tag{ tag = "li", content = function()
 | 
| 
bsw/jbe@1309
 | 
   185             ui.link{ module = "index", view = "login", content = _"Login" }
 | 
| 
bsw@1045
 | 
   186           end }
 | 
| 
bsw@1045
 | 
   187         end }
 | 
| 
bsw/jbe@1309
 | 
   188       end }
 | 
| 
bsw@1045
 | 
   189     end
 | 
| 
bsw/jbe@1309
 | 
   190   end }
 | 
| 
bsw@1045
 | 
   191   
 | 
| 
bsw/jbe@1309
 | 
   192 end }
 |