liquid_feedback_frontend
annotate app/main/admin/member_list.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 | 3bfb2fcf7ab9 |
children | 46351752814f |
rev | line source |
---|---|
bsw/jbe@0 | 1 slot.put_into("title", _"Member list") |
bsw/jbe@0 | 2 |
bsw/jbe@0 | 3 slot.select("actions", function() |
bsw/jbe@0 | 4 ui.link{ |
bsw/jbe@0 | 5 attr = { class = { "admin_only" } }, |
bsw/jbe@0 | 6 text = _"Register new member", |
bsw/jbe@0 | 7 module = "admin", |
bsw/jbe@0 | 8 view = "member_edit" |
bsw/jbe@0 | 9 } |
bsw/jbe@0 | 10 if param.get("show_locked") then |
bsw/jbe@0 | 11 ui.link{ |
bsw/jbe@0 | 12 attr = { class = { "admin_only" } }, |
bsw/jbe@0 | 13 text = _"Show active members", |
bsw/jbe@0 | 14 module = "admin", |
bsw/jbe@0 | 15 view = "member_list" |
bsw/jbe@0 | 16 } |
bsw/jbe@0 | 17 else |
bsw/jbe@0 | 18 ui.link{ |
bsw/jbe@0 | 19 attr = { class = { "admin_only" } }, |
bsw/jbe@0 | 20 text = _"Show locked members", |
bsw/jbe@0 | 21 module = "admin", |
bsw/jbe@0 | 22 view = "member_list", |
bsw/jbe@0 | 23 params = { show_locked = true } |
bsw/jbe@0 | 24 } |
bsw/jbe@0 | 25 end |
bsw/jbe@0 | 26 end) |
bsw/jbe@0 | 27 |
bsw/jbe@0 | 28 local members_selector |
bsw/jbe@0 | 29 |
bsw/jbe@0 | 30 if param.get("show_locked", atom.boolean) then |
bsw/jbe@0 | 31 members_selector = Member:new_selector() |
bsw/jbe@0 | 32 :add_where("not active") |
bsw/jbe@0 | 33 :add_order_by("login") |
bsw/jbe@0 | 34 else |
bsw/jbe@0 | 35 members_selector = Member:new_selector() |
bsw/jbe@0 | 36 :add_where("active") |
bsw/jbe@0 | 37 :add_order_by("login") |
bsw/jbe@0 | 38 end |
bsw/jbe@0 | 39 |
bsw/jbe@0 | 40 ui.paginate{ |
bsw/jbe@0 | 41 selector = members_selector, |
bsw/jbe@0 | 42 content = function() |
bsw/jbe@0 | 43 ui.list{ |
bsw/jbe@0 | 44 records = members_selector:exec(), |
bsw/jbe@0 | 45 columns = { |
bsw/jbe@0 | 46 { |
bsw/jbe@0 | 47 field_attr = { style = "text-align: right;" }, |
bsw/jbe@0 | 48 label = _"Id", |
bsw/jbe@0 | 49 name = "id" |
bsw/jbe@0 | 50 }, |
bsw/jbe@0 | 51 { |
bsw/jbe@0 | 52 label = _"Login", |
bsw/jbe@0 | 53 name = "login" |
bsw/jbe@0 | 54 }, |
bsw/jbe@0 | 55 { |
bsw/jbe@0 | 56 label = _"Name", |
bsw/jbe@0 | 57 content = function(record) |
bsw/jbe@0 | 58 util.put_highlighted_string(record.name) |
bsw/jbe@0 | 59 end |
bsw/jbe@0 | 60 }, |
bsw/jbe@0 | 61 { |
bsw/jbe@0 | 62 label = _"Ident number", |
bsw/jbe@0 | 63 name = "ident_number" |
bsw/jbe@0 | 64 }, |
bsw/jbe@0 | 65 { |
bsw/jbe@0 | 66 label = _"Admin?", |
bsw/jbe@0 | 67 name = "admin" |
bsw/jbe@0 | 68 }, |
bsw/jbe@0 | 69 { |
bsw/jbe@0 | 70 content = function(record) |
bsw/jbe@0 | 71 if app.session.member.admin and not record.active then |
bsw/jbe@0 | 72 ui.field.text{ value = "locked" } |
bsw/jbe@0 | 73 end |
bsw/jbe@0 | 74 end |
bsw/jbe@0 | 75 }, |
bsw/jbe@0 | 76 { |
bsw/jbe@0 | 77 content = function(record) |
bsw/jbe@0 | 78 if app.session.member.admin then |
bsw/jbe@0 | 79 ui.link{ |
bsw/jbe@0 | 80 attr = { class = "action admin_only" }, |
bsw/jbe@0 | 81 text = _"Edit", |
bsw/jbe@0 | 82 module = "admin", |
bsw/jbe@0 | 83 view = "member_edit", |
bsw/jbe@0 | 84 id = record.id |
bsw/jbe@0 | 85 } |
bsw/jbe@0 | 86 end |
bsw/jbe@0 | 87 end |
bsw/jbe@0 | 88 } |
bsw/jbe@0 | 89 } |
bsw/jbe@0 | 90 } |
bsw/jbe@0 | 91 end |
bsw/jbe@0 | 92 } |