liquid_feedback_frontend
annotate app/main/member/_show_thumb.lua @ 19:00d1004545f1
Dynamic interface using XMLHttpRequests, and many other changes
Bugfixes:
- Only allow voting on admitted initiatives
- Repaired issue search
- Don't display delegations for closed issues on member page
- Don't show revoke link in initiative, when issue is already half_frozen
- Localization for voting JavaScript
- Display author of suggestions
Disclosure of voting data after voting is finished:
- Possibility to inspect every ballot including preferences
- Show number of voters preferring one initiative to another initiative
Interface behaviour changes:
- Reversed default order of drafts
- Default order of suggestions changed
- Show new drafts of initiatives only once per day in timeline
Accessibility:
- Barrier-free voting implemented
- POST links are now accessible without JavaScript
- Changed gray for unsatisfied supporters in bar graph to a lighter gray
Other interface improvements:
- Optical enhancements
- Dynamic interface using XMLHttpRequests
- Show usage terms in about section
- Show own membership in area listing
- Show uninformed supporters greyed out and marked with yellow question mark
- Warning box in non-admitted initiatives
- When voted, don't display voting notice and change label of voting link
- Show object counts in more tabulator heads
- Enlarged member statement input field
Miscellaneous:
- Code cleanup
- Added README file containing installation instructions
- Use new WebMCP function ui.filters{...} instead of own ui.filter and ui.order functions
Bugfixes:
- Only allow voting on admitted initiatives
- Repaired issue search
- Don't display delegations for closed issues on member page
- Don't show revoke link in initiative, when issue is already half_frozen
- Localization for voting JavaScript
- Display author of suggestions
Disclosure of voting data after voting is finished:
- Possibility to inspect every ballot including preferences
- Show number of voters preferring one initiative to another initiative
Interface behaviour changes:
- Reversed default order of drafts
- Default order of suggestions changed
- Show new drafts of initiatives only once per day in timeline
Accessibility:
- Barrier-free voting implemented
- POST links are now accessible without JavaScript
- Changed gray for unsatisfied supporters in bar graph to a lighter gray
Other interface improvements:
- Optical enhancements
- Dynamic interface using XMLHttpRequests
- Show usage terms in about section
- Show own membership in area listing
- Show uninformed supporters greyed out and marked with yellow question mark
- Warning box in non-admitted initiatives
- When voted, don't display voting notice and change label of voting link
- Show object counts in more tabulator heads
- Enlarged member statement input field
Miscellaneous:
- Code cleanup
- Added README file containing installation instructions
- Use new WebMCP function ui.filters{...} instead of own ui.filter and ui.order functions
author | bsw/jbe |
---|---|
date | Sat Feb 20 22:10:31 2010 +0100 (2010-02-20) |
parents | 72c5e0ee7c98 |
children | 0849be391140 |
rev | line source |
---|---|
bsw@10 | 1 local initiator = param.get("initiator", "table") |
bsw@2 | 2 local member = param.get("member", "table") |
bsw@2 | 3 |
bsw@3 | 4 local issue = param.get("issue", "table") |
bsw@3 | 5 local initiative = param.get("initiative", "table") |
bsw@3 | 6 local trustee = param.get("trustee", "table") |
bsw@3 | 7 |
bsw@2 | 8 local name |
bsw@2 | 9 if member.name_highlighted then |
bsw@2 | 10 name = encode.highlight(member.name_highlighted) |
bsw@2 | 11 else |
bsw@2 | 12 name = encode.html(member.name) |
bsw@2 | 13 end |
bsw@2 | 14 |
bsw@10 | 15 local container_class = "member_thumb" |
bsw@10 | 16 if initiator and member.accepted ~= true then |
bsw@10 | 17 container_class = container_class .. " not_accepted" |
bsw@10 | 18 end |
bsw@10 | 19 |
bsw/jbe@19 | 20 if member.is_informed == false then |
bsw/jbe@19 | 21 container_class = container_class .. " not_informed" |
bsw/jbe@19 | 22 end |
bsw/jbe@19 | 23 |
bsw@3 | 24 ui.container{ |
bsw@10 | 25 attr = { class = container_class }, |
bsw@2 | 26 content = function() |
bsw@3 | 27 ui.container{ |
bsw@3 | 28 attr = { class = "flags" }, |
bsw@3 | 29 content = function() |
bsw/jbe@19 | 30 |
bsw/jbe@19 | 31 if member.grade then |
bsw/jbe@19 | 32 ui.link{ |
bsw/jbe@19 | 33 module = "vote", |
bsw/jbe@19 | 34 view = "list", |
bsw/jbe@19 | 35 params = { |
bsw/jbe@19 | 36 issue_id = initiative.issue.id, |
bsw/jbe@19 | 37 member_id = member.id, |
bsw/jbe@19 | 38 }, |
bsw/jbe@19 | 39 content = function() |
bsw/jbe@19 | 40 if member.grade > 0 then |
bsw/jbe@19 | 41 ui.image{ |
bsw/jbe@19 | 42 attr = { |
bsw/jbe@19 | 43 alt = _"Voted yes", |
bsw/jbe@19 | 44 title = _"Voted yes" |
bsw/jbe@19 | 45 }, |
bsw/jbe@19 | 46 static = "icons/16/thumb_up_green.png" |
bsw/jbe@19 | 47 } |
bsw/jbe@19 | 48 elseif member.grade < 0 then |
bsw/jbe@19 | 49 ui.image{ |
bsw/jbe@19 | 50 attr = { |
bsw/jbe@19 | 51 alt = _"Voted no", |
bsw/jbe@19 | 52 title = _"Voted no" |
bsw/jbe@19 | 53 }, |
bsw/jbe@19 | 54 static = "icons/16/thumb_down_red.png" |
bsw/jbe@19 | 55 } |
bsw/jbe@19 | 56 else |
bsw/jbe@19 | 57 ui.image{ |
bsw/jbe@19 | 58 attr = { |
bsw/jbe@19 | 59 alt = _"Abstention", |
bsw/jbe@19 | 60 title = _"Abstention" |
bsw/jbe@19 | 61 }, |
bsw/jbe@19 | 62 static = "icons/16/bullet_yellow.png" |
bsw/jbe@19 | 63 } |
bsw/jbe@19 | 64 end |
bsw/jbe@19 | 65 end |
bsw/jbe@19 | 66 } |
bsw/jbe@19 | 67 end |
bsw/jbe@19 | 68 |
bsw/jbe@6 | 69 local weight = 0 |
bsw/jbe@6 | 70 if member.weight then |
bsw/jbe@6 | 71 weight = member.weight |
bsw/jbe@6 | 72 end |
bsw/jbe@6 | 73 if member.voter_weight then |
bsw/jbe@6 | 74 weight = member.voter_weight |
bsw/jbe@6 | 75 end |
bsw/jbe@6 | 76 if (issue or initiative) and weight > 1 then |
bsw@3 | 77 local module |
bsw@3 | 78 if issue then |
bsw@3 | 79 module = "interest" |
bsw@3 | 80 elseif initiative then |
bsw/jbe@6 | 81 if member.voter_weight then |
bsw/jbe@6 | 82 module = "vote" |
bsw/jbe@6 | 83 else |
bsw/jbe@6 | 84 module = "supporter" |
bsw/jbe@6 | 85 end |
bsw@3 | 86 end |
bsw@3 | 87 ui.link{ |
bsw@3 | 88 attr = { title = _"Number of incoming delegations, follow link to see more details" }, |
bsw/jbe@6 | 89 content = _("+ #{weight}", { weight = weight - 1 }), |
bsw@3 | 90 module = module, |
bsw@3 | 91 view = "show_incoming", |
bsw@3 | 92 params = { |
bsw@3 | 93 member_id = member.id, |
bsw@3 | 94 initiative_id = initiative and initiative.id or nil, |
bsw@3 | 95 issue_id = issue and issue.id or nil |
bsw@3 | 96 } |
bsw@3 | 97 } |
bsw/jbe@6 | 98 end |
bsw/jbe@19 | 99 |
bsw@10 | 100 if initiator and initiator.accepted then |
bsw@10 | 101 if member.accepted == nil then |
bsw@10 | 102 slot.put(_"Invited") |
bsw@10 | 103 elseif member.accepted == false then |
bsw@10 | 104 slot.put(_"Rejected") |
bsw@10 | 105 end |
bsw@10 | 106 end |
bsw/jbe@19 | 107 |
bsw/jbe@19 | 108 if member.is_informed == false then |
bsw/jbe@19 | 109 local text = _"Member has not approved latest draft" |
bsw/jbe@19 | 110 ui.image{ |
bsw/jbe@19 | 111 attr = { alt = text, title = text }, |
bsw/jbe@19 | 112 static = "icons/16/help_yellow.png" |
bsw/jbe@6 | 113 } |
bsw@3 | 114 end |
bsw/jbe@19 | 115 |
bsw@3 | 116 if member.admin then |
bsw@3 | 117 ui.image{ |
bsw@3 | 118 attr = { |
bsw@3 | 119 alt = _"Member is administrator", |
bsw@3 | 120 title = _"Member is administrator" |
bsw@3 | 121 }, |
bsw@3 | 122 static = "icons/16/cog.png" |
bsw@3 | 123 } |
bsw@3 | 124 end |
bsw/jbe@19 | 125 |
bsw@3 | 126 -- TODO performance |
bsw@3 | 127 local contact = Contact:by_pk(app.session.member.id, member.id) |
bsw@3 | 128 if contact then |
bsw@3 | 129 ui.image{ |
bsw@3 | 130 attr = { |
bsw@3 | 131 alt = _"You have saved this member as contact", |
bsw@3 | 132 title = _"You have saved this member as contact" |
bsw@3 | 133 }, |
bsw@3 | 134 static = "icons/16/bullet_disk.png" |
bsw@3 | 135 } |
bsw@3 | 136 end |
bsw@3 | 137 end |
bsw@2 | 138 } |
bsw/jbe@4 | 139 |
bsw@3 | 140 ui.link{ |
bsw@3 | 141 attr = { title = _"Show member" }, |
bsw@3 | 142 module = "member", |
bsw@3 | 143 view = "show", |
bsw@3 | 144 id = member.id, |
bsw@3 | 145 content = function() |
bsw/jbe@4 | 146 execute.view{ |
bsw/jbe@4 | 147 module = "member_image", |
bsw/jbe@4 | 148 view = "_show", |
bsw/jbe@4 | 149 params = { |
bsw/jbe@4 | 150 member = member, |
bsw/jbe@4 | 151 image_type = "avatar", |
bsw/jbe@4 | 152 show_dummy = true |
bsw/jbe@4 | 153 } |
bsw@3 | 154 } |
bsw@3 | 155 ui.container{ |
bsw@3 | 156 attr = { class = "member_name" }, |
bsw@3 | 157 content = function() |
bsw@3 | 158 slot.put(name) |
bsw@3 | 159 end |
bsw@3 | 160 } |
bsw@3 | 161 end |
bsw@3 | 162 } |
bsw@2 | 163 end |
bsw@3 | 164 } |