liquid_feedback_frontend

diff app/main/supporter/_show_box.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
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/supporter/_show_box.lua	Thu Dec 10 12:00:00 2009 +0100
     1.2 +++ b/app/main/supporter/_show_box.lua	Fri Dec 25 12:00:00 2009 +0100
     1.3 @@ -1,29 +1,48 @@
     1.4  
     1.5  slot.select("support", function()
     1.6    local initiative = param.get("initiative", "table")
     1.7 -  local supported = Supporter:by_pk(initiative.id, app.session.member.id) and true or false
     1.8 +  local supporter = Supporter:by_pk(initiative.id, app.session.member.id)
     1.9  
    1.10    ui.container{
    1.11      attr = { class = "actions" },
    1.12      content = function()
    1.13 -      if not initiative.issue.frozen and not initiative.issue.closed then
    1.14 -        if supported then
    1.15 -          ui.container{
    1.16 -            attr = {
    1.17 -              class = "head head_active",
    1.18 -              style = "cursor: pointer;",
    1.19 -              onclick = "document.getElementById('support_content').style.display = 'block';"
    1.20 -            },
    1.21 -            content = function()
    1.22 -              ui.image{
    1.23 -                static = "icons/16/thumb_up_green.png"
    1.24 -              }
    1.25 -              slot.put(_"Your are supporter")
    1.26 -              ui.image{
    1.27 -                static = "icons/16/dropdown.png"
    1.28 -              }
    1.29 -            end
    1.30 -          }
    1.31 +      if not initiative.issue.fully_frozen and not initiative.issue.closed then
    1.32 +        if supporter then
    1.33 +          if not supporter:has_critical_opinion() then
    1.34 +            ui.container{
    1.35 +              attr = {
    1.36 +                class = "head head_supporter",
    1.37 +                style = "cursor: pointer;",
    1.38 +                onclick = "document.getElementById('support_content').style.display = 'block';"
    1.39 +              },
    1.40 +              content = function()
    1.41 +                ui.image{
    1.42 +                  static = "icons/16/thumb_up_green.png"
    1.43 +                }
    1.44 +                slot.put(_"Your are supporter")
    1.45 +                ui.image{
    1.46 +                  static = "icons/16/dropdown.png"
    1.47 +                }
    1.48 +              end
    1.49 +            }
    1.50 +          else
    1.51 +            ui.container{
    1.52 +              attr = {
    1.53 +                class = "head head_potential_supporter",
    1.54 +                style = "cursor: pointer;",
    1.55 +                onclick = "document.getElementById('support_content').style.display = 'block';"
    1.56 +              },
    1.57 +              content = function()
    1.58 +                ui.image{
    1.59 +                  static = "icons/16/thumb_up.png"
    1.60 +                }
    1.61 +                slot.put(_"Your are potential supporter")
    1.62 +                ui.image{
    1.63 +                  static = "icons/16/dropdown.png"
    1.64 +                }
    1.65 +              end
    1.66 +            }
    1.67 +          end
    1.68            ui.container{
    1.69              attr = { class = "content", id = "support_content" },
    1.70              content = function()
    1.71 @@ -37,7 +56,7 @@
    1.72                    ui.image{ static = "icons/16/cross.png" }
    1.73                  end
    1.74                }
    1.75 -              if supported then
    1.76 +              if supporter then
    1.77                  ui.link{
    1.78                    content = function()
    1.79                      ui.image{ static = "icons/16/thumb_down_red.png" }

Impressum / About Us