| 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 and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
 | 
| 
bsw/jbe@1309
 | 
    88 
 | 
| 
bsw/jbe@1309
 | 
    89         if not config.disable_delegations then
 | 
| 
bsw/jbe@1309
 | 
    90           
 | 
| 
bsw/jbe@1309
 | 
    91           ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    92 
 | 
| 
bsw/jbe@1309
 | 
    93             if not area.delegation_info.first_trustee_id then
 | 
| 
bsw/jbe@1309
 | 
    94               ui.tag{ content = _"I want to delegate this subject area" }
 | 
| 
bsw/jbe@1309
 | 
    95             else
 | 
| 
bsw/jbe@1309
 | 
    96               ui.tag{ content = _"You delegated this subject area" }
 | 
| 
bsw/jbe@1309
 | 
    97             end
 | 
| 
bsw@1045
 | 
    98 
 | 
| 
bsw/jbe@1309
 | 
    99             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw/jbe@1309
 | 
   100               if area.delegation_info.own_delegation_scope == "unit" then
 | 
| 
bsw/jbe@1309
 | 
   101                 ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   102                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
   103                     module = "delegation", view = "show", params = {
 | 
| 
bsw/jbe@1309
 | 
   104                       unit_id = area.unit_id,
 | 
| 
bsw/jbe@1309
 | 
   105                     },
 | 
| 
bsw/jbe@1309
 | 
   106                     content = _("change/revoke delegation of organizational unit")
 | 
| 
bsw/jbe@1309
 | 
   107                   }
 | 
| 
bsw/jbe@1309
 | 
   108                 end }
 | 
| 
bsw/jbe@1309
 | 
   109               end
 | 
| 
bsw/jbe@1309
 | 
   110               
 | 
| 
bsw/jbe@1309
 | 
   111               if area.delegation_info.own_delegation_scope == nil then
 | 
| 
bsw/jbe@1309
 | 
   112                 ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   113                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
   114                     module = "delegation", view = "show", params = {
 | 
| 
bsw/jbe@1309
 | 
   115                       area_id = area.id
 | 
| 
bsw/jbe@1309
 | 
   116                     },
 | 
| 
bsw/jbe@1309
 | 
   117                     content = _"choose subject area delegatee" 
 | 
| 
bsw/jbe@1309
 | 
   118                   }
 | 
| 
bsw/jbe@1309
 | 
   119                 end }
 | 
| 
bsw/jbe@1309
 | 
   120               elseif area.delegation_info.own_delegation_scope == "area" then
 | 
| 
bsw/jbe@1309
 | 
   121                 ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   122                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
   123                     module = "delegation", view = "show", params = {
 | 
| 
bsw/jbe@1309
 | 
   124                       area_id = area.id
 | 
| 
bsw/jbe@1309
 | 
   125                     },
 | 
| 
bsw/jbe@1309
 | 
   126                     content = _"change/revoke area delegation" 
 | 
| 
bsw/jbe@1309
 | 
   127                   }
 | 
| 
bsw/jbe@1309
 | 
   128                 end }
 | 
| 
bsw/jbe@1309
 | 
   129               else
 | 
| 
bsw/jbe@1309
 | 
   130                 ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   131                   ui.link {
 | 
| 
bsw/jbe@1309
 | 
   132                     module = "delegation", view = "show", params = {
 | 
| 
bsw/jbe@1309
 | 
   133                       area_id = area.id
 | 
| 
bsw/jbe@1309
 | 
   134                     },
 | 
| 
bsw/jbe@1309
 | 
   135                     content = _"change/revoke delegation only for this subject area" 
 | 
| 
bsw/jbe@1309
 | 
   136                   }
 | 
| 
bsw/jbe@1309
 | 
   137                 end }
 | 
| 
bsw/jbe@1309
 | 
   138               end
 | 
| 
bsw/jbe@1309
 | 
   139             end }
 | 
