liquid_feedback_frontend

diff app/main/lf2/_sidebar_issue.lua @ 217:73dbc9e2bfd4

Cummulative patch for enhancements at next generation frontend
author bsw
date Sat Mar 12 19:22:50 2011 +0100 (2011-03-12)
parents 4f6e6b213fb8
children 7ea52c710503
line diff
     1.1 --- a/app/main/lf2/_sidebar_issue.lua	Mon Mar 07 12:15:22 2011 +0100
     1.2 +++ b/app/main/lf2/_sidebar_issue.lua	Sat Mar 12 19:22:50 2011 +0100
     1.3 @@ -15,7 +15,7 @@
     1.4  
     1.5  local trustees = Member:new_selector()
     1.6    :add_field("delegation_chain.*")
     1.7 -  :join("delegation_chain(" .. tostring(app.session.member.id) .. ", NULL, " .. tostring(issue.id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id")
     1.8 +  :join("delegation_chain(" .. tostring(app.session.member.id) .. ", NULL, NULL, " .. tostring(issue.id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id")
     1.9    :add_order_by("index")
    1.10    :exec()
    1.11  
    1.12 @@ -23,27 +23,91 @@
    1.13  
    1.14  ui.box{ class = "issue", content = function()
    1.15  
    1.16 -  ui.box_row{ class = "unit_name head2x", content = function() ui.box_col{ content = function()
    1.17 +  ui.box_row{ class = "issue_id head", content = function() ui.box_col{ class = "head", content = function()
    1.18 +    if interest then
    1.19 +      local text
    1.20 +      if issue.close then
    1.21 +        text = _"You were interested in this issue"
    1.22 +      else
    1.23 +        text = _"You are interested in this issue"
    1.24 +      end
    1.25 +      ui.image{ attr = { title = text, alt = text}, static = "lf2/icon_star.png" }
    1.26 +      slot.put(" ")
    1.27 +    elseif delegating_interest then
    1.28 +      local text
    1.29 +      if issue.closed then
    1.30 +        text = _"Someone in your delegation chain was interested"
    1.31 +      else
    1.32 +        text = _"Someone in your delegation chain is interested"
    1.33 +      end
    1.34 +      ui.image{ attr = { title = text, alt = text}, static = "lf2/icon_delegated_star.png" }
    1.35 +      slot.put(" ")
    1.36 +    end
    1.37 +    ui.link{
    1.38 +      module = "lf2", view = "issue", id = issue.id,
    1.39 +      content = _("Issue ##{id}", { id = issue.id })
    1.40 +    }
    1.41 +  end } end }
    1.42 +
    1.43 +  if #trustees > 1 then
    1.44 +    ui.box_row{ class = "delegation", content = function() ui.box_col{ content = function()
    1.45 +      execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small", issue_id = issue.id } }
    1.46 +    end } end }
    1.47 +  end
    1.48 +
    1.49 +  if not issue.closed then
    1.50 +    ui.box_row{ class = "interest", content = function() ui.box_col{ content = function()
    1.51 +      if interest then
    1.52 +        ui.link{
    1.53 +          module = "interest", action = "update", params = { issue_id = issue.id, delete = true },
    1.54 +          routing = { default = {
    1.55 +            mode = "redirect", module = "lf2", view = initiative_id and "initiative" or "issue", id = initiative_id or issue.id,
    1.56 +          } },
    1.57 +          content = _"Remove my interest"
    1.58 +        }
    1.59 +      else
    1.60 +        ui.link{
    1.61 +          module = "interest", action = "update", params = { issue_id = issue.id },
    1.62 +          routing = { default = {
    1.63 +            mode = "redirect", module = "lf2", view = initiative_id and "initiative" or "issue", id = initiative_id or issue.id,
    1.64 +          } },
    1.65 +          content = _"Add my interest"
    1.66 +        }
    1.67 +      end
    1.68 +    end } end }
    1.69 +  end
    1.70 +
    1.71 +  if not issue.closed then
    1.72 +    ui.box_row{ class = "interest", content = function() ui.box_col{ content = function()
    1.73 +      if #trustees > 1 and trustees[1].scope_out == "issue" then
    1.74 +        ui.link{
    1.75 +          module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id },
    1.76 +          content = _"Set issue delegation"
    1.77 +        }
    1.78 +      else
    1.79 +        ui.link{
    1.80 +          module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id },
    1.81 +          content = _"Change or remove delegation"
    1.82 +        }   
    1.83 +      end
    1.84 +
    1.85 +    end } end }
    1.86 +  end
    1.87 +
    1.88 +  ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function()
    1.89      ui.link{ 
    1.90        module = "lf2", view = "index", id = 1,
    1.91        content = "DE / Berlin / Friedrichshain-Kreuzberg" 
    1.92      }
    1.93    end } end }
    1.94  
    1.95 -  ui.box_row{ class = "area_name head2x", content = function() ui.box_col{ content = function()
    1.96 +  ui.box_row{ class = "area_name", content = function() ui.box_col{ content = function()
    1.97      ui.link{
    1.98        module = "lf2", view = "area", id = issue.area_id,
    1.99        content = issue.area.name
   1.100      }
   1.101    end } end }
   1.102    
   1.103 -  ui.box_row{ class = "issue_id subhead", content = function() ui.box_col{ class = "head", content = function()
   1.104 -    ui.link{
   1.105 -      module = "lf2", view = "issue", id = issue.id,
   1.106 -      content = _("Issue ##{id}", { id = issue.id })
   1.107 -    }
   1.108 -  end } end }
   1.109 -
   1.110    ui.box_row{ class = "policy_name", content = function() ui.box_col{ content = function()
   1.111      ui.link{
   1.112        module = "lf2", view = "policy", id = issue.policy_id,
   1.113 @@ -58,143 +122,14 @@
   1.114        ui.tag{ content = issue.closed and _("since #{date}", { date = format.date(issue.closed.date) }) or _("#{time_left} left", { time_left =  issue.state_time_left }) }
   1.115      end }
   1.116    end }
   1.117 -  
   1.118 -  ui.box_row{ class = "interest hoverbutton_container", content = function() ui.box_col{ content = function()
   1.119 -    if interest then
   1.120 -      ui.image{ static = "lf2/icon_star.png" }
   1.121 -      if issue.closed then
   1.122 -        slot.put(" ", _"You were interested in this issue")
   1.123 -      else
   1.124 -        slot.put(" ", _"You are interested in this issue")
   1.125 -      end
   1.126 -    else
   1.127 -      if not issue.closed and not issue.fully_frozen then
   1.128 -        ui.image{ static = "lf2/icon_star_grey.png" }
   1.129 -      end
   1.130 -      slot.put(" ", _"You are not interested in this issue")
   1.131 -    end
   1.132 -    
   1.133 -    if issue.closed then
   1.134 -      ui.container{ attr = { class = "hoverbutton noaction"}, content = function()
   1.135 -        ui.container{ attr = { class = "content"}, content = function()
   1.136 -          slot.put(" ", encode.html(_"This issue is closed"))
   1.137 -        end }
   1.138 -      end }
   1.139 -    elseif issue.fully_frozen then
   1.140 -      ui.container{ attr = { class = "hoverbutton noaction"}, content = function()
   1.141 -        ui.container{ attr = { class = "content"}, content = function()
   1.142 -          slot.put(" ", encode.html(_"This issue is in voting"))
   1.143 -        end }
   1.144 -      end }
   1.145 -    else
   1.146 -      if interest then
   1.147 -        ui.link{
   1.148 -          module = "interest", action = "update", params = { issue_id = issue.id, delete = true },
   1.149 -          routing = { default = {
   1.150 -            mode = "redirect", module = "lf2", view = initiative_id and "initiative" or "issue", id = initiative_id or issue.id,
   1.151 -          } },
   1.152 -          attr = { class = "hoverbutton red"},
   1.153 -          content = function()
   1.154 -            ui.container{ attr = { class = "content"}, content = function()
   1.155 -              ui.image{ static = "lf2/icon_star_crossed.png" }
   1.156 -              slot.put(" ", encode.html(_"Remove my interest"))
   1.157 -            end }
   1.158 -          end 
   1.159 -        }
   1.160 -        
   1.161 -      else
   1.162 -        ui.link{
   1.163 -          module = "interest", action = "update", params = { issue_id = issue.id },
   1.164 -          routing = { default = {
   1.165 -            mode = "redirect", module = "lf2", view = initiative_id and "initiative" or "issue", id = initiative_id or issue.id,
   1.166 -          } },
   1.167 -          attr = { class = "hoverbutton green"},
   1.168 -          content = function()
   1.169 -            ui.container{ attr = { class = "content"}, content = function()
   1.170 -              ui.image{ static = "lf2/icon_star.png" }
   1.171 -              slot.put(" ", encode.html(_"Add my interest"))
   1.172 -            end 
   1.173 -          }
   1.174 -        end }
   1.175 -        
   1.176 -      end
   1.177 -    end
   1.178 -  end } end }
   1.179 -
   1.180 -  ui.box_row{ class = "delegation hoverbutton_container", content = function() ui.box_col{ content = function()
   1.181 -    if trustees[1].scope_out then
   1.182 -      ui.image{ static = "lf2/icon_delegation.png" }
   1.183 -      slot.put(" ")
   1.184 -      if trustees[1].disabled_out == false then
   1.185 -        if trustees[1].scope_out == "issue" then
   1.186 -          slot.put(encode.html(_"Issue is delegated"))
   1.187 -        elseif trustees[1].scope_out == "area" then
   1.188 -          slot.put(encode.html(_"Area is delegated"))
   1.189 -        elseif trustees[1].scope_out == "global" then
   1.190 -          slot.put(encode.html(_"Unit wide delegated"))
   1.191 -        end
   1.192 -      else
   1.193 -        if trustees[1].scope_out == "issue" then
   1.194 -          slot.put(encode.html(_"Issue delegation abandoned"))
   1.195 -        elseif trustees[1].scope_out == "area" then
   1.196 -          slot.put(encode.html(_"Area delegation abandoned"))
   1.197 -        elseif trustees[1].scope_out == "global" then
   1.198 -          slot.put(encode.html(_"Global delegation abandoned"))
   1.199 -        end
   1.200 -      end
   1.201 -    else
   1.202 -      slot.put(encode.html(_"No delegation active"))
   1.203 -    end
   1.204 -
   1.205 -    if issue.closed then
   1.206 -      ui.container{ attr = { class = "hoverbutton noaction"}, content = function()
   1.207 -        ui.container{ attr = { class = "content"}, content = function()
   1.208 -          slot.put(" ", encode.html(_"This issue is closed"))
   1.209 -        end }
   1.210 -      end }
   1.211 -    elseif issue.fully_frozen then
   1.212 -      ui.container{ attr = { class = "hoverbutton noaction"}, content = function()
   1.213 -        ui.container{ attr = { class = "content"}, content = function()
   1.214 -          slot.put(" ", encode.html(_"This issue is in voting"))
   1.215 -        end }
   1.216 -      end }
   1.217 -    else
   1.218 -      if #trustees > 1 and trustees[1].scope_out == "issue" then
   1.219 -        ui.link{
   1.220 -          module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id },
   1.221 -          attr = { class = "hoverbutton red"}, content = function()
   1.222 -          ui.container{ attr = { class = "content"}, content = function()
   1.223 -            slot.put(" ", encode.html(_"Change issue delegation"))
   1.224 -          end }
   1.225 -        end }
   1.226 -        
   1.227 -      else
   1.228 -        ui.link{
   1.229 -          module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id },
   1.230 -          attr = { class = "hoverbutton green"}, content = function()
   1.231 -          ui.container{ attr = { class = "content"}, content = function()
   1.232 -            slot.put(" ", encode.html(_"Set issue delegation"))
   1.233 -            
   1.234 -          end }
   1.235 -        end }
   1.236 -        
   1.237 -      end
   1.238 -    end
   1.239 -    
   1.240 -  end } end }
   1.241 -
   1.242 -  if #trustees > 1 then
   1.243 -    ui.box_row{ class = "delegation", content = function() ui.box_col{ content = function()
   1.244 -      execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small", issue_id = issue.id } }
   1.245 -    end } end }
   1.246 -  end
   1.247  
   1.248    ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Initiatives" } end }
   1.249    ui.box_row{ class = "initiatives last", content = function()
   1.250 -    ui.box_col{ class = "scrolled", content = function()
   1.251 +    ui.box_col{ id = "resizable", class = "scrolled", content = function()
   1.252        execute.view{ module = "lf2", view = "_issue_initiatives", params = { initiatives = alternative_initiatives, current_initiative_id = initiative_id } }
   1.253      end }
   1.254    end }
   1.255  
   1.256 +  ui.script{ script = "$(function() { $( '#resizable' ).resizable(); });" }
   1.257  
   1.258  end }

Impressum / About Us