liquid_feedback_frontend

diff app/main/delegation/_show_box.lua @ 2:5c601807d397

Version alpha3

Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft

Wiki formatting for drafts

Showing differences between two drafts of the same initiative

Display of outgoing delegation chains

Many other improvements
author bsw
date Mon Nov 23 12:00:00 2009 +0100 (2009-11-23)
parents 3bfb2fcf7ab9
children 80c215dbf076
line diff
     1.1 --- a/app/main/delegation/_show_box.lua	Wed Nov 18 12:00:00 2009 +0100
     1.2 +++ b/app/main/delegation/_show_box.lua	Mon Nov 23 12:00:00 2009 +0100
     1.3 @@ -50,63 +50,70 @@
     1.4      ui.container{
     1.5        attr = { class = "content", id = "delegation_content" },
     1.6        content = function()
     1.7 +        ui.container{
     1.8 +          attr = {
     1.9 +            class = "close",
    1.10 +            style = "cursor: pointer;",
    1.11 +            onclick = "document.getElementById('delegation_content').style.display = 'none';"
    1.12 +          },
    1.13 +          content = _"X"
    1.14 +        }
    1.15  
    1.16          local delegation_chain = db:query{ "SELECT * FROM delegation_chain(?, ?, ?) JOIN member ON member.id = member_id ORDER BY index", app.session.member.id, area_id, issue_id }
    1.17  
    1.18          for i, record in ipairs(delegation_chain) do
    1.19            local style
    1.20 -          if record.participation then
    1.21 -            style = "font-weight: bold;"
    1.22 -          end
    1.23 -          if record.overridden then
    1.24 -            style = "color: #777;"
    1.25 -          end
    1.26 -          if not record.active then
    1.27 -            style = "text-decoration: line-through;"
    1.28 -          end
    1.29 -          if record.scope_in then
    1.30 -            ui.field.text{
    1.31 -              value = " v " .. record.scope_in .. " v "
    1.32 +          execute.view{
    1.33 +            module = "member",
    1.34 +            view = "_show_thumb",
    1.35 +            params = { member = record }
    1.36 +          }
    1.37 +          slot.put("<br style='clear: left'/>")
    1.38 +          if record.scope_out then
    1.39 +            ui.container{
    1.40 +              attr = { class = "delegation_info" },
    1.41 +              content = function()
    1.42 +                ui.image{
    1.43 +                  attr = { class = "delegation_arrow" },
    1.44 +                  static = "delegation_arrow_vertical.jpg"
    1.45 +                }
    1.46 +                ui.container{
    1.47 +                  attr = { class = "delegation_scope" },
    1.48 +                  content = function()
    1.49 +                    if record.scope_out == "global" then
    1.50 +                      slot.put(_"Global delegation")
    1.51 +                    elseif record.scope_out == "area" then
    1.52 +                      slot.put(_"Area delegation")
    1.53 +                    elseif record.scope_out == "issue" then
    1.54 +                      slot.put(_"Issue delegation")
    1.55 +                    end
    1.56 +                  end
    1.57 +                }
    1.58 +                if record.id == app.session.member.id then
    1.59 +                  ui.link{
    1.60 +                    attr = { class = "revoke" },
    1.61 +                    content = function()
    1.62 +                      ui.image{ static = "icons/16/delete.png" }
    1.63 +                      slot.put(_"Revoke")
    1.64 +                    end,
    1.65 +                    module = "delegation",
    1.66 +                    action = "update",
    1.67 +                    params = { issue_id = delegation.issue_id, area_id = delegation.area_id, delete = true },
    1.68 +                    routing = {
    1.69 +                      default = {
    1.70 +                        mode = "redirect",
    1.71 +                        module = request.get_module(),
    1.72 +                        view = request.get_view(),
    1.73 +                        id = param.get_id_cgi(),
    1.74 +                        params = param.get_all_cgi()
    1.75 +                      }
    1.76 +                    }
    1.77 +                  }
    1.78 +                end
    1.79 +              end
    1.80              }
    1.81            end
    1.82 -          local name = record.name
    1.83 -          if record.member_id == app.session.member.id then
    1.84 -            name = _"Me"
    1.85 -          end
    1.86 -          ui.field.text{
    1.87 -            attr = { style = style },
    1.88 -            value = name
    1.89 -          }
    1.90          end
    1.91 -
    1.92 -        ui.link{
    1.93 -          attr = { class = "revoke" },
    1.94 -          content = function()
    1.95 -            ui.image{ static = "icons/16/delete.png" }
    1.96 -            slot.put(_"Revoke")
    1.97 -          end,
    1.98 -          module = "delegation",
    1.99 -          action = "update",
   1.100 -          params = { issue_id = delegation.issue_id, area_id = delegation.area_id, delete = true },
   1.101 -          routing = {
   1.102 -            default = {
   1.103 -              mode = "redirect",
   1.104 -              module = request.get_module(),
   1.105 -              view = request.get_view(),
   1.106 -              id = param.get_id_cgi(),
   1.107 -              params = param.get_all_cgi()
   1.108 -            }
   1.109 -          }
   1.110 -        }
   1.111 -
   1.112 -        ui.container{
   1.113 -          attr = {
   1.114 -            class = "head",
   1.115 -            style = "cursor: pointer;",
   1.116 -            onclick = "document.getElementById('delegation_content').style.display = 'none';"
   1.117 -          },
   1.118 -          content = _"Click here to close."
   1.119 -        }
   1.120        end
   1.121      }
   1.122    end

Impressum / About Us