liquid_feedback_frontend

diff app/main/issue/show_tab.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
author bsw/jbe
date Sat Feb 20 22:10:31 2010 +0100 (2010-02-20)
parents
children 53a45356c107
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/issue/show_tab.lua	Sat Feb 20 22:10:31 2010 +0100
     1.3 @@ -0,0 +1,69 @@
     1.4 +local issue
     1.5 +if request.get_json_request_slots() then
     1.6 +  issue = Issue:by_id(param.get("issue_id"))
     1.7 +else
     1.8 +  issue = param.get("issue", "table")
     1.9 +end
    1.10 +
    1.11 +local voting_requested_percentage = 0
    1.12 +if issue.vote_later and issue.population and issue.population > 0 then
    1.13 +  voting_requested_percentage = math.ceil(issue.vote_later  / issue.population * 100)
    1.14 +end
    1.15 +
    1.16 +local interested_members_selector = issue:get_reference_selector("interested_members_snapshot")
    1.17 +  :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id")
    1.18 +  :add_field("direct_interest_snapshot.weight")
    1.19 +  :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event")
    1.20 +
    1.21 +local voting_requests_selector = issue:get_reference_selector("interested_members_snapshot")
    1.22 +  :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id")
    1.23 +  :add_where("direct_interest_snapshot.voting_requested = false")
    1.24 +
    1.25 +local delegations_selector = issue:get_reference_selector("delegations")
    1.26 +
    1.27 +
    1.28 +ui.tabs{
    1.29 +  module = "issue",
    1.30 +  view = "show_tab",
    1.31 +  static_params = { issue_id = issue.id },
    1.32 +  {
    1.33 +    name = "interested_members",
    1.34 +    label = _"Interested members" .. " (" .. tostring(interested_members_selector:count()) .. ")" ,
    1.35 +    icon = { static = "icons/16/eye.png" },
    1.36 +    module = "member",
    1.37 +    view = "_list",
    1.38 +    params = {
    1.39 +      issue = issue,
    1.40 +      members_selector = interested_members_selector
    1.41 +    }
    1.42 +  },
    1.43 +  {
    1.44 +    name = "voting_requests",
    1.45 +    label = _"Vote later requests" .. " (" .. tostring(voting_requests_selector:count()) .. ") (" .. tostring(voting_requested_percentage) ..  "%)",
    1.46 +    icon = { static = "icons/16/clock_play.png" },
    1.47 +    module = "member",
    1.48 +    view = "_list",
    1.49 +    params = {
    1.50 +      issue = issue,
    1.51 +      members_selector = voting_requests_selector
    1.52 +    }
    1.53 +  },
    1.54 +  {
    1.55 +    name = "delegations",
    1.56 +    label = _"Delegations" .. " (" .. tostring(delegations_selector:count()) .. ")" ,
    1.57 +    icon = { static = "icons/16/table_go.png" },
    1.58 +    module = "delegation",
    1.59 +    view = "_list",
    1.60 +    params = { delegations_selector = delegations_selector }
    1.61 +  },
    1.62 +  {
    1.63 +    name = "details",
    1.64 +    label = _"Details",
    1.65 +    icon = { static = "icons/16/magnifier.png" },
    1.66 +    module = "issue",
    1.67 +    view = "_details",
    1.68 +    params = { issue = issue }
    1.69 +  },
    1.70 +}
    1.71 +
    1.72 +

Impressum / About Us