liquid_feedback_frontend

diff app/main/area/_list.lua @ 598:9df26b41ace0

Improved member home page and area list
author bsw
date Sun Jun 24 22:30:29 2012 +0200 (2012-06-24)
parents 37b12af64990
children 7dc5ab12bfe3
line diff
     1.1 --- a/app/main/area/_list.lua	Sun Jun 24 20:50:02 2012 +0200
     1.2 +++ b/app/main/area/_list.lua	Sun Jun 24 22:30:29 2012 +0200
     1.3 @@ -29,176 +29,13 @@
     1.4    areas_selector:add_field("0", "issues_to_vote_count")
     1.5  end
     1.6  
     1.7 -
     1.8 -ui.container{ attr = { class = "box area_list" }, content = function()
     1.9 -
    1.10 -  ui.container{ attr = { class = "area head" }, content = function()
    1.11 -
    1.12 -    ui.container{ attr = { class = "phases" }, content = function()
    1.13 -
    1.14 -      ui.container{ attr = { class = "admission" }, content = function()
    1.15 -        ui.image{ static = "icons/16/new.png", attr = { alt = _"New" } }
    1.16 -      end }
    1.17 -
    1.18 -      ui.container{ attr = { class = "discussion" }, content = function()
    1.19 -        ui.image{ static = "icons/16/comments.png", attr = { alt = _"Discussion" } }
    1.20 -      end }
    1.21 -
    1.22 -      ui.container{ attr = { class = "verification" }, content = function()
    1.23 -        ui.image{ static = "icons/16/lock.png", attr = { alt = _"Verification" } }
    1.24 -      end }
    1.25 -
    1.26 -      ui.container{ attr = { class = "voting" }, content = function()
    1.27 -        ui.image{ static = "icons/16/email_open.png", attr = { alt = _"Voting" } }
    1.28 -      end }
    1.29 -
    1.30 -      ui.container{ attr = { class = "finished" }, content = function()
    1.31 -        ui.image{ static = "icons/16/tick.png", attr = { alt = _"Finished" } }
    1.32 -      end }
    1.33 -
    1.34 -      ui.container{ attr = { class = "cancelled" }, content = function()
    1.35 -        ui.image{ static = "icons/16/cross.png", attr = { alt = _"Cancelled" } }
    1.36 -      end }
    1.37 -
    1.38 -    end }
    1.39 -
    1.40 -  end }
    1.41 -    
    1.42 -  for i, area in ipairs(areas_selector:exec()) do
    1.43 -
    1.44 -    ui.container{ attr = { class = "area" }, content = function()
    1.45 -
    1.46 -      ui.container{ attr = { class = "bar" }, content = function()
    1.47 -        if area.member_weight and area.direct_member_count then
    1.48 -          local max_value = MemberCount:get()
    1.49 -          ui.bargraph{
    1.50 -            max_value = max_value,
    1.51 -            width = 100,
    1.52 -            bars = {
    1.53 -              { color = "#444", value = area.direct_member_count },
    1.54 -              { color = "#777", value = area.member_weight - area.direct_member_count },
    1.55 -              { color = "#ddd", value = max_value - area.member_weight },
    1.56 -            }
    1.57 -          }
    1.58 -        end
    1.59 -      end }
    1.60 -
    1.61 -      ui.container{ attr = { class = "name" }, content = function()
    1.62 -        ui.link{
    1.63 -          text = area.name,
    1.64 -          module = "area",
    1.65 -          view = "show",
    1.66 -          id = area.id
    1.67 -        }
    1.68 -        slot.put(" ")
    1.69 -        ui.tag{ content = "" }
    1.70 -      end }
    1.71 +slot.put("<br />")
    1.72  
    1.73 -      if not hide_membership then
    1.74 -        ui.container{ attr = { class = "membership" }, content = function()
    1.75 -          if area.is_member then
    1.76 -            local text = _"Member of area"
    1.77 -            ui.image{
    1.78 -              attr = { title = text, alt = text },
    1.79 -              static = "icons/16/user_gray.png",
    1.80 -            }
    1.81 -          else
    1.82 -            slot.put('<img src="null.png" width="16" height="1" alt="" />')
    1.83 -          end
    1.84 -        end }
    1.85 -      end
    1.86 -      
    1.87 -      ui.container{ attr = { class = "delegatee" }, content = function()
    1.88 -        if area.trustee_member_id then
    1.89 -          local trustee_member = Member:by_id(area.trustee_member_id)
    1.90 -          local text = _("Area delegated to '#{name}'", { name = area.trustee_member_name })
    1.91 -          ui.image{
    1.92 -            attr = { class = "delegation_arrow", alt = text, title = text },
    1.93 -            static = "delegation_arrow_24_horizontal.png"
    1.94 -          }
    1.95 -          execute.view{
    1.96 -            module = "member_image",
    1.97 -            view = "_show",
    1.98 -            params = {
    1.99 -              member = trustee_member,
   1.100 -              image_type = "avatar",
   1.101 -              show_dummy = true,
   1.102 -              class = "micro_avatar",
   1.103 -              popup_text = text
   1.104 -            }
   1.105 -          }
   1.106 -        else
   1.107 -          slot.put('<img src="null.png" width="41" height="1" alt="" />')
   1.108 -        end
   1.109 -      end }
   1.110 +for i, area in ipairs(areas_selector:exec()) do
   1.111    
   1.112 -      ui.container{ attr = { class = "phases" }, content = function()
   1.113 -
   1.114 -        ui.container{ attr = { class = "admission" }, content = function()
   1.115 -          ui.link{
   1.116 -            text = tostring(area.issues_new_count),
   1.117 -            module = "area",
   1.118 -            view = "show",
   1.119 -            id = area.id,
   1.120 -            params = { filter = "new", tab = "open" }
   1.121 -          }
   1.122 -        end }
   1.123 +  ui.container{ attr = { class = "area_list" }, content = function()
   1.124 +    execute.view { module = "area", view = "_list_entry", params = { area = area } }
   1.125 +  end }
   1.126 +  
   1.127 +end
   1.128  
   1.129 -        ui.container{ attr = { class = "discussion" }, content = function()
   1.130 -          ui.link{
   1.131 -            text = tostring(area.issues_discussion_count),
   1.132 -            module = "area",
   1.133 -            view = "show",
   1.134 -            id = area.id,
   1.135 -            params = { filter = "accepted", tab = "open" }
   1.136 -          }
   1.137 -        end }
   1.138 -
   1.139 -        ui.container{ attr = { class = "verification" }, content = function()
   1.140 -          ui.link{
   1.141 -            text = tostring(area.issues_frozen_count),
   1.142 -            module = "area",
   1.143 -            view = "show",
   1.144 -            id = area.id,
   1.145 -            params = { filter = "half_frozen", tab = "open" }
   1.146 -          }
   1.147 -        end }
   1.148 -
   1.149 -        ui.container{ attr = { class = "voting" }, content = function()
   1.150 -          ui.link{
   1.151 -            text = tostring(area.issues_voting_count),
   1.152 -            module = "area",
   1.153 -            view = "show",
   1.154 -            id = area.id,
   1.155 -            params = { filter = "frozen", tab = "open" }
   1.156 -          }
   1.157 -        end }
   1.158 -
   1.159 -        ui.container{ attr = { class = "finished" }, content = function()
   1.160 -          ui.link{
   1.161 -            text = tostring(area.issues_finished_count),
   1.162 -            module = "area",
   1.163 -            view = "show",
   1.164 -            id = area.id,
   1.165 -            params = { filter = "finished", tab = "closed" }
   1.166 -          }
   1.167 -        end }
   1.168 -
   1.169 -        ui.container{ attr = { class = "cancelled" }, content = function()
   1.170 -          ui.link{
   1.171 -            text = tostring(area.issues_cancelled_count),
   1.172 -            module = "area",
   1.173 -            view = "show",
   1.174 -            id = area.id,
   1.175 -            params = { filter = "cancelled", issue_list = "newest", tab = "closed" }
   1.176 -          }
   1.177 -        end }
   1.178 -
   1.179 -      end }
   1.180 -      
   1.181 -      slot.put("<br style='clear: right;' />")
   1.182 -    end }
   1.183 -    
   1.184 -  end
   1.185 -  
   1.186 -end }

Impressum / About Us