| 
bsw/jbe@1309
 | 
   140           end }
 | 
| 
bsw/jbe@1309
 | 
   141         end 
 | 
| 
bsw/jbe@1309
 | 
   142         
 | 
| 
bsw/jbe@1309
 | 
   143         if app.session.member:has_initiative_right_for_unit_id ( area.unit_id ) then
 | 
| 
bsw/jbe@1309
 | 
   144           ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
   145             ui.tag{
 | 
| 
bsw/jbe@1309
 | 
   146               content = _("I want to start a new initiative", {
 | 
| 
bsw/jbe@1309
 | 
   147                 area_name = area.name
 | 
| 
bsw/jbe@1309
 | 
   148               } ) 
 | 
| 
bsw@1045
 | 
   149             }
 | 
| 
bsw/jbe@1309
 | 
   150             ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw/jbe@1309
 | 
   151               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
 | 
   152               ui.tag { tag = "li", content = function ()
 | 
| 
bsw/jbe@1309
 | 
   153                 ui.tag { content = function ()
 | 
| 
bsw/jbe@1309
 | 
   154                   ui.tag { content = _"If you cannot find any appropriate existing issue, " }
 | 
| 
bsw/jbe@1309
 | 
   155                   ui.link {
 | 
| 
bsw@1568
 | 
   156                     module = "draft", view = "new",
 | 
| 
bsw/jbe@1309
 | 
   157                     params = { area_id = area.id },
 | 
| 
bsw/jbe@1309
 | 
   158                     text = _"start an initiative in a new issue"
 | 
| 
bsw/jbe@1309
 | 
   159                   }
 | 
| 
bsw/jbe@1309
 | 
   160                 end }
 | 
| 
bsw/jbe@1309
 | 
   161               end }
 | 
| 
bsw/jbe@1309
 | 
   162             end }
 | 
| 
bsw@1045
 | 
   163           end }
 | 
| 
bsw@1045
 | 
   164         end
 | 
| 
bsw@1713
 | 
   165       end
 | 
| 
bsw@1713
 | 
   166       if app.session.member:has_voting_right_for_unit_id ( area.unit_id ) then
 | 
| 
bsw@1713
 | 
   167         ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw@1713
 | 
   168           ui.tag{ content = _"I want to vote" }
 | 
| 
bsw@1713
 | 
   169           ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
 | 
| 
bsw@1713
 | 
   170             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@1713
 | 
   171           end }
 | 
| 
bsw@1713
 | 
   172         end }
 | 
| 
bsw/jbe@1309
 | 
   173       end
 | 
| 
bsw/jbe@1309
 | 
   174     else
 | 
| 
bsw/jbe@1309
 | 
   175       ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
 | 
| 
bsw@1716
 | 
   176         if not app.session.member_id then
 | 
| 
bsw@1716
 | 
   177           ui.tag{ content = _"Login to participate" }
 | 
| 
bsw@1716
 | 
   178           ui.tag{ tag = "ul", content = function()
 | 
| 
bsw@1716
 | 
   179             ui.tag{ tag = "li", content = function()
 | 
| 
bsw@1716
 | 
   180               ui.link{ module = "index", view = "login", content = _"Login" }
 | 
| 
bsw@1716
 | 
   181             end }
 | 
| 
bsw@1045
 | 
   182           end }
 | 
| 
bsw@1716
 | 
   183         else
 | 
| 
bsw@1716
 | 
   184           ui.tag{ content = _"You are not entitled to vote in this unit" }
 | 
| 
bsw@1716
 | 
   185         end
 | 
| 
bsw/jbe@1309
 | 
   186       end }
 | 
| 
bsw@1045
 | 
   187     end
 | 
| 
bsw/jbe@1309
 | 
   188   end }
 | 
| 
bsw@1045
 | 
   189   
 | 
| 
bsw/jbe@1309
 | 
   190 end }
 |