bsw/jbe@0: local area = param.get("area", "table") bsw/jbe@0: bsw/jbe@4: local membership = Membership:by_pk(area.id, app.session.member.id) bsw/jbe@4: bsw@525: if membership then bsw/jbe@0: bsw@525: ui.container{ bsw@525: attr = { bsw@525: class = "head head_active", bsw@525: }, bsw@525: content = function() bsw@525: ui.image{ bsw@525: static = "icons/16/user_green.png" bsw@525: } bsw@525: slot.put(_"You are member") bsw@525: end bsw@525: } bsw/jbe@4: bsw@525: ui.link{ bsw@525: image = { static = "icons/16/cross.png" }, bsw@525: text = _"Withdraw membership", bsw@525: module = "membership", bsw@525: action = "update", bsw@525: params = { area_id = area.id, delete = true }, bsw@525: routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } } bsw@525: } bsw@525: elseif app.session.member:has_voting_right_for_unit_id(area.unit_id) then bsw@525: ui.link{ bsw@525: image = { static = "icons/16/user_add.png" }, bsw@525: text = _"Become a member", bsw@525: module = "membership", bsw@525: action = "update", bsw@525: params = { area_id = area.id }, bsw@525: routing = { bsw@525: default = { bsw@525: mode = "redirect", bsw@525: module = "area", bsw@525: view = "show", bsw@525: id = area.id bsw/jbe@4: } bsw/jbe@4: } bsw@525: } bsw@525: end bsw/jbe@4: