bsw@1045: local area = param.get ( "area", "table" )
bsw/jbe@1309: area:load_delegation_info_once_for_member_id(app.session.member_id)
bsw@1045:
bsw@1045: local participating_trustee_id
bsw@1045: local participating_trustee_name
bsw/jbe@1309: if app.session.member then
bsw@1045: if area.delegation_info.first_trustee_participation then
bsw@1045: participating_trustee_id = area.delegation_info.first_trustee_id
bsw@1045: participating_trustee_name = area.delegation_info.first_trustee_name
bsw@1045: elseif area.delegation_info.other_trustee_participation then
bsw@1045: participating_trustee_id = area.delegation_info.other_trustee_id
bsw@1045: participating_trustee_name = area.delegation_info.other_trustee_name
bsw@1045: end
bsw@1045: end
bsw@1045:
bsw/jbe@1309: ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw/jbe@1309: ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
bsw/jbe@1309: ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"What can I do here?" }
bsw/jbe@1309: end }
bsw/jbe@1309: ui.container{ attr = { class = "what-can-i-do-here" }, content = function()
bsw@1045:
bsw/jbe@1309: if app.session.member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
bsw@1250:
bsw/jbe@1309: if not app.session.member.disable_notifications then
bsw/jbe@1309:
bsw/jbe@1309: local ignored_area = IgnoredArea:by_pk(app.session.member_id, area.id)
bsw@1250:
bsw/jbe@1309: if not ignored_area then
bsw/jbe@1309: ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309: ui.tag{ content = _"You are receiving updates by email for this subject area" }
bsw/jbe@1309: ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309: ui.tag { tag = "li", content = function ()
bsw/jbe@1309: ui.tag { content = function ()
bsw/jbe@1309: ui.link {
bsw/jbe@1309: module = "area", action = "update_ignore",
bsw/jbe@1309: params = { area_id = area.id },
bsw/jbe@1309: routing = { default = {
bsw/jbe@1309: mode = "redirect", module = "index", view = "index", params = { unit = area.unit_id, area = area.id }
bsw/jbe@1309: } },
bsw/jbe@1309: text = _"unsubscribe from update emails about this area"
bsw/jbe@1309: }
bsw/jbe@1309: end }
bsw@1250: end }
bsw@1250: end }
bsw@1250: end }
bsw/jbe@1309: end
bsw/jbe@1309:
bsw/jbe@1309: if ignored_area then
bsw/jbe@1309: ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309: ui.tag{ content = _"I want to stay informed" }
bsw/jbe@1309: ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309: ui.tag { tag = "li", content = function ()
bsw/jbe@1309: ui.tag { content = function ()
bsw/jbe@1309: ui.link {
bsw/jbe@1309: module = "area", action = "update_ignore",
bsw/jbe@1309: params = { area_id = area.id, delete = true },
bsw/jbe@1309: routing = { default = {
bsw/jbe@1309: mode = "redirect", module = "index", view = "index", params = { unit = area.unit_id, area = area.id }
bsw/jbe@1309: } },
bsw/jbe@1309: text = _"subscribe for update emails about this area"
bsw/jbe@1309: }
bsw/jbe@1309: end }
bsw/jbe@1309: end }
bsw/jbe@1309: end }
bsw/jbe@1309: end }
bsw/jbe@1309: end
bsw@1250:
bsw/jbe@1309: else
bsw/jbe@1309: ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309: ui.tag{ content = _"I want to stay informed about this subject area" }
bsw@1250: ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw@1250: ui.tag { tag = "li", content = function ()
bsw@1250: ui.tag { content = function ()
bsw@1791: local text = _"Edit your global notification settings to receive updates by email."
bsw@1791: local text_pre, text_link, text_post = string.match(text, "([^<]*)([^<]+)([^<]*)")
bsw@1791: ui.tag{ content = text_pre }
bsw@1250: ui.link {
bsw/jbe@1309: module = "member", view = "settings_notification",
bsw/jbe@1309: params = { return_to = "area", return_to_area_id = area.id },
bsw@1791: text = text_link
bsw@1250: }
bsw@1791: ui.tag{ content = text_post }
bsw@1250: end }
bsw@1250: end }
bsw@1250: end }
bsw@1250: end }
bsw/jbe@1309: end
bsw@1045:
bsw/jbe@1309: if app.session.member and app.session.member:has_voting_right_for_unit_id(area.unit_id) then
bsw/jbe@1309:
bsw/jbe@1309: if not config.disable_delegations then
bsw/jbe@1309:
bsw/jbe@1309: ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309:
bsw/jbe@1309: if not area.delegation_info.first_trustee_id then
bsw/jbe@1309: ui.tag{ content = _"I want to delegate this subject area" }
bsw/jbe@1309: else
bsw/jbe@1309: ui.tag{ content = _"You delegated this subject area" }
bsw/jbe@1309: end
bsw@1045:
bsw/jbe@1309: ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309: if area.delegation_info.own_delegation_scope == "unit" then
bsw/jbe@1309: ui.tag { tag = "li", content = function ()
bsw/jbe@1309: ui.link {
bsw/jbe@1309: module = "delegation", view = "show", params = {
bsw/jbe@1309: unit_id = area.unit_id,
bsw/jbe@1309: },
bsw/jbe@1309: content = _("change/revoke delegation of organizational unit")
bsw/jbe@1309: }
bsw/jbe@1309: end }
bsw/jbe@1309: end
bsw/jbe@1309:
bsw/jbe@1309: if area.delegation_info.own_delegation_scope == nil then
bsw/jbe@1309: ui.tag { tag = "li", content = function ()
bsw/jbe@1309: ui.link {
bsw/jbe@1309: module = "delegation", view = "show", params = {
bsw/jbe@1309: area_id = area.id
bsw/jbe@1309: },
bsw/jbe@1309: content = _"choose subject area delegatee"
bsw/jbe@1309: }
bsw/jbe@1309: end }
bsw/jbe@1309: elseif area.delegation_info.own_delegation_scope == "area" then
bsw/jbe@1309: ui.tag { tag = "li", content = function ()
bsw/jbe@1309: ui.link {
bsw/jbe@1309: module = "delegation", view = "show", params = {
bsw/jbe@1309: area_id = area.id
bsw/jbe@1309: },
bsw/jbe@1309: content = _"change/revoke area delegation"
bsw/jbe@1309: }
bsw/jbe@1309: end }
bsw/jbe@1309: else
bsw/jbe@1309: ui.tag { tag = "li", content = function ()
bsw/jbe@1309: ui.link {
bsw/jbe@1309: module = "delegation", view = "show", params = {
bsw/jbe@1309: area_id = area.id
bsw/jbe@1309: },
bsw/jbe@1309: content = _"change/revoke delegation only for this subject area"
bsw/jbe@1309: }
bsw/jbe@1309: end }
bsw/jbe@1309: end
bsw/jbe@1309: end }
bsw/jbe@1309: end }
bsw/jbe@1309: end
bsw/jbe@1309:
bsw/jbe@1309: if app.session.member:has_initiative_right_for_unit_id ( area.unit_id ) then
bsw/jbe@1309: ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw/jbe@1309: ui.tag{
bsw/jbe@1309: content = _("I want to start a new initiative", {
bsw/jbe@1309: area_name = area.name
bsw/jbe@1309: } )
bsw@1045: }
bsw/jbe@1309: ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw/jbe@1309: 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: ui.tag { tag = "li", content = function ()
bsw/jbe@1309: ui.tag { content = function ()
bsw/jbe@1309: ui.tag { content = _"If you cannot find any appropriate existing issue, " }
bsw/jbe@1309: ui.link {
bsw@1568: module = "draft", view = "new",
bsw/jbe@1309: params = { area_id = area.id },
bsw/jbe@1309: text = _"start an initiative in a new issue"
bsw/jbe@1309: }
bsw/jbe@1309: end }
bsw/jbe@1309: end }
bsw/jbe@1309: end }
bsw@1045: end }
bsw@1045: end
bsw@1713: end
bsw@1713: if app.session.member:has_voting_right_for_unit_id ( area.unit_id ) then
bsw@1713: ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
bsw@1713: ui.tag{ content = _"I want to vote" }
bsw@1713: ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
bsw@1713: 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: end }
bsw@1713: end }
bsw/jbe@1309: end
bsw/jbe@1309: else
bsw/jbe@1309: ui.container { attr = { class = "mdl-card__content mdl-card--border" }, content = function ()
bsw@1716: if not app.session.member_id then
bsw@1716: ui.tag{ content = _"Login to participate" }
bsw@1716: ui.tag{ tag = "ul", content = function()
bsw@1716: ui.tag{ tag = "li", content = function()
bsw@1788: ui.link{ module = "index", view = "login", content = _"Login [button]" }
bsw@1716: end }
bsw@1045: end }
bsw@1716: else
bsw@1716: ui.tag{ content = _"You are not entitled to vote in this unit" }
bsw@1716: end
bsw/jbe@1309: end }
bsw@1045: end
bsw/jbe@1309: end }
bsw@1045:
bsw/jbe@1309: end }