liquid_feedback_frontend
annotate app/main/member/show.lua @ 138:7e7d629390d5
don't show voting page when issue is already closed
fixes bug #335
fixes bug #335
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Wed Oct 06 13:47:38 2010 +0200 (2010-10-06) |
parents | 7d0f4721d2f3 |
children | dac08fce1ab7 |
rev | line source |
---|---|
bsw/jbe@0 | 1 local member = Member:by_id(param.get_id()) |
bsw/jbe@0 | 2 |
jorges@103 | 3 app.html_title.title = member.name |
jorges@103 | 4 app.html_title.subtitle = _("Member") |
jorges@103 | 5 |
bsw/jbe@0 | 6 slot.select("title", function() |
bsw/jbe@4 | 7 execute.view{ |
bsw/jbe@4 | 8 module = "member_image", |
bsw/jbe@4 | 9 view = "_show", |
bsw/jbe@4 | 10 params = { |
bsw/jbe@4 | 11 member = member, |
bsw/jbe@4 | 12 image_type = "avatar" |
bsw/jbe@4 | 13 } |
bsw/jbe@0 | 14 } |
bsw/jbe@0 | 15 end) |
bsw/jbe@0 | 16 |
bsw/jbe@0 | 17 slot.put_into("title", encode.html(_"Member '#{member}'":gsub("#{member}", member.name))) |
bsw/jbe@0 | 18 |
bsw@57 | 19 slot.select("actions", function() |
bsw@75 | 20 if not (member.id == app.session.member.id) then |
bsw@75 | 21 if not member.active then |
bsw@75 | 22 ui.tag{ |
bsw@75 | 23 tag = "div", |
bsw@75 | 24 attr = { class = "interest deactivated_member_info" }, |
bsw@75 | 25 content = _"This member is deactivated." |
bsw@75 | 26 } |
bsw@75 | 27 slot.put(" ") |
bsw@75 | 28 end |
bsw@57 | 29 --TODO performance |
bsw@57 | 30 local contact = Contact:by_pk(app.session.member.id, member.id) |
bsw@57 | 31 if contact then |
bsw/jbe@4 | 32 ui.container{ |
bsw/jbe@4 | 33 attr = { class = "interest" }, |
bsw/jbe@4 | 34 content = _"You have saved this member as contact." |
bsw/jbe@4 | 35 } |
bsw@3 | 36 ui.link{ |
bsw/jbe@19 | 37 image = { static = "icons/16/book_delete.png" }, |
bsw/jbe@19 | 38 text = _"Remove from contacts", |
bsw@3 | 39 module = "contact", |
bsw@3 | 40 action = "remove_member", |
bsw/jbe@19 | 41 id = contact.other_member_id, |
bsw@3 | 42 routing = { |
bsw@3 | 43 default = { |
bsw@3 | 44 mode = "redirect", |
bsw@3 | 45 module = request.get_module(), |
bsw@3 | 46 view = request.get_view(), |
bsw@3 | 47 id = param.get_id_cgi(), |
bsw@3 | 48 params = param.get_all_cgi() |
bsw@3 | 49 } |
bsw@3 | 50 } |
bsw@3 | 51 } |
bsw@75 | 52 elseif member.active then |
bsw@3 | 53 ui.link{ |
bsw/jbe@19 | 54 image = { static = "icons/16/book_add.png" }, |
bsw/jbe@19 | 55 text = _"Add to my contacts", |
bsw@3 | 56 module = "contact", |
bsw@3 | 57 action = "add_member", |
bsw@3 | 58 id = member.id, |
bsw@3 | 59 routing = { |
bsw@3 | 60 default = { |
bsw@3 | 61 mode = "redirect", |
bsw@3 | 62 module = request.get_module(), |
bsw@3 | 63 view = request.get_view(), |
bsw@3 | 64 id = param.get_id_cgi(), |
bsw@3 | 65 params = param.get_all_cgi() |
bsw@3 | 66 } |
bsw@3 | 67 } |
bsw@3 | 68 } |
bsw@57 | 69 end |
bsw@3 | 70 end |
bsw@57 | 71 end) |
bsw/jbe@0 | 72 |
bsw@9 | 73 slot.select("actions", function() |
bsw@9 | 74 ui.link{ |
bsw@9 | 75 content = function() |
bsw@9 | 76 ui.image{ static = "icons/16/clock_edit.png" } |
bsw@9 | 77 slot.put(encode.html(_"Show name history")) |
bsw@9 | 78 end, |
bsw@9 | 79 module = "member", |
bsw@9 | 80 view = "history", |
bsw@9 | 81 id = member.id |
bsw@9 | 82 } |
bsw@9 | 83 end) |
bsw@9 | 84 |
bsw/jbe@4 | 85 util.help("member.show", _"Member page") |
bsw/jbe@0 | 86 |
bsw/jbe@0 | 87 execute.view{ |
bsw/jbe@0 | 88 module = "member", |
bsw/jbe@0 | 89 view = "_show", |
bsw/jbe@0 | 90 params = { member = member } |
bsw/jbe@0 | 91 } |
bsw/jbe@0 | 92 |