liquid_feedback_frontend

changeset 784:4a31786a7e0f

merge
author jbe
date Fri Jun 29 00:12:17 2012 +0200 (2012-06-29)
parents 913660489fff e370594368e8
children d2ecfc4ae757
files
line diff
     1.1 --- a/app/main/area/_head.lua	Fri Jun 29 00:11:57 2012 +0200
     1.2 +++ b/app/main/area/_head.lua	Fri Jun 29 00:12:17 2012 +0200
     1.3 @@ -26,7 +26,7 @@
     1.4      ui.container{ attr = { class = "content" }, content = function()
     1.5  
     1.6        -- actions (members with appropriate voting right only)
     1.7 -      if app.session.member_id then
     1.8 +      if member then
     1.9  
    1.10          -- membership
    1.11          local membership = Membership:by_pk(area.id, member.id)
    1.12 @@ -35,6 +35,7 @@
    1.13            
    1.14            if app.session.member_id == member.id then
    1.15              ui.tag{ content = _"You are participating in this area" }
    1.16 +            slot.put(" ")
    1.17              ui.tag{ content = function()
    1.18                slot.put("(")
    1.19                ui.link{
    1.20 @@ -57,7 +58,6 @@
    1.21            else
    1.22              ui.tag{ content = _"Member is participating in this area" }
    1.23            end
    1.24 -          slot.put(" ")
    1.25  
    1.26          elseif app.session.member_id == member.id and member:has_voting_right_for_unit_id(area.unit_id) then
    1.27            ui.link{
     2.1 --- a/app/main/delegation/_info.lua	Fri Jun 29 00:11:57 2012 +0200
     2.2 +++ b/app/main/delegation/_info.lua	Fri Jun 29 00:12:17 2012 +0200
     2.3 @@ -31,58 +31,111 @@
     2.4    delegation_text = _"Delegate issue"
     2.5  end
     2.6  
     2.7 -if info.own_participation or info.first_trustee_id then
     2.8 +local function print_delegation_info()
     2.9 +  local participant_occured = false
    2.10 +  
    2.11 +  if info.own_participation or info.first_trustee_id then
    2.12 +    
    2.13 +    local class = "micro_avatar"
    2.14 +    if info.own_participation then
    2.15 +      participant_occured = true
    2.16 +      class = class .. " highlighted"
    2.17 +    end
    2.18 +    
    2.19 +    execute.view{ module = "member_image", view = "_show", params = {
    2.20 +      member = member, class = class, popup_text = member.name,
    2.21 +      image_type = "avatar", show_dummy = true,
    2.22 +    } }
    2.23  
    2.24 -  ui.link{
    2.25 -    module = "delegation", view = "show", params = {
    2.26 -      unit_id = unit_id,
    2.27 -      area_id = area_id,
    2.28 -      issue_id = issue_id
    2.29 -    },
    2.30 -    attr = { class = "delegation_info" }, content = function()
    2.31 -      
    2.32 +  end
    2.33  
    2.34 -      local participant_occured = false
    2.35 +  if not (issue and issue.state == "voting" and info.own_participation) then
    2.36 +    
    2.37 +    if info.first_trustee_id then
    2.38 +    
    2.39 +      local text = _"delegates to"
    2.40 +      ui.image{
    2.41 +        attr = { class = "delegation_arrow", alt = text, title = text },
    2.42 +        static = "delegation_arrow_24_horizontal.png"
    2.43 +      }
    2.44 +
    2.45 +      local class = "micro_avatar"
    2.46 +      if not participant_occured and info.first_trustee_participation then
    2.47 +        participant_occured = true
    2.48 +        class = class .. " highlighted"
    2.49 +      end
    2.50        
    2.51 -      if info.own_participation or info.first_trustee_id then
    2.52 -        
    2.53 -        local class = "micro_avatar"
    2.54 -        if info.own_participation then
    2.55 -          participant_occured = true
    2.56 -          class = class .. " highlighted"
    2.57 -        end
    2.58 -        
    2.59 -        execute.view{ module = "member_image", view = "_show", params = {
    2.60 -          member = member, class = class, popup_text = member.name,
    2.61 -          image_type = "avatar", show_dummy = true,
    2.62 -        } }
    2.63 +      execute.view{ module = "member_image", view = "_show", params = {
    2.64 +        member_id = info.first_trustee_id, class = class, popup_text = info.first_trustee_name,
    2.65 +        image_type = "avatar", show_dummy = true,
    2.66 +      } }
    2.67 +
    2.68 +    end
    2.69 +          
    2.70 +    if info.first_trustee_ellipsis then
    2.71 +
    2.72 +      local text = _"delegates to"
    2.73 +      ui.image{
    2.74 +        attr = { class = "delegation_arrow", alt = text, title = text },
    2.75 +        static = "delegation_arrow_24_horizontal.png"
    2.76 +      }
    2.77  
    2.78 -      end
    2.79 +      slot.put("...")
    2.80 +      
    2.81 +    end
    2.82 +    
    2.83 +    if info.other_trustee_id then
    2.84 +    
    2.85 +      local text = _"delegates to"
    2.86 +      ui.image{
    2.87 +        attr = { class = "delegation_arrow", alt = text, title = text },
    2.88 +        static = "delegation_arrow_24_horizontal.png"
    2.89 +      }
    2.90  
    2.91 -      if not (issue and issue.state == "voting" and info.own_participation) then
    2.92 -        
    2.93 -        if info.first_trustee_id then
    2.94 -        
    2.95 -          local text = _"delegates to"
    2.96 -          ui.image{
    2.97 -            attr = { class = "delegation_arrow", alt = text, title = text },
    2.98 -            static = "delegation_arrow_24_horizontal.png"
    2.99 -          }
   2.100 +      local class = "micro_avatar"
   2.101 +      if not participant_occured and info.other_trustee_participation then
   2.102 +        participant_occured = true
   2.103 +        class = class .. " highlighted"
   2.104 +      end
   2.105 +      
   2.106 +      execute.view{ module = "member_image", view = "_show", params = {
   2.107 +        member_id = info.other_trustee_id, class = class, popup_text = info.other_trustee_name,
   2.108 +        image_type = "avatar", show_dummy = true,
   2.109 +      } }
   2.110 +
   2.111 +    end
   2.112 +          
   2.113 +    if info.other_trustee_ellipsis then
   2.114  
   2.115 -          local class = "micro_avatar"
   2.116 -          if not participant_occured and info.first_trustee_participation then
   2.117 -            participant_occured = true
   2.118 -            class = class .. " highlighted"
   2.119 -          end
   2.120 -          
   2.121 -          execute.view{ module = "member_image", view = "_show", params = {
   2.122 -            member_id = info.first_trustee_id, class = class, popup_text = info.first_trustee_name,
   2.123 -            image_type = "avatar", show_dummy = true,
   2.124 -          } }
   2.125 +      local text = _"delegates to"
   2.126 +      ui.image{
   2.127 +        attr = { class = "delegation_arrow", alt = text, title = text },
   2.128 +        static = "delegation_arrow_24_horizontal.png"
   2.129 +      }
   2.130  
   2.131 -        end
   2.132 -              
   2.133 -        if info.first_trustee_ellipsis then
   2.134 +      slot.put("...")
   2.135 +      
   2.136 +    end
   2.137 +    
   2.138 +    local trailing_ellipsis = info.other_trustee_ellipsis or
   2.139 +      (info.first_trustee_ellipsis and not info.other_trustee_id)
   2.140 +    
   2.141 +    if info.delegation_loop == "own" then
   2.142 +      
   2.143 +      local text = _"delegates to"
   2.144 +      ui.image{
   2.145 +        attr = { class = "delegation_arrow", alt = text, title = text },
   2.146 +        static = "delegation_arrow_24_horizontal.png"
   2.147 +      }
   2.148 +
   2.149 +      execute.view{ module = "member_image", view = "_show", params = {
   2.150 +        member = member, class = "micro_avatar", popup_text = member.name,
   2.151 +        image_type = "avatar", show_dummy = true,
   2.152 +      } }
   2.153 +
   2.154 +    elseif info.delegation_loop == "first" then
   2.155 +      if info.first_trustee_ellipsis then
   2.156 +        if not trailing_ellipsis then
   2.157  
   2.158            local text = _"delegates to"
   2.159            ui.image{
   2.160 @@ -91,100 +144,54 @@
   2.161            }
   2.162  
   2.163            slot.put("...")
   2.164 +        end
   2.165            
   2.166 -        end
   2.167 -        
   2.168 -        if info.other_trustee_id then
   2.169 -        
   2.170 -          local text = _"delegates to"
   2.171 -          ui.image{
   2.172 -            attr = { class = "delegation_arrow", alt = text, title = text },
   2.173 -            static = "delegation_arrow_24_horizontal.png"
   2.174 -          }
   2.175 -
   2.176 -          local class = "micro_avatar"
   2.177 -          if not participant_occured and info.other_trustee_participation then
   2.178 -            participant_occured = true
   2.179 -            class = class .. " highlighted"
   2.180 -          end
   2.181 +      else
   2.182            
   2.183 -          execute.view{ module = "member_image", view = "_show", params = {
   2.184 -            member_id = info.other_trustee_id, class = class, popup_text = info.other_trustee_name,
   2.185 -            image_type = "avatar", show_dummy = true,
   2.186 -          } }
   2.187 +        local text = _"delegates to"
   2.188 +        ui.image{
   2.189 +          attr = { class = "delegation_arrow", alt = text, title = text },
   2.190 +          static = "delegation_arrow_24_horizontal.png"
   2.191 +        }
   2.192  
   2.193 -        end
   2.194 -              
   2.195 -        if info.other_trustee_ellipsis then
   2.196 -
   2.197 -          local text = _"delegates to"
   2.198 -          ui.image{
   2.199 -            attr = { class = "delegation_arrow", alt = text, title = text },
   2.200 -            static = "delegation_arrow_24_horizontal.png"
   2.201 -          }
   2.202 -
   2.203 -          slot.put("...")
   2.204 -          
   2.205 -        end
   2.206 +        execute.view{ module = "member_image", view = "_show", params = {
   2.207 +          member_id = info.first_trustee_id, class = "micro_avatar", popup_text = info.first_trustee_name,
   2.208 +          image_type = "avatar", show_dummy = true,
   2.209 +        } }
   2.210 +      end
   2.211 +    
   2.212          
   2.213 -        local trailing_ellipsis = info.other_trustee_ellipsis or
   2.214 -          (info.first_trustee_ellipsis and not info.other_trustee_id)
   2.215 -        
   2.216 -        if info.delegation_loop == "own" then
   2.217 -          
   2.218 -          local text = _"delegates to"
   2.219 -          ui.image{
   2.220 -            attr = { class = "delegation_arrow", alt = text, title = text },
   2.221 -            static = "delegation_arrow_24_horizontal.png"
   2.222 -          }
   2.223 +    elseif info.delegation_loop and not trailing_ellipsis then
   2.224 +      local text = _"delegates to"
   2.225 +      ui.image{
   2.226 +        attr = { class = "delegation_arrow", alt = text, title = text },
   2.227 +        static = "delegation_arrow_24_horizontal.png"
   2.228 +      }
   2.229  
   2.230 -          execute.view{ module = "member_image", view = "_show", params = {
   2.231 -            member = member, class = "micro_avatar", popup_text = member.name,
   2.232 -            image_type = "avatar", show_dummy = true,
   2.233 -          } }
   2.234 +      slot.put("...")
   2.235 +    end
   2.236  
   2.237 -        elseif info.delegation_loop == "first" then
   2.238 -          if info.first_trustee_ellipsis then
   2.239 -            if not trailing_ellipsis then
   2.240 +  end
   2.241 +end
   2.242  
   2.243 -              local text = _"delegates to"
   2.244 -              ui.image{
   2.245 -                attr = { class = "delegation_arrow", alt = text, title = text },
   2.246 -                static = "delegation_arrow_24_horizontal.png"
   2.247 -              }
   2.248  
   2.249 -              slot.put("...")
   2.250 -            end
   2.251 -              
   2.252 -          else
   2.253 -              
   2.254 -            local text = _"delegates to"
   2.255 -            ui.image{
   2.256 -              attr = { class = "delegation_arrow", alt = text, title = text },
   2.257 -              static = "delegation_arrow_24_horizontal.png"
   2.258 -            }
   2.259 -
   2.260 -            execute.view{ module = "member_image", view = "_show", params = {
   2.261 -              member_id = info.first_trustee_id, class = "micro_avatar", popup_text = info.first_trustee_name,
   2.262 -              image_type = "avatar", show_dummy = true,
   2.263 -            } }
   2.264 -          end
   2.265 -        
   2.266 -            
   2.267 -        elseif info.delegation_loop and not trailing_ellipsis then
   2.268 -          local text = _"delegates to"
   2.269 -          ui.image{
   2.270 -            attr = { class = "delegation_arrow", alt = text, title = text },
   2.271 -            static = "delegation_arrow_24_horizontal.png"
   2.272 -          }
   2.273 -
   2.274 -          slot.put("...")
   2.275 -        end
   2.276 -
   2.277 +if info.own_participation or info.first_trustee_id then
   2.278 +  if app.session.member_id == member.id then
   2.279 +    ui.link{
   2.280 +      module = "delegation", view = "show", params = {
   2.281 +        unit_id = unit_id,
   2.282 +        area_id = area_id,
   2.283 +        issue_id = issue_id
   2.284 +      },
   2.285 +      attr = { class = "delegation_info" }, content = function()
   2.286 +        print_delegation_info()
   2.287        end
   2.288 -
   2.289 -    end
   2.290 -        
   2.291 -  }
   2.292 -
   2.293 +    }
   2.294 +  else
   2.295 +    ui.container{
   2.296 +      attr = { class = "delegation_info" }, content = function()
   2.297 +        print_delegation_info()
   2.298 +      end
   2.299 +    }
   2.300 +  end
   2.301  end
     3.1 --- a/static/style.css	Fri Jun 29 00:11:57 2012 +0200
     3.2 +++ b/static/style.css	Fri Jun 29 00:12:17 2012 +0200
     3.3 @@ -502,7 +502,7 @@
     3.4    color: #aaa;
     3.5  }
     3.6  
     3.7 -.delegation_info:hover {
     3.8 +a.delegation_info:hover {
     3.9    background-color: #ddd;
    3.10  }
    3.11  

Impressum / About Us