liquid_feedback_frontend

diff app/main/supporter/_show_box.lua @ 4:80c215dbf076

Version alpha5

Many optical changes and improved usability

Support for different wiki-formatting-engines

Help system
author bsw/jbe
date Thu Dec 10 12:00:00 2009 +0100 (2009-12-10)
parents 5c601807d397
children afd9f769c7ae
line diff
     1.1 --- a/app/main/supporter/_show_box.lua	Mon Nov 30 12:00:00 2009 +0100
     1.2 +++ b/app/main/supporter/_show_box.lua	Thu Dec 10 12:00:00 2009 +0100
     1.3 @@ -1,49 +1,64 @@
     1.4 -    
     1.5  
     1.6  slot.select("support", function()
     1.7 -
     1.8    local initiative = param.get("initiative", "table")
     1.9 -
    1.10 -  if not initiative.issue.frozen and not initiative.issue.closed then
    1.11 -
    1.12 -    local supported = Supporter:by_pk(initiative.id, app.session.member.id) and true or false
    1.13 -
    1.14 -    local text
    1.15 -    if supported then
    1.16 -      text = _"Direct supporter [change]"
    1.17 -    else
    1.18 -      text = _"No supporter [change]"
    1.19 -    end
    1.20 -    ui.container{
    1.21 -      attr = {
    1.22 -        class = "head",
    1.23 -        style = "cursor: pointer;",
    1.24 -        onclick = "document.getElementById('support_content').style.display = 'block';"
    1.25 -      },
    1.26 -      content = text
    1.27 -    }
    1.28 +  local supported = Supporter:by_pk(initiative.id, app.session.member.id) and true or false
    1.29  
    1.30 -
    1.31 -    ui.container{
    1.32 -      attr = { class = "content", id = "support_content" },
    1.33 -      content = function()
    1.34 -        ui.container{
    1.35 -          attr = {
    1.36 -            class = "close",
    1.37 -            style = "cursor: pointer;",
    1.38 -            onclick = "document.getElementById('support_content').style.display = 'none';"
    1.39 -          },
    1.40 -          content = _"X"
    1.41 -        }
    1.42 +  ui.container{
    1.43 +    attr = { class = "actions" },
    1.44 +    content = function()
    1.45 +      if not initiative.issue.frozen and not initiative.issue.closed then
    1.46          if supported then
    1.47 -          ui.link{
    1.48 +          ui.container{
    1.49 +            attr = {
    1.50 +              class = "head head_active",
    1.51 +              style = "cursor: pointer;",
    1.52 +              onclick = "document.getElementById('support_content').style.display = 'block';"
    1.53 +            },
    1.54 +            content = function()
    1.55 +              ui.image{
    1.56 +                static = "icons/16/thumb_up_green.png"
    1.57 +              }
    1.58 +              slot.put(_"Your are supporter")
    1.59 +              ui.image{
    1.60 +                static = "icons/16/dropdown.png"
    1.61 +              }
    1.62 +            end
    1.63 +          }
    1.64 +          ui.container{
    1.65 +            attr = { class = "content", id = "support_content" },
    1.66              content = function()
    1.67 -              ui.image{ static = "icons/16/thumb_down_red.png" }
    1.68 -              slot.put(_"Remove my support from this initiative")
    1.69 -            end,
    1.70 -            module = "initiative",
    1.71 -            action = "remove_support",
    1.72 -            id = initiative.id
    1.73 +              ui.container{
    1.74 +                attr = {
    1.75 +                  class = "close",
    1.76 +                  style = "cursor: pointer;",
    1.77 +                  onclick = "document.getElementById('support_content').style.display = 'none';"
    1.78 +                },
    1.79 +                content = function()
    1.80 +                  ui.image{ static = "icons/16/cross.png" }
    1.81 +                end
    1.82 +              }
    1.83 +              if supported then
    1.84 +                ui.link{
    1.85 +                  content = function()
    1.86 +                    ui.image{ static = "icons/16/thumb_down_red.png" }
    1.87 +                    slot.put(_"Remove my support from this initiative")
    1.88 +                  end,
    1.89 +                  module = "initiative",
    1.90 +                  action = "remove_support",
    1.91 +                  id = initiative.id,
    1.92 +                  routing = {
    1.93 +                    default = {
    1.94 +                      mode = "redirect",
    1.95 +                      module = request.get_module(),
    1.96 +                      view = request.get_view(),
    1.97 +                      id = param.get_id_cgi(),
    1.98 +                      params = param.get_all_cgi()
    1.99 +                    }
   1.100 +                  }
   1.101 +                }
   1.102 +              else
   1.103 +              end
   1.104 +            end
   1.105            }
   1.106          else
   1.107            ui.link{
   1.108 @@ -53,11 +68,19 @@
   1.109              end,
   1.110              module = "initiative",
   1.111              action = "add_support",
   1.112 -            id = initiative.id
   1.113 +            id = initiative.id,
   1.114 +            routing = {
   1.115 +              default = {
   1.116 +                mode = "redirect",
   1.117 +                module = request.get_module(),
   1.118 +                view = request.get_view(),
   1.119 +                id = param.get_id_cgi(),
   1.120 +                params = param.get_all_cgi()
   1.121 +              }
   1.122 +            }
   1.123            }
   1.124          end
   1.125        end
   1.126 -    }
   1.127 -  end
   1.128 -
   1.129 +    end
   1.130 +  }
   1.131  end)

Impressum / About Us