liquid_feedback_frontend

changeset 780:9d4398195faf

Removed link from delegation infos for other members
author bsw
date Fri Jun 29 00:06:43 2012 +0200 (2012-06-29)
parents 2bbddf7f1e1a
children e07c9ce87470
files app/main/delegation/_info.lua static/style.css
line diff
     1.1 --- a/app/main/delegation/_info.lua	Fri Jun 29 00:03:03 2012 +0200
     1.2 +++ b/app/main/delegation/_info.lua	Fri Jun 29 00:06:43 2012 +0200
     1.3 @@ -31,58 +31,111 @@
     1.4    delegation_text = _"Delegate issue"
     1.5  end
     1.6  
     1.7 -if info.own_participation or info.first_trustee_id then
     1.8 +local function print_delegation_info()
     1.9 +  local participant_occured = false
    1.10 +  
    1.11 +  if info.own_participation or info.first_trustee_id then
    1.12 +    
    1.13 +    local class = "micro_avatar"
    1.14 +    if info.own_participation then
    1.15 +      participant_occured = true
    1.16 +      class = class .. " highlighted"
    1.17 +    end
    1.18 +    
    1.19 +    execute.view{ module = "member_image", view = "_show", params = {
    1.20 +      member = member, class = class, popup_text = member.name,
    1.21 +      image_type = "avatar", show_dummy = true,
    1.22 +    } }
    1.23  
    1.24 -  ui.link{
    1.25 -    module = "delegation", view = "show", params = {
    1.26 -      unit_id = unit_id,
    1.27 -      area_id = area_id,
    1.28 -      issue_id = issue_id
    1.29 -    },
    1.30 -    attr = { class = "delegation_info" }, content = function()
    1.31 -      
    1.32 +  end
    1.33  
    1.34 -      local participant_occured = false
    1.35 +  if not (issue and issue.state == "voting" and info.own_participation) then
    1.36 +    
    1.37 +    if info.first_trustee_id then
    1.38 +    
    1.39 +      local text = _"delegates to"
    1.40 +      ui.image{
    1.41 +        attr = { class = "delegation_arrow", alt = text, title = text },
    1.42 +        static = "delegation_arrow_24_horizontal.png"
    1.43 +      }
    1.44 +
    1.45 +      local class = "micro_avatar"
    1.46 +      if not participant_occured and info.first_trustee_participation then
    1.47 +        participant_occured = true
    1.48 +        class = class .. " highlighted"
    1.49 +      end
    1.50        
    1.51 -      if info.own_participation or info.first_trustee_id then
    1.52 -        
    1.53 -        local class = "micro_avatar"
    1.54 -        if info.own_participation then
    1.55 -          participant_occured = true
    1.56 -          class = class .. " highlighted"
    1.57 -        end
    1.58 -        
    1.59 -        execute.view{ module = "member_image", view = "_show", params = {
    1.60 -          member = member, class = class, popup_text = member.name,
    1.61 -          image_type = "avatar", show_dummy = true,
    1.62 -        } }
    1.63 +      execute.view{ module = "member_image", view = "_show", params = {
    1.64 +        member_id = info.first_trustee_id, class = class, popup_text = info.first_trustee_name,
    1.65 +        image_type = "avatar", show_dummy = true,
    1.66 +      } }
    1.67 +
    1.68 +    end
    1.69 +          
    1.70 +    if info.first_trustee_ellipsis then
    1.71 +
    1.72 +      local text = _"delegates to"
    1.73 +      ui.image{
    1.74 +        attr = { class = "delegation_arrow", alt = text, title = text },
    1.75 +        static = "delegation_arrow_24_horizontal.png"
    1.76 +      }
    1.77  
    1.78 -      end
    1.79 +      slot.put("...")
    1.80 +      
    1.81 +    end
    1.82 +    
    1.83 +    if info.other_trustee_id then
    1.84 +    
    1.85 +      local text = _"delegates to"
    1.86 +      ui.image{
    1.87 +        attr = { class = "delegation_arrow", alt = text, title = text },
    1.88 +        static = "delegation_arrow_24_horizontal.png"
    1.89 +      }
    1.90  
    1.91 -      if not (issue and issue.state == "voting" and info.own_participation) then
    1.92 -        
    1.93 -        if info.first_trustee_id then
    1.94 -        
    1.95 -          local text = _"delegates to"
    1.96 -          ui.image{
    1.97 -            attr = { class = "delegation_arrow", alt = text, title = text },
    1.98 -            static = "delegation_arrow_24_horizontal.png"
    1.99 -          }
   1.100 +      local class = "micro_avatar"
   1.101 +      if not participant_occured and info.other_trustee_participation then
   1.102 +        participant_occured = true
   1.103 +        class = class .. " highlighted"
   1.104 +      end
   1.105 +      
   1.106 +      execute.view{ module = "member_image", view = "_show", params = {
   1.107 +        member_id = info.other_trustee_id, class = class, popup_text = info.other_trustee_name,
   1.108 +        image_type = "avatar", show_dummy = true,
   1.109 +      } }
   1.110 +
   1.111 +    end
   1.112 +          
   1.113 +    if info.other_trustee_ellipsis then
   1.114  
   1.115 -          local class = "micro_avatar"
   1.116 -          if not participant_occured and info.first_trustee_participation then
   1.117 -            participant_occured = true
   1.118 -            class = class .. " highlighted"
   1.119 -          end
   1.120 -          
   1.121 -          execute.view{ module = "member_image", view = "_show", params = {
   1.122 -            member_id = info.first_trustee_id, class = class, popup_text = info.first_trustee_name,
   1.123 -            image_type = "avatar", show_dummy = true,
   1.124 -          } }
   1.125 +      local text = _"delegates to"
   1.126 +      ui.image{
   1.127 +        attr = { class = "delegation_arrow", alt = text, title = text },
   1.128 +        static = "delegation_arrow_24_horizontal.png"
   1.129 +      }
   1.130  
   1.131 -        end
   1.132 -              
   1.133 -        if info.first_trustee_ellipsis then
   1.134 +      slot.put("...")
   1.135 +      
   1.136 +    end
   1.137 +    
   1.138 +    local trailing_ellipsis = info.other_trustee_ellipsis or
   1.139 +      (info.first_trustee_ellipsis and not info.other_trustee_id)
   1.140 +    
   1.141 +    if info.delegation_loop == "own" then
   1.142 +      
   1.143 +      local text = _"delegates to"
   1.144 +      ui.image{
   1.145 +        attr = { class = "delegation_arrow", alt = text, title = text },
   1.146 +        static = "delegation_arrow_24_horizontal.png"
   1.147 +      }
   1.148 +
   1.149 +      execute.view{ module = "member_image", view = "_show", params = {
   1.150 +        member = member, class = "micro_avatar", popup_text = member.name,
   1.151 +        image_type = "avatar", show_dummy = true,
   1.152 +      } }
   1.153 +
   1.154 +    elseif info.delegation_loop == "first" then
   1.155 +      if info.first_trustee_ellipsis then
   1.156 +        if not trailing_ellipsis then
   1.157  
   1.158            local text = _"delegates to"
   1.159            ui.image{
   1.160 @@ -91,100 +144,54 @@
   1.161            }
   1.162  
   1.163            slot.put("...")
   1.164 +        end
   1.165            
   1.166 -        end
   1.167 -        
   1.168 -        if info.other_trustee_id then
   1.169 -        
   1.170 -          local text = _"delegates to"
   1.171 -          ui.image{
   1.172 -            attr = { class = "delegation_arrow", alt = text, title = text },
   1.173 -            static = "delegation_arrow_24_horizontal.png"
   1.174 -          }
   1.175 -
   1.176 -          local class = "micro_avatar"
   1.177 -          if not participant_occured and info.other_trustee_participation then
   1.178 -            participant_occured = true
   1.179 -            class = class .. " highlighted"
   1.180 -          end
   1.181 +      else
   1.182            
   1.183 -          execute.view{ module = "member_image", view = "_show", params = {
   1.184 -            member_id = info.other_trustee_id, class = class, popup_text = info.other_trustee_name,
   1.185 -            image_type = "avatar", show_dummy = true,
   1.186 -          } }
   1.187 +        local text = _"delegates to"
   1.188 +        ui.image{
   1.189 +          attr = { class = "delegation_arrow", alt = text, title = text },
   1.190 +          static = "delegation_arrow_24_horizontal.png"
   1.191 +        }
   1.192  
   1.193 -        end
   1.194 -              
   1.195 -        if info.other_trustee_ellipsis then
   1.196 -
   1.197 -          local text = _"delegates to"
   1.198 -          ui.image{
   1.199 -            attr = { class = "delegation_arrow", alt = text, title = text },
   1.200 -            static = "delegation_arrow_24_horizontal.png"
   1.201 -          }
   1.202 -
   1.203 -          slot.put("...")
   1.204 -          
   1.205 -        end
   1.206 +        execute.view{ module = "member_image", view = "_show", params = {
   1.207 +          member_id = info.first_trustee_id, class = "micro_avatar", popup_text = info.first_trustee_name,
   1.208 +          image_type = "avatar", show_dummy = true,
   1.209 +        } }
   1.210 +      end
   1.211 +    
   1.212          
   1.213 -        local trailing_ellipsis = info.other_trustee_ellipsis or
   1.214 -          (info.first_trustee_ellipsis and not info.other_trustee_id)
   1.215 -        
   1.216 -        if info.delegation_loop == "own" then
   1.217 -          
   1.218 -          local text = _"delegates to"
   1.219 -          ui.image{
   1.220 -            attr = { class = "delegation_arrow", alt = text, title = text },
   1.221 -            static = "delegation_arrow_24_horizontal.png"
   1.222 -          }
   1.223 +    elseif info.delegation_loop and not trailing_ellipsis then
   1.224 +      local text = _"delegates to"
   1.225 +      ui.image{
   1.226 +        attr = { class = "delegation_arrow", alt = text, title = text },
   1.227 +        static = "delegation_arrow_24_horizontal.png"
   1.228 +      }
   1.229  
   1.230 -          execute.view{ module = "member_image", view = "_show", params = {
   1.231 -            member = member, class = "micro_avatar", popup_text = member.name,
   1.232 -            image_type = "avatar", show_dummy = true,
   1.233 -          } }
   1.234 +      slot.put("...")
   1.235 +    end
   1.236  
   1.237 -        elseif info.delegation_loop == "first" then
   1.238 -          if info.first_trustee_ellipsis then
   1.239 -            if not trailing_ellipsis then
   1.240 +  end
   1.241 +end
   1.242  
   1.243 -              local text = _"delegates to"
   1.244 -              ui.image{
   1.245 -                attr = { class = "delegation_arrow", alt = text, title = text },
   1.246 -                static = "delegation_arrow_24_horizontal.png"
   1.247 -              }
   1.248  
   1.249 -              slot.put("...")
   1.250 -            end
   1.251 -              
   1.252 -          else
   1.253 -              
   1.254 -            local text = _"delegates to"
   1.255 -            ui.image{
   1.256 -              attr = { class = "delegation_arrow", alt = text, title = text },
   1.257 -              static = "delegation_arrow_24_horizontal.png"
   1.258 -            }
   1.259 -
   1.260 -            execute.view{ module = "member_image", view = "_show", params = {
   1.261 -              member_id = info.first_trustee_id, class = "micro_avatar", popup_text = info.first_trustee_name,
   1.262 -              image_type = "avatar", show_dummy = true,
   1.263 -            } }
   1.264 -          end
   1.265 -        
   1.266 -            
   1.267 -        elseif info.delegation_loop and not trailing_ellipsis then
   1.268 -          local text = _"delegates to"
   1.269 -          ui.image{
   1.270 -            attr = { class = "delegation_arrow", alt = text, title = text },
   1.271 -            static = "delegation_arrow_24_horizontal.png"
   1.272 -          }
   1.273 -
   1.274 -          slot.put("...")
   1.275 -        end
   1.276 -
   1.277 +if info.own_participation or info.first_trustee_id then
   1.278 +  if app.session.member_id == member.id then
   1.279 +    ui.link{
   1.280 +      module = "delegation", view = "show", params = {
   1.281 +        unit_id = unit_id,
   1.282 +        area_id = area_id,
   1.283 +        issue_id = issue_id
   1.284 +      },
   1.285 +      attr = { class = "delegation_info" }, content = function()
   1.286 +        print_delegation_info()
   1.287        end
   1.288 -
   1.289 -    end
   1.290 -        
   1.291 -  }
   1.292 -
   1.293 +    }
   1.294 +  else
   1.295 +    ui.container{
   1.296 +      attr = { class = "delegation_info" }, content = function()
   1.297 +        print_delegation_info()
   1.298 +      end
   1.299 +    }
   1.300 +  end
   1.301  end
     2.1 --- a/static/style.css	Fri Jun 29 00:03:03 2012 +0200
     2.2 +++ b/static/style.css	Fri Jun 29 00:06:43 2012 +0200
     2.3 @@ -502,7 +502,7 @@
     2.4    color: #aaa;
     2.5  }
     2.6  
     2.7 -.delegation_info:hover {
     2.8 +a.delegation_info:hover {
     2.9    background-color: #ddd;
    2.10  }
    2.11  

Impressum / About Us