liquid_feedback_frontend
annotate app/main/member/_list.lua @ 75:733f65c0c0a0
Bugfixes, feature enhancements, code-cleanup, and major work on API
Details:
- API
-- Allow relation name to be passed to helper function util.autoapi{...}
-- Added area API
-- Bugfixes in API
--- Correctly return initiatives (bug #162)
--- Correctly process "id" parameter for initiative API
--- Bugfix related to "state" parameter (bug #165)
--- Changed constant "discussion" to "accepted" (in model/issue.lua, used by API)
--- Fixed JSON encoding in auto_api (bug #181)
--- Ignore list filter "voted" in case of public access
--- Enable access to API without session
- Work on RSS feed (incomplete yet)
- Other bugfixes
-- Handle empty browser identification string
-- Handle invalid date in member/update.lua (bugs #24 #109 #115 #136)
-- Better handle errors while converting uploaded images. (bug #79 +5 duplicates)
-- Don't display revoked initiatives in list of new drafts (bug #134)
-- Fixed syntax error in app/main/member/_action/update_name.lua throwing unexpected error, when new name was too short
-- Do not display refresh support button for revoked initiatives
-- Repaired issue search (bug #150)
-- Fixed typos in german translation files
--- "initi(i)erte"
--- "Er(g)eignisse" (bug #161)
- Code cleanup
-- Removed deprecated motd files locale/motd/de.txt and locale/motd/de_public.txt
-- Removed redundant code in app/main/index/_updated_drafts.lua
- New features and (optical) enhancements
-- Support change of notify email; notification of not approved address added to start page
-- Settings dialog splitted into single pages
-- Mark deactivated members
-- Calendar for birthday selection in profile
-- Policy list public readable when public access is enabled
Details:
- API
-- Allow relation name to be passed to helper function util.autoapi{...}
-- Added area API
-- Bugfixes in API
--- Correctly return initiatives (bug #162)
--- Correctly process "id" parameter for initiative API
--- Bugfix related to "state" parameter (bug #165)
--- Changed constant "discussion" to "accepted" (in model/issue.lua, used by API)
--- Fixed JSON encoding in auto_api (bug #181)
--- Ignore list filter "voted" in case of public access
--- Enable access to API without session
- Work on RSS feed (incomplete yet)
- Other bugfixes
-- Handle empty browser identification string
-- Handle invalid date in member/update.lua (bugs #24 #109 #115 #136)
-- Better handle errors while converting uploaded images. (bug #79 +5 duplicates)
-- Don't display revoked initiatives in list of new drafts (bug #134)
-- Fixed syntax error in app/main/member/_action/update_name.lua throwing unexpected error, when new name was too short
-- Do not display refresh support button for revoked initiatives
-- Repaired issue search (bug #150)
-- Fixed typos in german translation files
--- "initi(i)erte"
--- "Er(g)eignisse" (bug #161)
- Code cleanup
-- Removed deprecated motd files locale/motd/de.txt and locale/motd/de_public.txt
-- Removed redundant code in app/main/index/_updated_drafts.lua
- New features and (optical) enhancements
-- Support change of notify email; notification of not approved address added to start page
-- Settings dialog splitted into single pages
-- Mark deactivated members
-- Calendar for birthday selection in profile
-- Policy list public readable when public access is enabled
| author | bsw |
|---|---|
| date | Thu Jul 08 18:44:02 2010 +0200 (2010-07-08) |
| parents | 00d1004545f1 |
| children | b9c8503feff7 |
| rev | line source |
|---|---|
| bsw/jbe@0 | 1 local members_selector = param.get("members_selector", "table") |
| bsw@3 | 2 local initiative = param.get("initiative", "table") |
| bsw@3 | 3 local issue = param.get("issue", "table") |
| bsw@3 | 4 local trustee = param.get("trustee", "table") |
| bsw@10 | 5 local initiator = param.get("initiator", "table") |
| bsw@3 | 6 |
| bsw/jbe@19 | 7 ui.add_partial_param_names{ "member_list" } |
| bsw/jbe@19 | 8 |
| bsw/jbe@19 | 9 local filter = { |
| bsw/jbe@19 | 10 label = _"Order by", |
| bsw/jbe@19 | 11 name = "member_list", |
| bsw/jbe@19 | 12 { |
| bsw/jbe@19 | 13 name = "name", |
| bsw/jbe@19 | 14 label = _"A-Z", |
| bsw/jbe@19 | 15 selector_modifier = function(selector) selector:add_order_by("name") end |
| bsw/jbe@19 | 16 }, |
| bsw/jbe@19 | 17 { |
| bsw/jbe@19 | 18 name = "name_desc", |
| bsw/jbe@19 | 19 label = _"Z-A", |
| bsw/jbe@19 | 20 selector_modifier = function(selector) selector:add_order_by("name DESC") end |
| bsw/jbe@19 | 21 }, |
| bsw@3 | 22 { |
| bsw@10 | 23 name = "newest", |
| bsw@10 | 24 label = _"Newest", |
| bsw/jbe@19 | 25 selector_modifier = function(selector) selector:add_order_by("created DESC, id DESC") end |
| bsw@10 | 26 }, |
| bsw@10 | 27 { |
| bsw@10 | 28 name = "oldest", |
| bsw@10 | 29 label = _"Oldest", |
| bsw/jbe@19 | 30 selector_modifier = function(selector) selector:add_order_by("created, id") end |
| bsw@3 | 31 }, |
| bsw@3 | 32 } |
| bsw@3 | 33 |
| bsw@3 | 34 if initiative then |
| bsw/jbe@19 | 35 filter[#filter] = { |
| bsw@3 | 36 name = "delegations", |
| bsw@3 | 37 label = _"Delegations", |
| bsw/jbe@19 | 38 selector_modifier = function(selector) selector:add_order_by("weight DESC") end |
| bsw@3 | 39 } |
| bsw@3 | 40 end |
| bsw/jbe@0 | 41 |
| bsw/jbe@19 | 42 ui.filters{ |
| bsw/jbe@19 | 43 label = _"Change order", |
| bsw/jbe@0 | 44 selector = members_selector, |
| bsw/jbe@19 | 45 filter, |
| bsw@2 | 46 content = function() |
| bsw@2 | 47 ui.paginate{ |
| bsw@2 | 48 selector = members_selector, |
| bsw@2 | 49 per_page = 100, |
| bsw@2 | 50 content = function() |
| bsw@2 | 51 ui.container{ |
| bsw@2 | 52 attr = { class = "member_list" }, |
| bsw@2 | 53 content = function() |
| bsw@3 | 54 local members = members_selector:exec() |
| bsw@3 | 55 local columns = { |
| bsw@3 | 56 { |
| bsw@3 | 57 label = _"Name", |
| bsw@3 | 58 content = function(member) |
| bsw@3 | 59 ui.link{ |
| bsw@3 | 60 module = "member", |
| bsw@3 | 61 view = "show", |
| bsw@3 | 62 id = member.id, |
| bsw@3 | 63 content = function() |
| bsw@3 | 64 ui.image{ |
| bsw@3 | 65 attr = { width = 48, height = 48 }, |
| bsw@3 | 66 module = "member", |
| bsw@3 | 67 view = "avatar", |
| bsw@3 | 68 id = member.id, |
| bsw@3 | 69 extension = "jpg" |
| bsw@3 | 70 } |
| bsw@3 | 71 end |
| bsw@3 | 72 } |
| bsw@3 | 73 end |
| bsw@3 | 74 }, |
| bsw@3 | 75 { |
| bsw@3 | 76 label = _"Name", |
| bsw@3 | 77 content = function(member) |
| bsw@3 | 78 ui.link{ |
| bsw@3 | 79 module = "member", |
| bsw@3 | 80 view = "show", |
| bsw@3 | 81 id = member.id, |
| bsw@3 | 82 content = member.name |
| bsw@3 | 83 } |
| bsw@3 | 84 if member.admin then |
| bsw@3 | 85 ui.image{ |
| bsw@3 | 86 attr = { |
| bsw@3 | 87 alt = _"Administrator", |
| bsw@3 | 88 title = _"Administrator" |
| bsw@3 | 89 }, |
| bsw@3 | 90 static = "icons/16/cog.png" |
| bsw@3 | 91 } |
| bsw@3 | 92 end |
| bsw@3 | 93 -- TODO performance |
| bsw@3 | 94 local contact = Contact:by_pk(app.session.member.id, member.id) |
| bsw@3 | 95 if contact then |
| bsw@3 | 96 ui.image{ |
| bsw@3 | 97 attr = { |
| bsw@3 | 98 alt = _"Saved as contact", |
| bsw@3 | 99 title = _"Saved as contact" |
| bsw@3 | 100 }, |
| bsw@3 | 101 static = "icons/16/book_edit.png" |
| bsw@3 | 102 } |
| bsw@3 | 103 end |
| bsw@3 | 104 end |
| bsw@3 | 105 } |
| bsw@3 | 106 } |
| bsw@3 | 107 |
| bsw@3 | 108 if initiative then |
| bsw@3 | 109 columns[#columns+1] = { |
| bsw@3 | 110 label = _"Delegations", |
| bsw@3 | 111 field_attr = { style = "text-align: right;" }, |
| bsw@3 | 112 content = function(member) |
| bsw@3 | 113 if member.weight > 1 then |
| bsw@3 | 114 ui.link{ |
| bsw@3 | 115 content = member.weight, |
| bsw@3 | 116 module = "support", |
| bsw@3 | 117 view = "show_incoming", |
| bsw@3 | 118 params = { member_id = member.id, initiative_id = initiative.id } |
| bsw@3 | 119 } |
| bsw@3 | 120 end |
| bsw@3 | 121 end |
| bsw@3 | 122 } |
| bsw@3 | 123 end |
| bsw@3 | 124 |
| bsw@3 | 125 for i, member in ipairs(members) do |
| bsw@2 | 126 execute.view{ |
| bsw@2 | 127 module = "member", |
| bsw@2 | 128 view = "_show_thumb", |
| bsw@10 | 129 params = { |
| bsw@10 | 130 member = member, |
| bsw@10 | 131 initiative = initiative, |
| bsw@10 | 132 issue = issue, |
| bsw@10 | 133 trustee = trustee, |
| bsw@10 | 134 initiator = initiator |
| bsw@10 | 135 } |
| bsw/jbe@0 | 136 } |
| bsw@2 | 137 end |
| bsw/jbe@19 | 138 |
| bsw/jbe@0 | 139 end |
| bsw/jbe@0 | 140 } |
| bsw@3 | 141 slot.put('<br style="clear: left;" />') |
| bsw@2 | 142 end |
| bsw/jbe@0 | 143 } |
| bsw/jbe@0 | 144 end |
| bsw/jbe@19 | 145 } |