liquid_feedback_frontend
diff app/main/initiative/_list.lua @ 5:afd9f769c7ae
Version beta1
Final voting with Schulze-Method is now possible
Many bug fixes and code cleanup
Registration with invite codes
More sort and filter options
Seperated display of "supporters" and "potential supporters"
Optical changes
Flood limit / initiative contigent is now checked by frontend
Neccessary changes to access core beta11
Final voting with Schulze-Method is now possible
Many bug fixes and code cleanup
Registration with invite codes
More sort and filter options
Seperated display of "supporters" and "potential supporters"
Optical changes
Flood limit / initiative contigent is now checked by frontend
Neccessary changes to access core beta11
| author | bsw/jbe |
|---|---|
| date | Fri Dec 25 12:00:00 2009 +0100 (2009-12-25) |
| parents | 80c215dbf076 |
| children | 72c5e0ee7c98 |
line diff
1.1 --- a/app/main/initiative/_list.lua Thu Dec 10 12:00:00 2009 +0100 1.2 +++ b/app/main/initiative/_list.lua Fri Dec 25 12:00:00 2009 +0100 1.3 @@ -9,32 +9,32 @@ 1.4 order_options[#order_options+1] = { 1.5 name = "rank", 1.6 label = _"Rank", 1.7 - order_by = "initiative.rank" 1.8 + order_by = "initiative.rank, initiative.admitted DESC, vote_ratio(initiative.positive_votes, initiative.negative_votes) DESC, initiative.id" 1.9 } 1.10 end 1.11 1.12 order_options[#order_options+1] = { 1.13 + name = "potential_support", 1.14 + label = _"Potential support", 1.15 + order_by = "initiative.supporter_count::float / issue.population::float DESC, initiative.id" 1.16 +} 1.17 + 1.18 +order_options[#order_options+1] = { 1.19 name = "support", 1.20 label = _"Support", 1.21 - order_by = "initiative.supporter_count::float / issue.population::float DESC" 1.22 -} 1.23 - 1.24 -order_options[#order_options+1] = { 1.25 - name = "support_si", 1.26 - label = _"Support S+I", 1.27 - order_by = "initiative.satisfied_informed_supporter_count::float / issue.population::float DESC" 1.28 + order_by = "initiative.satisfied_supporter_count::float / issue.population::float DESC, initiative.id" 1.29 } 1.30 1.31 order_options[#order_options+1] = { 1.32 name = "newest", 1.33 label = _"Newest", 1.34 - order_by = "initiative.created DESC" 1.35 + order_by = "initiative.created DESC, initiative.id" 1.36 } 1.37 1.38 order_options[#order_options+1] = { 1.39 name = "oldest", 1.40 label = _"Oldest", 1.41 - order_by = "initiative.created" 1.42 + order_by = "initiative.created, initiative.id" 1.43 } 1.44 1.45 local name = "initiative_list" 1.46 @@ -61,18 +61,22 @@ 1.47 } 1.48 columns[#columns+1] = { 1.49 content = function(record) 1.50 - if record.issue.accepted and record.issue.closed and record.issue.ranks_available then 1.51 - if record.negative_votes and record.positive_votes then 1.52 - local max_value = record.issue.voter_count 1.53 - ui.bargraph{ 1.54 - max_value = max_value, 1.55 - width = 100, 1.56 - bars = { 1.57 - { color = "#0a0", value = record.positive_votes }, 1.58 - { color = "#aaa", value = max_value - record.negative_votes - record.positive_votes }, 1.59 - { color = "#a00", value = record.negative_votes }, 1.60 + if record.issue.accepted and record.issue.closed then 1.61 + if record.issue.ranks_available then 1.62 + if record.negative_votes and record.positive_votes then 1.63 + local max_value = record.issue.voter_count 1.64 + ui.bargraph{ 1.65 + max_value = max_value, 1.66 + width = 100, 1.67 + bars = { 1.68 + { color = "#0a0", value = record.positive_votes }, 1.69 + { color = "#aaa", value = max_value - record.negative_votes - record.positive_votes }, 1.70 + { color = "#a00", value = record.negative_votes }, 1.71 + } 1.72 } 1.73 - } 1.74 + end 1.75 + else 1.76 + slot.put(_"Counting of votes") 1.77 end 1.78 else 1.79 local max_value = (record.issue.population or 0) 1.80 @@ -81,7 +85,7 @@ 1.81 width = 100, 1.82 bars = { 1.83 { color = "#0a0", value = (record.satisfied_supporter_count or 0) }, 1.84 - { color = "#8f8", value = (record.supporter_count or 0) - (record.satisfied_supporter_count or 0) }, 1.85 + { color = "#777", value = (record.supporter_count or 0) - (record.satisfied_supporter_count or 0) }, 1.86 { color = "#ddd", value = max_value - (record.supporter_count or 0) }, 1.87 } 1.88 }