liquid_feedback_frontend

changeset 215:1dab81353eb1

More enhancements for second generation frontend
author bsw
date Sat Mar 05 15:34:17 2011 +0100 (2011-03-05)
parents 7e3acb2f6284
children 4f6e6b213fb8
files app/main/lf2/_area.lua app/main/lf2/_areas.lua app/main/lf2/_filter_view/10_topnav.lua app/main/lf2/_initiative.lua app/main/lf2/_initiative_support.lua app/main/lf2/_interested.lua app/main/lf2/_issue_initiatives.lua app/main/lf2/_issues.lua app/main/lf2/_search.lua app/main/lf2/_sidebar.lua app/main/lf2/_sidebar_drafts.lua app/main/lf2/_sidebar_initiatives.lua app/main/lf2/_sidebar_issue.lua app/main/lf2/_sidebar_unit.lua app/main/lf2/area.lua app/main/lf2/delegation.lua app/main/lf2/index.lua app/main/lf2/initiative.lua app/main/lf2/interest.lua app/main/lf2/issue.lua env/ui/box.lua env/ui/box_col.lua env/ui/box_row.lua model/issue.lua static/lf2.css static/lf2/back.jpg static/lf2/icon_delegation.png static/lf2/icon_delegation_issue.png
line diff
     1.1 --- a/app/main/lf2/_area.lua	Thu Mar 03 23:47:35 2011 +0100
     1.2 +++ b/app/main/lf2/_area.lua	Sat Mar 05 15:34:17 2011 +0100
     1.3 @@ -28,9 +28,9 @@
     1.4          execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } }
     1.5        end }
     1.6        if trustees[1].scope_out == "area" then
     1.7 -        text = _"Change or revoke area delegation..."
     1.8 +        text = _"Change or revoke area delegation"
     1.9        else
    1.10 -        text = _"Set area delegation..."
    1.11 +        text = _"Set area delegation"
    1.12        end  
    1.13        ui.box_col{ class = "right", content = function()
    1.14          ui.link{
    1.15 @@ -71,7 +71,7 @@
    1.16            slot.put(" · ")
    1.17          end
    1.18          ui.link{
    1.19 -          text = _"Set area delegation...",
    1.20 +          text = _"Set area delegation",
    1.21            module = "lf2", view = "delegation", params = { area_id = area.id }
    1.22          }    
    1.23        end
     2.1 --- a/app/main/lf2/_areas.lua	Thu Mar 03 23:47:35 2011 +0100
     2.2 +++ b/app/main/lf2/_areas.lua	Sat Mar 05 15:34:17 2011 +0100
     2.3 @@ -1,6 +1,7 @@
     2.4  local areas = param.get("areas_selector", "table"):exec()
     2.5  local current_area_id = param.get("current_area_id", atom.integer)
     2.6  local head_content = param.get("head_content", "function")
     2.7 +local current_phase = param.get("current_phase")
     2.8  
     2.9  if #areas == 0 then
    2.10    return
    2.11 @@ -8,34 +9,32 @@
    2.12  
    2.13  areas:load("membership_for_member", { member_id = app.session.member_id}, "membership")
    2.14  
    2.15 -ui.box{ class = "areas", row_count = #areas + 1, content = function()
    2.16 -  if head_content then
    2.17 -    ui.box_row{ class = "head", content = function() ui.box_col{ class = "head", content = function()
    2.18 -      ui.link{ content = head_content, module = "lf2", view = "index" }
    2.19 -    end } end }
    2.20 +for i, area in ipairs(areas) do
    2.21 +  local delegation = Delegation:by_pk(app.session.member_id, area.id)
    2.22 +  
    2.23 +  local class = "area"
    2.24 +  if (current_area_id and area.id == current_area_id) 
    2.25 +    or (not current_area_id and area.membership)
    2.26 +  then
    2.27 +    class = class .. " active"
    2.28    end
    2.29 -
    2.30 -  for i, area in ipairs(areas) do
    2.31 -    local delegation = Delegation:by_pk(app.session.member_id, area.id)
    2.32 -    
    2.33 -    local class = "area"
    2.34 -    if (current_area_id and area.id == current_area_id) 
    2.35 -      or (not current_area_id and area.membership)
    2.36 -    then
    2.37 -      class = class .. " active"
    2.38 +  ui.box_row{ 
    2.39 +    class = class, 
    2.40 +    content = function()
    2.41 +      ui.box_col{ class = "name", content = function()
    2.42 +        if delegation then
    2.43 +          execute.view{ module = "lf2", view = "_avatars", params = { 
    2.44 +            members = { delegation.trustee }, size = "small" 
    2.45 +          } }
    2.46 +        end
    2.47 +        ui.link{
    2.48 +          module = "lf2", view = "area", id = area.id, params = {
    2.49 +            phase = current_phase, order = current_order 
    2.50 +          },
    2.51 +          text = area.name 
    2.52 +        }
    2.53 +      end }
    2.54      end
    2.55 -    ui.box_row{ 
    2.56 -      class = class, 
    2.57 -      content = function()
    2.58 -        ui.box_col{ class = "name", content = function()
    2.59 -          if delegation then
    2.60 -            execute.view{ module = "lf2", view = "_avatars", params = { members = { delegation.trustee }, size = "small" } }
    2.61 -          end
    2.62 -          ui.link{ module = "lf2", view = "area", id = area.id, text = area.name }
    2.63 -        end }
    2.64 -      end
    2.65 -    }
    2.66 -    
    2.67 -  end
    2.68 -
    2.69 -end }
    2.70 +  }
    2.71 +  
    2.72 +end
     3.1 --- a/app/main/lf2/_filter_view/10_topnav.lua	Thu Mar 03 23:47:35 2011 +0100
     3.2 +++ b/app/main/lf2/_filter_view/10_topnav.lua	Sat Mar 05 15:34:17 2011 +0100
     3.3 @@ -1,44 +1,67 @@
     3.4 -local state = param.get("state")
     3.5 +execute.inner()
     3.6 +
     3.7 +local phase
     3.8 +if app.topnav_phase then
     3.9 +  phase = app.topnav_phase
    3.10 +else
    3.11 +  phase = param.get("phase")
    3.12 +end
    3.13 +
    3.14 +local area_id
    3.15 +if app.topnav_area_id then
    3.16 +  area_id = app.topnav_area_id
    3.17 +else
    3.18 +  area_id = param.get_all_cgi()["area_id"]
    3.19 +end
    3.20 +
    3.21  local order = param.get("order")
    3.22  
    3.23 +local view
    3.24 +local id
    3.25 +if area_id then
    3.26 +  view = "area"
    3.27 +  id = area_id
    3.28 +else
    3.29 +  view = "index"
    3.30 +end
    3.31 +
    3.32  slot.select("topnav", function()
    3.33  
    3.34    ui.link{
    3.35 -    attr = { class = state == "closed" and "active" or nil },
    3.36 -    text = _"Closed", module = "lf2", view = "index", params = { state = "closed", order = order } 
    3.37 +    attr = { class = phase == "closed" and "active" or nil },
    3.38 +    text = _"Closed", module = "lf2", view = view, id = id, params = { phase = "closed", order = order } 
    3.39    }
    3.40    ui.link{ 
    3.41 -    attr = { class = state == "voting" and "active" or nil },
    3.42 -    text = _"Voting", module = "lf2", view = "index", params = { state = "voting", order = order } 
    3.43 +    attr = { class = phase == "voting" and "active" or nil },
    3.44 +    text = _"Voting", module = "lf2", view = view, id = id, params = { phase = "voting", order = order } 
    3.45    }
    3.46    ui.link{ 
    3.47 -    attr = { class = state == "frozen" and "active" or nil },
    3.48 -    text = _"Frozen", module = "lf2", view = "index", params = { state = "frozen", order = order } 
    3.49 +    attr = { class = phase == "frozen" and "active" or nil },
    3.50 +    text = _"Frozen", module = "lf2", view = view, id = id, params = { phase = "frozen", order = order } 
    3.51    }
    3.52    ui.link{
    3.53 -    attr = { class = state == "discussion" and "active" or nil },
    3.54 -    text = _"Discussion", module = "lf2", view = "index", params = { state = "discussion", order = order }
    3.55 +    attr = { class = phase == "discussion" and "active" or nil },
    3.56 +    text = _"Discussion", module = "lf2", view = view, id = id, params = { phase = "discussion", order = order }
    3.57    }
    3.58    ui.link{
    3.59 -    attr = { class = state == "new" and "active" or nil },
    3.60 -    text = _"New", module = "lf2", view = "index", params = { state = "new", order = order } 
    3.61 +    attr = { class = phase == "new" and "active" or nil },
    3.62 +    text = _"New", module = "lf2", view = view, id = id, params = { phase = "new", order = order } 
    3.63    }
    3.64  
    3.65    ui.container{ attr = { class = "right" }, content = function()
    3.66      ui.link{
    3.67        attr = { class = order == "last_change" and "active" or nil },
    3.68 -      text = _"Last change", module = "lf2", view = "index", params = { order = "last_change", state = state }
    3.69 +      text = _"Last change", module = "lf2", view = view, id = id, params = { order = "last_change", state = state }
    3.70      }
    3.71      ui.link{ 
    3.72        attr = { class = order == "time_left" and "active" or nil },
    3.73 -      text = _"Time left", module = "lf2", view = "index", params = { order = "time_left", state = state }
    3.74 +      text = _"Time left", module = "lf2", view = view, id = id, params = { order = "time_left", state = state }
    3.75      }
    3.76      ui.link{
    3.77        attr = { class = order == "interest" and "active" or nil },
    3.78 -      text = _"Interest", module = "lf2", view = "index", params = { order = "interest", state = state }
    3.79 +      text = _"Interest", module = "lf2", view = view, id = id, params = { order = "interest", state = state }
    3.80      }
    3.81    end }
    3.82  
    3.83  end)
    3.84  
    3.85 -execute.inner()
    3.86 \ No newline at end of file
     4.1 --- a/app/main/lf2/_initiative.lua	Thu Mar 03 23:47:35 2011 +0100
     4.2 +++ b/app/main/lf2/_initiative.lua	Sat Mar 05 15:34:17 2011 +0100
     4.3 @@ -45,32 +45,9 @@
     4.4    end
     4.5  end
     4.6  
     4.7 -if initiative.issue.closed then
     4.8 -  if initiative.issue.accepted then
     4.9 -    if initiative.admitted then
    4.10 -      if initiative.agreed then
    4.11 -        if initiative.rank == 1 then
    4.12 -          ui.image{ static = "lf2/icon_award_gold.png" }
    4.13 -        else
    4.14 -          ui.image{ static = "lf2/icon_award_silver.png" }
    4.15 -        end
    4.16 -        slot.put(" ")
    4.17 -        ui.tag{ content = initiative.rank }
    4.18 -      else
    4.19 -      ui.image{ attr = { title = _"Initiative not agreed" }, static = "lf2/icon_cross.png" }
    4.20 -      end
    4.21 -    else
    4.22 -      ui.image{ attr = { title = _"Initiative not admitted" }, static = "lf2/icon_cross.png" }
    4.23 -    end
    4.24 -  else
    4.25 -   ui.image{ attr = { title = _"Issue not accepted" }, static = "lf2/icon_cross.png" }
    4.26 -  end
    4.27 -  slot.put(" ")
    4.28 -end
    4.29 -
    4.30  ui.link{ 
    4.31    module = "lf2", view = "initiative", id = initiative.id,
    4.32 -  params = { tab = "draft" }, attr = { class = "name" }, 
    4.33 +  attr = { class = "name" }, 
    4.34    text = initiative.name
    4.35  }
    4.36  
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/app/main/lf2/_initiative_support.lua	Sat Mar 05 15:34:17 2011 +0100
     5.3 @@ -0,0 +1,51 @@
     5.4 +local initiative = param.get("initiative", "table")
     5.5 +local supporter = Supporter:by_pk(initiative.id, app.session.member.id)
     5.6 +
     5.7 +local routing = {
     5.8 +  default = {
     5.9 +    mode = "redirect",
    5.10 +    module = "lf2",
    5.11 +    view = "initiative",
    5.12 +    id = initiative.id
    5.13 +  }
    5.14 +}
    5.15 +
    5.16 +if not initiative.issue.fully_frozen and not initiative.issue.closed then
    5.17 +  ui.box_row{ content = function()
    5.18 +    if supporter then
    5.19 +      ui.box_col{ class = "left", content = function()
    5.20 +        if not supporter:has_critical_opinion() then
    5.21 +          ui.image{ static = "lf2/icon_star.png" }
    5.22 +          slot.put(" ")
    5.23 +          ui.tag{ content = _"Your are supporter" }
    5.24 +        else
    5.25 +          ui.image{ static = "lf2/icon_star.png" }
    5.26 +          slot.put(" ")
    5.27 +          ui.tag{ content = _"Your are potential supporter" }
    5.28 +        end
    5.29 +      end }
    5.30 +      ui.box_col{ class = "right", content = function()
    5.31 +        ui.link{
    5.32 +          text    = _"Remove support",
    5.33 +          module  = "initiative",
    5.34 +          action  = "remove_support",
    5.35 +          id      = initiative.id,
    5.36 +          routing = routing,
    5.37 +        }
    5.38 +      end }
    5.39 +    elseif not initiative.revoked then
    5.40 +      ui.box_col{ content = function()
    5.41 +        ui.image{ static = "lf2/icon_star_grey.png" }
    5.42 +        slot.put(" ")
    5.43 +        ui.link{
    5.44 +          text    = _"Support this initiative",
    5.45 +          module  = "initiative",
    5.46 +          action  = "add_support",
    5.47 +          id      = initiative.id,
    5.48 +          routing = routing
    5.49 +        }
    5.50 +      end }
    5.51 +    end
    5.52 +  end }
    5.53 +end
    5.54 +
     6.1 --- a/app/main/lf2/_interested.lua	Thu Mar 03 23:47:35 2011 +0100
     6.2 +++ b/app/main/lf2/_interested.lua	Sat Mar 05 15:34:17 2011 +0100
     6.3 @@ -1,5 +1,5 @@
     6.4  local interested_members = param.get("interested_members", "table")
     6.5 -ui.box{ content = function()
     6.6 +ui.box{ row_count = 2, content = function()
     6.7    ui.box_row{ class = "head interested", content = function()
     6.8      ui.box_col{ class = "head left", content = _"Members, interested in this issue" }
     6.9      ui.box_col{ class = "right", content = _("#{count} members", { count = #interested_members }) }
     7.1 --- a/app/main/lf2/_issue_initiatives.lua	Thu Mar 03 23:47:35 2011 +0100
     7.2 +++ b/app/main/lf2/_issue_initiatives.lua	Sat Mar 05 15:34:17 2011 +0100
     7.3 @@ -1,15 +1,17 @@
     7.4  local initiatives = param.get("initiatives", "table")
     7.5 +local current_initiative_id = param.get("current_initiative_id", atom.integer)
     7.6  
     7.7  for i, initiative in ipairs(initiatives) do
     7.8  
     7.9 -  local first = ""
    7.10 -  if i == 1 then first = " first" end
    7.11 +  local class = "initiative"
    7.12 +  if i == 1 then class = class .. " first" end
    7.13 +  if initiative.id == current_initiative_id then class = class .. " active" end
    7.14    
    7.15 -  ui.box_row{ class = "initiative" .. first, content = function() ui.box_col { content = function()
    7.16 +  ui.box_row{ class = class, content = function() ui.box_col { content = function()
    7.17  
    7.18      ui.link{ 
    7.19        module = "lf2", view = "initiative", id = initiative.id,
    7.20 -      params = { tab = "draft" }, attr = { class = "name" }, 
    7.21 +      attr = { class = "name" }, 
    7.22        text = initiative.name
    7.23      }
    7.24  
     8.1 --- a/app/main/lf2/_issues.lua	Thu Mar 03 23:47:35 2011 +0100
     8.2 +++ b/app/main/lf2/_issues.lua	Sat Mar 05 15:34:17 2011 +0100
     8.3 @@ -29,10 +29,23 @@
     8.4    local delegation = issue_delegation or area_delegation or global_delegation
     8.5  
     8.6    local delegating_interest = issue.delegating_interest
     8.7 +  --[[
     8.8 +  local current_delegating_interest = false
     8.9  
    8.10 -  ui.box{ class = "issue", content = function()
    8.11 +  for i, trustee in ipairs(trustees) do
    8.12 +    if i > 1 and trustee.participation then
    8.13 +      delegating_interest = true
    8.14 +    end
    8.15 +  end
    8.16 +  --]]
    8.17 +  local row_count = #initiatives + 3
    8.18 +  if #trustees > 1 then
    8.19 +    row_count = row_count + 1
    8.20 +  end
    8.21 +  
    8.22 +  ui.box{ class = "issue", row_count = row_count, content = function()
    8.23  
    8.24 -    ui.box_row{ class = "head", content = function()
    8.25 +    ui.box_row{ class = "head2", content = function()
    8.26  
    8.27        ui.box_col{ class = "issue_id left head", content = function()
    8.28          ui.link{
    8.29 @@ -50,7 +63,7 @@
    8.30  
    8.31      end }
    8.32  
    8.33 -    ui.box_row{ class = "head2", content = function()
    8.34 +    ui.box_row{ class = "head", content = function()
    8.35  
    8.36        ui.box_col{ class = "state_name left", content = function()
    8.37          ui.tag{ content = issue.state_name }
    8.38 @@ -61,15 +74,19 @@
    8.39      end }
    8.40      
    8.41      if #trustees > 1 then
    8.42 -      ui.box_row{ class = "head2", content = function()
    8.43 +      local class = "head2"
    8.44 +      if issue.closed or issue.fully_frozen then
    8.45 +        class = class .. " head2_last"
    8.46 +      end
    8.47 +      ui.box_row{ class = class, content = function()
    8.48          ui.box_col{ class = "left", content = function()
    8.49            execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } }
    8.50          end }
    8.51          if not issue.closed and not issue.fully_frozen then
    8.52            if trustees[1].scope_out == "issue" then
    8.53 -            text = _"Change or revoke issue delegation..."
    8.54 +            text = _"Change or revoke issue delegation"
    8.55            else
    8.56 -            text = _"Set issue delegation..."
    8.57 +            text = _"Set issue delegation"
    8.58            end  
    8.59            ui.box_col{ class = "right", content = function()
    8.60              ui.link{
    8.61 @@ -81,28 +98,32 @@
    8.62        end }
    8.63      end
    8.64  
    8.65 -    ui.box_row{ class = "head2", content = function()
    8.66 -      ui.box_col{ class = "interest left", content = function()
    8.67 -        if interest then
    8.68 -          ui.image{ static = "lf2/icon_star.png" }
    8.69 -          if issue.close then
    8.70 -            slot.put(" ", _"You were interested in this issue")
    8.71 -          else
    8.72 -            slot.put(" ", _"You are interested in this issue")
    8.73 +    if not issue.closed and not issue.fully_frozen then
    8.74 +      ui.box_row{ class = "head2 head2_last", content = function()
    8.75 +        ui.box_col{ class = "interest left", content = function()
    8.76 +          if interest then
    8.77 +            ui.image{ static = "lf2/icon_star.png" }
    8.78 +            if issue.close then
    8.79 +              slot.put(" ", _"You were interested in this issue")
    8.80 +            else
    8.81 +              slot.put(" ", _"You are interested in this issue")
    8.82 +            end
    8.83 +          elseif delegating_interest then
    8.84 +            ui.image{ static = "lf2/icon_delegated_star.png" }
    8.85 +            if issue.closed then
    8.86 +              slot.put(" ", _"Someone in your delegation chain was interested")
    8.87 +            else
    8.88 +              slot.put(" ", _"Someone in your delegation chain is interested")
    8.89 +            end
    8.90 +          elseif not issue.closed and not issue.fully_frozen then
    8.91 +            ui.link{
    8.92 +              text = _"Add my interest",
    8.93 +              module  = "interest", action  = "update", params  = { issue_id = issue.id },
    8.94 +              routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } }
    8.95 +            }
    8.96            end
    8.97 -        elseif delegating_interest then
    8.98 -          ui.image{ static = "lf2/icon_delegated_star.png" }
    8.99 -          if issue.closed then
   8.100 -            slot.put(" ", _"You were interested in this issue by delegation")
   8.101 -          else
   8.102 -            slot.put(" ", _"You are interested in this issue by delegation")
   8.103 -          end
   8.104 -        else
   8.105 -          slot.put(_"You are not interested in this issue")
   8.106 -        end
   8.107 -      end } 
   8.108 +        end } 
   8.109        
   8.110 -      if not issue.closed and not issue.fully_frozen then
   8.111          ui.box_col{ class = "right", content = function()
   8.112            if interest then
   8.113              ui.link{
   8.114 @@ -110,24 +131,25 @@
   8.115                module  = "interest", action  = "update", params  = { issue_id = issue.id, delete = true },
   8.116                routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } }
   8.117              }
   8.118 -          else
   8.119 +            slot.put(" · ")
   8.120 +          elseif delegating_interest then
   8.121              ui.link{
   8.122                text = _"Add my interest",
   8.123                module  = "interest", action  = "update", params  = { issue_id = issue.id },
   8.124                routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } }
   8.125              }
   8.126 +            slot.put(" · ")
   8.127            end
   8.128            if #trustees == 1 then
   8.129 -            slot.put(" · ")
   8.130              ui.link{
   8.131 -              text = _"Set issue delegation...",
   8.132 +              text = _"Set issue delegation",
   8.133                module = "lf2", view = "delegation", params = { issue_id = issue.id }
   8.134              }    
   8.135            end
   8.136          end }
   8.137 -      end
   8.138 +      end }
   8.139        
   8.140 -    end }
   8.141 +    end
   8.142      
   8.143      for i, initiative in ipairs(issue.initiatives) do
   8.144        ui.box_row{ class = "initiative", content = function() ui.box_col { content = function()
     9.1 --- a/app/main/lf2/_search.lua	Thu Mar 03 23:47:35 2011 +0100
     9.2 +++ b/app/main/lf2/_search.lua	Sat Mar 05 15:34:17 2011 +0100
     9.3 @@ -1,4 +1,4 @@
     9.4 -ui.box{ class = "search", content = function()
     9.5 +ui.box{ row_count = 2, class = "search", content = function()
     9.6    ui.box_row{ class = "head", content = function() ui.box_col{ class = "head", content = _"Search in initiatives" } end }
     9.7  
     9.8    ui.box_row{ content = function() ui.box_col{ content = function()
    10.1 --- a/app/main/lf2/_sidebar.lua	Thu Mar 03 23:47:35 2011 +0100
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,41 +0,0 @@
    10.4 -local current_area_id = param.get("current_area_id", atom.integer)
    10.5 -
    10.6 -local member_areas_selector = Area:build_selector{
    10.7 -  member_id = app.session.member_id,
    10.8 -  order = "name"
    10.9 -}
   10.10 -local other_areas_selector = Area:build_selector{
   10.11 -  not_member_id = app.session.member_id,
   10.12 -  order = "name"
   10.13 -}
   10.14 -
   10.15 -execute.view{ module = "lf2", view = "_sidebar_unit", params = { unit = {} } } --TODO
   10.16 -    
   10.17 -ui.form{
   10.18 -  method = "get",
   10.19 -  content = function()
   10.20 -    
   10.21 -    ui.container{ attr = { class = "boxhead" }, content = _"" }
   10.22 -    --execute.view{ module = "lf2", view = "_areas", params = { areas_selector = member_areas_selector } }
   10.23 -    
   10.24 -    execute.view{
   10.25 -      module = "lf2", view = "_areas", params = { 
   10.26 -        areas_selector = member_areas_selector,
   10.27 -        current_area_id = current_area_id,
   10.28 -        head_content = function() ui.tag{ content = _"Areas, you are member of" } end
   10.29 -      }
   10.30 -    }
   10.31 -
   10.32 -    execute.view{
   10.33 -      module = "lf2", view = "_areas", params = { 
   10.34 -        areas_selector = other_areas_selector,
   10.35 -        current_area_id = current_area_id,
   10.36 -        head_content = function() ui.tag{ content = _"Areas, you are not member of" } end
   10.37 -      }
   10.38 -    }
   10.39 -
   10.40 -  end
   10.41 -}
   10.42 -
   10.43 -execute.view{ module = "lf2", view = "_search", params = { area = area } }
   10.44 -    
    11.1 --- a/app/main/lf2/_sidebar_drafts.lua	Thu Mar 03 23:47:35 2011 +0100
    11.2 +++ b/app/main/lf2/_sidebar_drafts.lua	Sat Mar 05 15:34:17 2011 +0100
    11.3 @@ -5,53 +5,52 @@
    11.4    :add_order_by("id DESC")
    11.5    :exec()
    11.6  
    11.7 +ui.form{
    11.8 +  method = "get",
    11.9 +  module = "draft",
   11.10 +  view = "diff",
   11.11 +  content = function()
   11.12 +    ui.box{ class = "drafts", content = function()
   11.13 +      if drafts then
   11.14  
   11.15 -ui.box{ class = "drafts", content = function()
   11.16 -  if drafts then
   11.17 -    ui.form{
   11.18 -      method = "get",
   11.19 -      module = "draft",
   11.20 -      view = "diff",
   11.21 -      content = function()
   11.22          ui.box_row{ class = "head", content = function() ui.box_col{ class = "head", content = _"Draft revisions" } end }
   11.23 -        ui.box_row{ class = "", content = function()
   11.24 -          ui.box_col{ class = "scrolled", content = function()
   11.25  
   11.26 -            for i, draft in ipairs(drafts) do
   11.27 -              local class = "draft"
   11.28 -              if i == 1 then class = class .. " first" end
   11.29 -              ui.box_row{ class = class, content = function()
   11.30 -                ui.box_col{ class = "left", content = function()
   11.31 -                  ui.link{
   11.32 -                    attr = { class = "created" },
   11.33 -                    text = format.timestamp(draft.created),
   11.34 -                    module = "draft",
   11.35 -                    view = "show",
   11.36 -                    id = draft.id
   11.37 -                  }
   11.38 -                  slot.put("<br />")
   11.39 +        ui.box_row{ content = function() ui.box_col{ class = "scrolled", content = function()
   11.40 +          for i, draft in ipairs(drafts) do
   11.41 +            local class = "draft"
   11.42 +            if i == 1 then class = class .. " first" end
   11.43 +            ui.box_row{ class = class, content = function()
   11.44 +              ui.box_col{ class = "left", content = function()
   11.45 +                ui.link{
   11.46 +                  attr = { class = "created" },
   11.47 +                  text = format.timestamp(draft.created),
   11.48 +                  module = "draft",
   11.49 +                  view = "show",
   11.50 +                  id = draft.id
   11.51 +                }
   11.52 +                ui.container{ attr = { class = "authors" }, content = function()
   11.53                    ui.tag{ content = _"by" }
   11.54                    slot.put(" ")
   11.55                    ui.link{
   11.56 -                    attr = { class = "author_name" },
   11.57                      module = "lf2", view = "issue", id = initiative.issue_id,
   11.58                      params = { member_id = author_id },
   11.59                      text = draft.author.name
   11.60                    }
   11.61 -                end } 
   11.62 -                ui.box_col{ class = "right", content = function()
   11.63 -                  slot.put('<input type="radio" name="old_draft_id" value="' .. tostring(draft.id) .. '">')
   11.64 -                  slot.put('<input type="radio" name="new_draft_id" value="' .. tostring(draft.id) .. '">')
   11.65                  end }
   11.66 +              end } 
   11.67 +              ui.box_col{ class = "right", content = function()
   11.68 +                slot.put('<input type="radio" name="old_draft_id" value="' .. tostring(draft.id) .. '">')
   11.69 +                slot.put('<input type="radio" name="new_draft_id" value="' .. tostring(draft.id) .. '">')
   11.70                end }
   11.71 -            end
   11.72 -          end } end }
   11.73 +            end }
   11.74 +          end
   11.75 +        end } end }
   11.76  
   11.77 -          ui.box_row{ content = function() ui.box_col{ class = "right", content = function()
   11.78 +        ui.box_row{ class = "last", content = function() ui.box_col{ class = "right", content = function()
   11.79            ui.submit{ text = _"Compare selected" }
   11.80          end } end }
   11.81 +
   11.82        end
   11.83 -    }
   11.84 -  else
   11.85 +    end }
   11.86    end
   11.87 -end }
   11.88 +}
    12.1 --- a/app/main/lf2/_sidebar_initiatives.lua	Thu Mar 03 23:47:35 2011 +0100
    12.2 +++ b/app/main/lf2/_sidebar_initiatives.lua	Sat Mar 05 15:34:17 2011 +0100
    12.3 @@ -1,14 +0,0 @@
    12.4 -local head_content = param.get("head_content", "function")
    12.5 -
    12.6 -local initiatives = param.get("initiatives", "table")
    12.7 -ui.box{ content = function()
    12.8 -  if head_content then
    12.9 -    ui.box_row{ class = "head", content = function() ui.box_col{ class = "head", content = head_content } end }
   12.10 -  end
   12.11 -  ui.box_row{ class = "initiatives", content = function()
   12.12 -    ui.box_col{ class = "scrolled", content = function()
   12.13 -      execute.view{ module = "lf2", view = "_issue_initiatives", params = { initiatives = initiatives } }
   12.14 -    end }
   12.15 -  end }
   12.16 -end }
   12.17 -
    13.1 --- a/app/main/lf2/_sidebar_issue.lua	Thu Mar 03 23:47:35 2011 +0100
    13.2 +++ b/app/main/lf2/_sidebar_issue.lua	Sat Mar 05 15:34:17 2011 +0100
    13.3 @@ -1,6 +1,8 @@
    13.4  local issue = param.get("issue", "table")
    13.5  local initiative_id = param.get("initiative_id", atom.integer)
    13.6  
    13.7 +local alternative_initiatives = param.get("alternative_initiatives", "table")
    13.8 +
    13.9  local initiatives = issue.initiatives
   13.10  
   13.11  local interested_members_selector = Member:new_selector()
   13.12 @@ -21,16 +23,9 @@
   13.13  
   13.14  ui.box{ class = "issue", content = function()
   13.15  
   13.16 -  ui.box_row{ class = "issue_id head", content = function() ui.box_col{ class = "head", content = function()
   13.17 -    ui.link{
   13.18 -      module = "lf2", view = "issue", id = issue.id,
   13.19 -      content = _("Issue ##{id}", { id = issue.id })
   13.20 -    }
   13.21 -  end } end }
   13.22 -
   13.23    ui.box_row{ class = "unit_name head2", content = function() ui.box_col{ content = function()
   13.24      ui.link{ 
   13.25 -      module = "lf2", view = "unit", id = 1,
   13.26 +      module = "lf2", view = "index", id = 1,
   13.27        content = "DE / Berlin / Friedrichshain-Kreuzberg" 
   13.28      }
   13.29    end } end }
   13.30 @@ -42,6 +37,13 @@
   13.31      }
   13.32    end } end }
   13.33    
   13.34 +  ui.box_row{ class = "issue_id head2", content = function() ui.box_col{ class = "head", content = function()
   13.35 +    ui.link{
   13.36 +      module = "lf2", view = "issue", id = issue.id,
   13.37 +      content = _("Issue ##{id}", { id = issue.id })
   13.38 +    }
   13.39 +  end } end }
   13.40 +
   13.41    ui.box_row{ class = "policy_name head2", content = function() ui.box_col{ content = function()
   13.42      ui.link{
   13.43        module = "lf2", view = "policy", id = issue.policy_id,
   13.44 @@ -49,7 +51,7 @@
   13.45      }
   13.46    end } end }
   13.47  
   13.48 -  ui.box_row{ class = "time_left", content = function()
   13.49 +  ui.box_row{ class = "time_left head", content = function()
   13.50      ui.box_col{ content = issue.closed and _("Closed since #{date}", { date = format.date(issue.closed.date) }) or _("#{time_left} left", { time_left =  issue.state_time_left }) }
   13.51    end }
   13.52    
   13.53 @@ -65,7 +67,7 @@
   13.54        if not issue.closed and not issue.fully_frozen then
   13.55          ui.image{ static = "lf2/icon_star_grey.png" }
   13.56        end
   13.57 -      slot.put(_"You are not interested in this issue")
   13.58 +      slot.put(" ", _"You are not interested in this issue")
   13.59      end
   13.60      
   13.61      if issue.closed then
   13.62 @@ -117,13 +119,15 @@
   13.63  
   13.64    ui.box_row{ class = "delegation hoverbutton_container", content = function() ui.box_col{ content = function()
   13.65      if trustees[1].scope_out then
   13.66 +      ui.image{ static = "lf2/icon_delegation.png" }
   13.67 +      slot.put(" ")
   13.68        if trustees[1].disabled_out == false then
   13.69          if trustees[1].scope_out == "issue" then
   13.70 -          slot.put(encode.html(_"You have delegated this issue"))
   13.71 +          slot.put(encode.html(_"Issue is delegated"))
   13.72          elseif trustees[1].scope_out == "area" then
   13.73 -          slot.put(encode.html(_"You have delegated this area"))
   13.74 +          slot.put(encode.html(_"Area is delegated"))
   13.75          elseif trustees[1].scope_out == "global" then
   13.76 -          slot.put(encode.html(_"You have delegated globally"))
   13.77 +          slot.put(encode.html(_"Unit wide delegated"))
   13.78          end
   13.79        else
   13.80          if trustees[1].scope_out == "issue" then
   13.81 @@ -144,14 +148,19 @@
   13.82            slot.put(" ", encode.html(_"This issue is closed"))
   13.83          end }
   13.84        end }
   13.85 +    elseif issue.fully_frozen then
   13.86 +      ui.container{ attr = { class = "hoverbutton noaction"}, content = function()
   13.87 +        ui.container{ attr = { class = "content"}, content = function()
   13.88 +          slot.put(" ", encode.html(_"This issue is in voting"))
   13.89 +        end }
   13.90 +      end }
   13.91      else
   13.92 -      if #trustees > 1 then
   13.93 +      if #trustees > 1 and trustees[1].scope_out == "issue" then
   13.94          ui.link{
   13.95            module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id },
   13.96            attr = { class = "hoverbutton red"}, content = function()
   13.97            ui.container{ attr = { class = "content"}, content = function()
   13.98 -            ui.image{ static = "lf2/icon_delegation.png" }
   13.99 -            slot.put(" ", encode.html(_"Change issue delegation..."))
  13.100 +            slot.put(" ", encode.html(_"Change issue delegation"))
  13.101            end }
  13.102          end }
  13.103          
  13.104 @@ -160,9 +169,7 @@
  13.105            module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id },
  13.106            attr = { class = "hoverbutton green"}, content = function()
  13.107            ui.container{ attr = { class = "content"}, content = function()
  13.108 -            ui.image{ static = "lf2/icon_delegation.png" }
  13.109 -            slot.put(" ")
  13.110 -            slot.put(" ", encode.html(_"Set issue delegation..."))
  13.111 +            slot.put(" ", encode.html(_"Set issue delegation"))
  13.112              
  13.113            end }
  13.114          end }
  13.115 @@ -178,4 +185,12 @@
  13.116      end } end }
  13.117    end
  13.118  
  13.119 +  ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Initiatives in this issue" } end }
  13.120 +  ui.box_row{ class = "initiatives last", content = function()
  13.121 +    ui.box_col{ class = "scrolled", content = function()
  13.122 +      execute.view{ module = "lf2", view = "_issue_initiatives", params = { initiatives = alternative_initiatives, current_initiative_id = initiative_id } }
  13.123 +    end }
  13.124 +  end }
  13.125 +
  13.126 +
  13.127  end }
    14.1 --- a/app/main/lf2/_sidebar_unit.lua	Thu Mar 03 23:47:35 2011 +0100
    14.2 +++ b/app/main/lf2/_sidebar_unit.lua	Sat Mar 05 15:34:17 2011 +0100
    14.3 @@ -1,4 +1,16 @@
    14.4 -local unit = param.get("unit", "table")
    14.5 +local current_area_id = param.get("current_area_id", atom.integer)
    14.6 +local current_phase = param.get_all_cgi()["phase"]
    14.7 +
    14.8 +local member_areas_selector = Area:build_selector{
    14.9 +  member_id = app.session.member_id,
   14.10 +  order = "name"
   14.11 +}
   14.12 +local other_areas_selector = Area:build_selector{
   14.13 +  not_member_id = app.session.member_id,
   14.14 +  order = "name"
   14.15 +}
   14.16 +
   14.17 +local unit = {}
   14.18  
   14.19  local trustees = Member:new_selector()
   14.20    :add_field("delegation_chain.*")
   14.21 @@ -6,7 +18,12 @@
   14.22    :add_order_by("index")
   14.23    :exec()
   14.24  
   14.25 -ui.box{ content = function()
   14.26 +local row_count = member_areas_selector:count() + other_areas_selector:count() + 4
   14.27 +if #trustees > 1 then
   14.28 +  row_count = row_count + 1
   14.29 +end
   14.30 +
   14.31 +ui.box{ row_count = row_count, content = function()
   14.32    ui.box_row{ class = "head", content = function()
   14.33      ui.box_col{ class = "head", content = _"DE / Berlin / Friedrichshain-Kreuzberg" }
   14.34    end }
   14.35 @@ -19,9 +36,9 @@
   14.36    
   14.37    ui.box_row{ content = function() ui.box_col{ content = function()
   14.38      if trustees[1].scope_out == "global" then
   14.39 -      text = _"Change or revoke unit delegation..."
   14.40 +      text = _"Change or revoke unit delegation"
   14.41      else
   14.42 -      text = _"Set unit delegation..."
   14.43 +      text = _"Set unit delegation"
   14.44      end  
   14.45      ui.link{
   14.46        text = text,
   14.47 @@ -29,5 +46,38 @@
   14.48      }    
   14.49    end } end }
   14.50    
   14.51 +    
   14.52 +  ui.form{
   14.53 +    method = "get",
   14.54 +    content = function()
   14.55 +      
   14.56 +      ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = function()
   14.57 +        ui.link{ text = _"Areas, you are member of", module = "lf2", view = "index" }
   14.58 +      end } end }
   14.59 +
   14.60 +      execute.view{
   14.61 +        module = "lf2", view = "_areas", params = { 
   14.62 +          areas_selector = member_areas_selector,
   14.63 +          current_area_id = current_area_id,
   14.64 +          current_phase = current_phase
   14.65 +        }
   14.66 +      }
   14.67 +
   14.68 +      ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = function()
   14.69 +        ui.link{ content = _"Other areas", module = "lf2", view = "index" }
   14.70 +      end } end }
   14.71 +
   14.72 +      execute.view{
   14.73 +        module = "lf2", view = "_areas", params = { 
   14.74 +          areas_selector = other_areas_selector,
   14.75 +          current_area_id = current_area_id,
   14.76 +          current_phase = current_phase
   14.77 +        }
   14.78 +      }
   14.79 +
   14.80 +    end
   14.81 +  }
   14.82 +
   14.83  end }
   14.84 -    
   14.85 \ No newline at end of file
   14.86 +
   14.87 +execute.view{ module = "lf2", view = "_search", params = { area = area } }
    15.1 --- a/app/main/lf2/area.lua	Thu Mar 03 23:47:35 2011 +0100
    15.2 +++ b/app/main/lf2/area.lua	Sat Mar 05 15:34:17 2011 +0100
    15.3 @@ -3,7 +3,7 @@
    15.4  slot.set_layout("lf2")
    15.5  
    15.6  slot.select("sidebar", function()
    15.7 -  execute.view{ module = "lf2", view = "_sidebar", params = { current_area_id = area.id } }
    15.8 +  execute.view{ module = "lf2", view = "_sidebar_unit", params = { current_area_id = area.id } }
    15.9  end)
   15.10  
   15.11  execute.view{ module = "lf2", view = "_area", params = { area = area } }
   15.12 @@ -11,7 +11,7 @@
   15.13  
   15.14  local issues_selector = Issue:build_selector{
   15.15    area_id = area.id,
   15.16 -  state = param.get("state"),
   15.17 +  phase = param.get("phase"),
   15.18    order = param.get("order")
   15.19  }:limit(25)
   15.20  
   15.21 @@ -21,4 +21,7 @@
   15.22  issues:load("interest_for_member", { member_id = app.session.member_id }, "interest")
   15.23  issues:load("outgoing_delegations_for_member", { member_id = app.session.member_id }, "outgoing_delegations")
   15.24  
   15.25 +
   15.26 +app.topnav_area_id = area.id
   15.27 +
   15.28  execute.view{ module = "lf2", view = "_issues", params = { issues = issues } }
    16.1 --- a/app/main/lf2/delegation.lua	Thu Mar 03 23:47:35 2011 +0100
    16.2 +++ b/app/main/lf2/delegation.lua	Sat Mar 05 15:34:17 2011 +0100
    16.3 @@ -130,6 +130,9 @@
    16.4          }
    16.5        end } end }
    16.6        
    16.7 +      ui.box_row{ content = function()
    16.8 +        ui.box_col{ content = _"Please note: Member, interest and supporter counts are calculated periodically, therefore it can take some time until your changes become effective everywhere." }
    16.9 +      end }
   16.10        ui.box_row{ content = function() ui.box_col{ content = function()
   16.11          ui.submit{ text = _"Save" }
   16.12        end } end }
    17.1 --- a/app/main/lf2/index.lua	Thu Mar 03 23:47:35 2011 +0100
    17.2 +++ b/app/main/lf2/index.lua	Sat Mar 05 15:34:17 2011 +0100
    17.3 @@ -1,12 +1,11 @@
    17.4  slot.set_layout("lf2")
    17.5  
    17.6 -slot.select("sidebar", function()
    17.7 -  execute.view{ module = "lf2", view = "_sidebar" }
    17.8 -end)
    17.9 +local current_phase = param.get("phase")
   17.10 +local current_order = param.get("order")
   17.11  
   17.12  local issues_selector = Issue:build_selector{
   17.13 -  state = param.get("state"),
   17.14 -  order = param.get("order")
   17.15 +  phase = current_phase,
   17.16 +  order = current_order
   17.17  }:limit(25)
   17.18  
   17.19  local issues = issues_selector:exec()
   17.20 @@ -15,4 +14,9 @@
   17.21  issues:load("interest_for_member", { member_id = app.session.member_id }, "interest")
   17.22  issues:load("outgoing_delegations_for_member", { member_id = app.session.member_id }, "outgoing_delegations")
   17.23  
   17.24 +
   17.25 +slot.select("sidebar", function()
   17.26 +  execute.view{ module = "lf2", view = "_sidebar_unit" }
   17.27 +end)
   17.28 +
   17.29  execute.view{ module = "lf2", view = "_issues", params = { issues = issues } }
    18.1 --- a/app/main/lf2/initiative.lua	Thu Mar 03 23:47:35 2011 +0100
    18.2 +++ b/app/main/lf2/initiative.lua	Sat Mar 05 15:34:17 2011 +0100
    18.3 @@ -24,16 +24,15 @@
    18.4  local alternative_initiatives = initiative.issue.initiatives
    18.5  alternative_initiatives:load("initiating_members", nil, "initiating_members")
    18.6  
    18.7 +local support = Supporter:by_pk(initiative.id, app.session.member.id)
    18.8 +
    18.9 +app.topnav_phase = issue.phase
   18.10 +
   18.11  
   18.12  slot.select("sidebar", function()
   18.13    
   18.14 -  execute.view{ module = "lf2", view = "_sidebar_issue", params = { issue = issue, initiative_id = initiative.id } }
   18.15 -  
   18.16 -  execute.view{ module = "lf2", view = "_sidebar_initiatives", params = {
   18.17 -    initiatives = alternative_initiatives,
   18.18 -    head_content = function() ui.tag{ content = _"Alternative initiatives" } end
   18.19 -  } }
   18.20 -  
   18.21 +  execute.view{ module = "lf2", view = "_sidebar_issue", params = { issue = issue, initiative_id = initiative.id, alternative_initiatives = alternative_initiatives } }
   18.22 +
   18.23    execute.view{ module = "lf2", view = "_sidebar_drafts", params = {
   18.24      initiative = initiative
   18.25    } }
   18.26 @@ -45,52 +44,80 @@
   18.27  ui.box{
   18.28    content = function()
   18.29  
   18.30 -    ui.box_row{ class = "initiative head", content = function() ui.box_col { content = function()
   18.31 +    ui.box_row{ class = "initiative head2", content = function() ui.box_col { content = function()
   18.32        execute.view{ module = "lf2", view = "_initiative", params = { initiative = initiative } }
   18.33      end } end }
   18.34      
   18.35 -    ui.box_row{ class = "head2", content = function() ui.box_col{ content = function()
   18.36 +    ui.box_row{ class = "head", content = function() ui.box_col{ content = function()
   18.37 +      if initiative.issue.closed then
   18.38 +        if initiative.issue.accepted then
   18.39 +          if initiative.admitted then
   18.40 +            if initiative.agreed then
   18.41 +              if initiative.rank == 1 then
   18.42 +                ui.image{ static = "lf2/icon_award_gold.png" }
   18.43 +                slot.put(" ")
   18.44 +                ui.tag{ content = _"Approved" }
   18.45 +             else
   18.46 +                ui.image{ static = "lf2/icon_award_silver.png" }
   18.47 +                slot.put(" ")
   18.48 +                ui.tag{ content = _("Not approved (rank #{rank})", { rank = initiative.rank }) }
   18.49 +              end
   18.50 +            else
   18.51 +            ui.image{ static = "lf2/icon_cross.png" }
   18.52 +            slot.put(" ")
   18.53 +            ui.tag{ content = _"Initiative not approved" }
   18.54 +            end
   18.55 +          else
   18.56 +            ui.image{ static = "lf2/icon_cross.png" }
   18.57 +            slot.put(" ")
   18.58 +            ui.tag{ content = _"Initiative not admitted" }
   18.59 +          end
   18.60 +        else
   18.61 +        ui.image{ static = "lf2/icon_cross.png" }
   18.62 +        slot.put(" ")
   18.63 +        ui.tag{ content = _"Issue not accepted" }
   18.64 +        end
   18.65 +        slot.put(" ")
   18.66 +      end
   18.67 +
   18.68        if initiative.issue.fully_frozen and initiative.issue.closed then
   18.69 -        ui.link{ external = "#votes", text = _("#{vote_count} votes", { vote_count = #voting_members }) }
   18.70 +        if initiative.admitted and initiative.issue.ranks_available then
   18.71 +          slot.put(" &middot ")
   18.72 +          ui.link{ external = "#votes", text = _("#{vote_count}+#{delegated_weight} votes", { vote_count = #voting_members, delegated_weight = initiative.issue.voter_count - #voting_members }) }
   18.73 +        end
   18.74 +      end
   18.75 +      if initiative.issue.closed then
   18.76          slot.put(" &middot; ")
   18.77        end
   18.78        ui.link{ external = "#suggestions", text = _("#{suggestion_count} suggestions", { suggestion_count = 23 })  }
   18.79        slot.put(" &middot; ")
   18.80 -      ui.link{ external = "#supporters", text = _("#{supporter_count} supporters", { supporter_count = #supporting_members }) }
   18.81 +      ui.link{ external = "#supporters", text = _("#{supporter_count}+#{delegated_weight} supporters", { supporter_count = #supporting_members, delegated_weight = initiative.supporter_count - #supporting_members }) }
   18.82      end } end }
   18.83  
   18.84 +    execute.view{ module = "lf2", view = "_initiative_support", params = {
   18.85 +      initiative = initiative
   18.86 +    } }
   18.87 +
   18.88 +    ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Current draft" } end }
   18.89      ui.box_row{ content = function() ui.box_col{ content = function()
   18.90        execute.view{ module = "lf2", view = "_draft", params = { draft = draft } }
   18.91      end } end }
   18.92 -  end
   18.93 -}
   18.94  
   18.95 -if initiative.issue.fully_frozen and initiative.issue.closed then
   18.96 -  ui.boxhead{ name = "votes", content = _"Votes" }
   18.97 -  ui.box{
   18.98 -    content = function()
   18.99 +    if initiative.issue.fully_frozen and initiative.issue.closed then
  18.100 +      ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Voters" } end }
  18.101        ui.box_row{ content = function() ui.box_col{ content = function()
  18.102          execute.view{ module = "lf2", view = "_avatars", params = { members = voting_members } }
  18.103        end } end }
  18.104      end
  18.105 -  }
  18.106 -end
  18.107  
  18.108 -ui.boxhead{ name = "suggestions", content = _"Suggestions" }
  18.109 -ui.box{
  18.110 -  content = function()
  18.111 +    ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Suggestions" } end }
  18.112      ui.box_row{ content = function() ui.box_col{ content = function()
  18.113        slot.put("suggestions")
  18.114      end } end }
  18.115 -  end
  18.116 -}
  18.117 -    
  18.118 -ui.boxhead{ name = "supporters", content = _"Supporters" }
  18.119 -ui.box{
  18.120 -  content = function()
  18.121 +
  18.122 +    ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Supporters" } end }
  18.123      ui.box_row{ content = function() ui.box_col{ content = function()
  18.124        execute.view{ module = "lf2", view = "_avatars", params = { members = supporting_members } }
  18.125      end } end }
  18.126 -  end
  18.127 -}
  18.128 -    
  18.129 +
  18.130 +end }
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/app/main/lf2/interest.lua	Sat Mar 05 15:34:17 2011 +0100
    19.3 @@ -0,0 +1,61 @@
    19.4 +slot.set_layout("lf2")
    19.5 +
    19.6 +
    19.7 +local issue = Issue:by_id(param.get_id())
    19.8 +local member = Member:by_id(param.get("member", atom.integer))
    19.9 +
   19.10 +local area = issue.area
   19.11 +
   19.12 +-- TODO broken
   19.13 +--issue:load("interested_members_snapshot", {}, "interested_members")
   19.14 +issue:load("delegating_interest_snapshot_for_member", { member_id = app.session.member_id }, "delegating_interest")
   19.15 +issue:load("interest_for_member", { member_id = app.session.member_id }, "interest")
   19.16 +issue:load("outgoing_delegations_for_member", { member_id = app.session.member_id }, "outgoing_delegations")
   19.17 +
   19.18 +local initiatives = issue.initiatives
   19.19 +
   19.20 +local interested_members = issue.interested_members
   19.21 +
   19.22 +local interest = issue.interest
   19.23 +
   19.24 +local delegations = issue.delegations
   19.25 +
   19.26 +local trustees = Member:new_selector()
   19.27 +  :add_field("delegation_chain.*")
   19.28 +  :join("delegation_chain(" .. tostring(app.session.member.id) .. ", " .. tostring(area_id or "NULL") .. ", " .. tostring(issue_id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id")
   19.29 +  :add_order_by("index")
   19.30 +  :exec()
   19.31 +        
   19.32 +local global_delegation
   19.33 +local area_delegation
   19.34 +local issue_delegation
   19.35 +
   19.36 +for i, delegation in ipairs(issue.delegations) do
   19.37 +  if delegation.scope == "global" then global_delegation = delegation
   19.38 +  elseif delegation.scope == "area" then area_delegation = delegation
   19.39 +  elseif delegation.scope == "issue" then issue_delegation = delegation
   19.40 +  end
   19.41 +end
   19.42 +
   19.43 +local delegation = issue_delegation or area_delegation or global_delegation
   19.44 +
   19.45 +local delegating_interest = issue.delegating_interest
   19.46 +
   19.47 +app.topnav_phase = issue.phase
   19.48 +app.topnav_area_id = issue.area_id
   19.49 +
   19.50 +slot.select("sidebar", function()
   19.51 +  execute.view{ module = "lf2", view = "_sidebar_unit", params = { current_area_id = issue.area_id } }
   19.52 +end)
   19.53 +
   19.54 +execute.view{ module = "lf2", view = "_area", params = { area = area } }
   19.55 +
   19.56 +execute.view{ module = "lf2", view = "_issues", params = { issues = { issue } } }
   19.57 +
   19.58 +-- TODO bugfix for not working reference loader
   19.59 +interested_members = issue:get_reference_selector("interested_members_snapshot"):exec()
   19.60 +
   19.61 +execute.view{ module = "lf2", view = "_interested", params = {
   19.62 +  interested_members = interested_members
   19.63 +} }
   19.64 +
    20.1 --- a/app/main/lf2/issue.lua	Thu Mar 03 23:47:35 2011 +0100
    20.2 +++ b/app/main/lf2/issue.lua	Sat Mar 05 15:34:17 2011 +0100
    20.3 @@ -39,8 +39,11 @@
    20.4  
    20.5  local delegating_interest = issue.delegating_interest
    20.6  
    20.7 +app.topnav_phase = issue.phase
    20.8 +app.topnav_area_id = issue.area_id
    20.9 +
   20.10  slot.select("sidebar", function()
   20.11 -  execute.view{ module = "lf2", view = "_sidebar", params = { current_area_id = issue.area_id } }
   20.12 +  execute.view{ module = "lf2", view = "_sidebar_unit", params = { current_area_id = issue.area_id } }
   20.13  end)
   20.14  
   20.15  execute.view{ module = "lf2", view = "_area", params = { area = area } }
    21.1 --- a/env/ui/box.lua	Thu Mar 03 23:47:35 2011 +0100
    21.2 +++ b/env/ui/box.lua	Sat Mar 05 15:34:17 2011 +0100
    21.3 @@ -1,6 +1,4 @@
    21.4  function ui.box(args)
    21.5 -  app.ui_box_row = 1
    21.6 -  app.ui_box_row_count = args.row_count
    21.7    local class = "box"
    21.8    if args.class then class = class .. " " .. args.class end
    21.9    ui.container{ attr = { class = class }, content = args.content }
    22.1 --- a/env/ui/box_col.lua	Thu Mar 03 23:47:35 2011 +0100
    22.2 +++ b/env/ui/box_col.lua	Sat Mar 05 15:34:17 2011 +0100
    22.3 @@ -1,7 +1,5 @@
    22.4  function ui.box_col(args)
    22.5    local class = "col"
    22.6    if args.class then class = class .. " " .. args.class end
    22.7 -  if app.ui_box_col == 1 then class = class .. " first" end
    22.8    ui.container{ attr = { class = class }, content = args.content }
    22.9 -  app.ui_box_col = app.ui_box_col + 1
   22.10  end
    23.1 --- a/env/ui/box_row.lua	Thu Mar 03 23:47:35 2011 +0100
    23.2 +++ b/env/ui/box_row.lua	Sat Mar 05 15:34:17 2011 +0100
    23.3 @@ -2,24 +2,11 @@
    23.4    app.ui_box_col = 1
    23.5    local class = "row"
    23.6    if args.class then class = class .. " " .. args.class end
    23.7 -  if app.ui_box_row == 1 then class = class .. " first" end
    23.8 -  if app.ui_box_row == app.ui_box_row_count then class = class .. " last" end
    23.9 -  if args.toggle_content then class = class .. " toggled" end
   23.10    ui.container{ attr = { class = class }, content = function()
   23.11 -    if args.toggle_content then
   23.12 -      ui.container{ attr = { class = "col toggle"}, content = function()
   23.13 -        if type(args.toggle_content) == "function" then
   23.14 -          args.toggle_content()
   23.15 -        else
   23.16 -          slot.put(encode.html(args.toggle_content))
   23.17 -        end
   23.18 -      end }
   23.19 -    end
   23.20      if type(args.content) == "function" then
   23.21        args.content()
   23.22      else
   23.23        slot.put(encode.html(args.content))
   23.24      end
   23.25    end }
   23.26 -  app.ui_box_row = app.ui_box_row + 1
   23.27  end
    24.1 --- a/model/issue.lua	Thu Mar 03 23:47:35 2011 +0100
    24.2 +++ b/model/issue.lua	Sat Mar 05 15:34:17 2011 +0100
    24.3 @@ -302,15 +302,15 @@
    24.4    if args.area_id then
    24.5      selector:add_where{ "issue.area_id = ?", args.area_id }
    24.6    end
    24.7 -  if args.state == "closed" then
    24.8 +  if args.phase == "closed" then
    24.9      selector:add_where("issue.closed NOTNULL")
   24.10 -  elseif args.state == "voting" then
   24.11 +  elseif args.phase == "voting" then
   24.12      selector:add_where("issue.fully_frozen NOTNULL AND issue.closed ISNULL")
   24.13 -  elseif args.state == "frozen" then
   24.14 +  elseif args.phase == "frozen" then
   24.15      selector:add_where("issue.half_frozen NOTNULL AND issue.fully_frozen ISNULL AND issue.closed ISNULL")
   24.16 -  elseif args.state == "discussion" then
   24.17 +  elseif args.phase == "discussion" then
   24.18      selector:add_where("issue.accepted NOTNULL AND issue.half_frozen ISNULL AND issue.closed ISNULL")
   24.19 -  elseif args.state == "new" then
   24.20 +  elseif args.phase == "new" then
   24.21      selector:add_where("issue.accepted ISNULL AND issue.closed ISNULL")
   24.22    end
   24.23    if args.order == "time_left" then
   24.24 @@ -343,6 +343,15 @@
   24.25  
   24.26  end
   24.27  
   24.28 +function Issue.object_get:phase()
   24.29 +  local state = self.state
   24.30 +  if state == "finished" or state == "cancelled" then
   24.31 +    return "closed"
   24.32 +  else
   24.33 +    return state
   24.34 +  end
   24.35 +end
   24.36 +
   24.37  function Issue.object_get:state_name()
   24.38    return Issue:get_state_name_for_state(self.state)
   24.39  end
    25.1 --- a/static/lf2.css	Thu Mar 03 23:47:35 2011 +0100
    25.2 +++ b/static/lf2.css	Sat Mar 05 15:34:17 2011 +0100
    25.3 @@ -56,11 +56,11 @@
    25.4  body {
    25.5    font-family: sans-serif;
    25.6    background-color: #7df;
    25.7 +  xbackground-image: url('lf2/back.jpg');
    25.8    color: #000;
    25.9  }
   25.10  
   25.11  a {
   25.12 -  background-color: #ffffff;
   25.13    color: #000;
   25.14  }
   25.15  
   25.16 @@ -141,23 +141,6 @@
   25.17    color: #46a;
   25.18  }
   25.19  
   25.20 -.boxhead,
   25.21 -a.boxhead {
   25.22 -  /* position */
   25.23 -  display: block;
   25.24 -  margin-bottom: 0.5ex;
   25.25 -  margin-top: 1ex;
   25.26 -  margin-left: 0.5em;
   25.27 -
   25.28 -  /* color */
   25.29 -  background-color: #7df;
   25.30 -  color: #000;
   25.31 -
   25.32 -  /* text format */
   25.33 -  font-weight: bold;
   25.34 -  text-shadow: 2px 2px 2px #fff;
   25.35 -}
   25.36 -
   25.37  .box {
   25.38    /* position */
   25.39    position: relative;
   25.40 @@ -181,7 +164,7 @@
   25.41    /* position */
   25.42  
   25.43    /* border */
   25.44 -  border-top: 1px solid #ccc;
   25.45 +  border-bottom: 1px solid #ccc;
   25.46  }
   25.47  
   25.48  .box .row .col {
   25.49 @@ -189,7 +172,7 @@
   25.50    padding: 0.5ex 0.2em 0.5ex 0.2em;
   25.51  
   25.52    /* text format */
   25.53 -  line-height: 125%;
   25.54 +  line-height: 115%;
   25.55  }
   25.56  
   25.57  .box .row .col.left {
   25.58 @@ -200,65 +183,28 @@
   25.59    float: right;
   25.60  }
   25.61  
   25.62 -.box .row .col.clearleft {
   25.63 -  clear: left;
   25.64 -}
   25.65 -
   25.66 -.box .row .col.clearright {
   25.67 -  clear: right;
   25.68 -}
   25.69 -
   25.70 -.box .row .col.toggle {
   25.71 -  float: left;
   25.72 -  /* position */
   25.73 -  padding-left: 0.4em;
   25.74 -}
   25.75 -
   25.76 -.box .row .col.toggle:hover {
   25.77 -  /* color */
   25.78 -  background-color: #7cf;
   25.79 -
   25.80 -  /* cursor */
   25.81 -  cursor: pointer;
   25.82 +.box .row:last-child {
   25.83 +  /* border */
   25.84 +  border-bottom: none;
   25.85  }
   25.86  
   25.87 -.box .row.first .col.toggle {
   25.88 -  /* border */
   25.89 -  border-radius: 1ex 0 0 0;
   25.90 -}
   25.91 -
   25.92 -.box .row.last .col.toggle {
   25.93 -  /* border */
   25.94 -  border-radius: 0 0 0 1ex;
   25.95 -}
   25.96 -
   25.97 -.box .row.toggled .col.first {
   25.98 -  /* position */
   25.99 -  margin-left: 1.5em;
  25.100 -}
  25.101 -
  25.102 -.box .row.first {
  25.103 -  /* border */
  25.104 -  border-top: none;
  25.105 -}
  25.106 -
  25.107 -.box .row .col.first {
  25.108 +.box .row .col:first-child {
  25.109    /* position */
  25.110    padding-left: 0.5em;
  25.111  }
  25.112  
  25.113 -.box .row.toggled .col.first {
  25.114 -  /* position */
  25.115 -  padding-left: 0.2em;
  25.116 +.box .row:first-child.head,
  25.117 +.box .row:first-child.head2 {
  25.118 +  border-radius: 1ex 1ex 0 0;
  25.119  }
  25.120  
  25.121  .box .row.head {
  25.122 -  background-color: #e4e7f0;
  25.123 +  background-color: #fafcff;
  25.124    color: #000;
  25.125 -  border-radius: 1ex 1ex 0 0;
  25.126 +  border-bottom-color: #777;
  25.127  }
  25.128  
  25.129 -.box .row.last {
  25.130 +.box .row:last-child {
  25.131    border-radius: 0 0 1ex 1ex;
  25.132  }
  25.133  
  25.134 @@ -268,20 +214,32 @@
  25.135  }
  25.136  
  25.137  .box .row.head .col a {
  25.138 -  background-color: #e4e7f0;
  25.139 +  background-color: #fafcff;
  25.140    color: #3B6E7F;
  25.141  }
  25.142  
  25.143  .box .row.head2 {
  25.144 -  background-color: #f2f3f7;
  25.145 +  background-color: #fafcff;
  25.146    color: #000;
  25.147  }
  25.148  
  25.149 +.box .row.head2 .col.head {
  25.150 +  font-weight: bold;
  25.151 +}
  25.152 +
  25.153  .box .row.head2 .col a {
  25.154 -  background-color: #f2f3f7;
  25.155 +  background-color: #fafcff;
  25.156    color: #3B6E7F;
  25.157  }
  25.158  
  25.159 +.box .row.subhead .col {
  25.160 +  margin-top: 2ex;
  25.161 +  font-weight: bold;
  25.162 +}
  25.163 +
  25.164 +.box .row.subhead {
  25.165 +  border-bottom-color: #777;
  25.166 +}
  25.167  
  25.168  .box .row .col a {
  25.169    color: #3B6E7F;
  25.170 @@ -349,6 +307,11 @@
  25.171    padding: 0.5ex 0.2em 0.5ex 0.5em;
  25.172  }
  25.173  
  25.174 +.box .row.last-child .hoverbutton {
  25.175 +  border-radius: 0 0 1ex 1ex;
  25.176 +}
  25.177 +
  25.178 +
  25.179  /* Scrolled col */
  25.180  
  25.181  .box .row .col.scrolled {
  25.182 @@ -496,6 +459,7 @@
  25.183    font-weight: bold;
  25.184  }
  25.185  
  25.186 +.draft .authors,
  25.187  .initiative .authors {
  25.188    /* color */
  25.189    color: #777;
  25.190 @@ -505,6 +469,7 @@
  25.191    font-style: italic;
  25.192  }
  25.193  
  25.194 +.draft .authors a,
  25.195  .initiative .authors a {
  25.196    /* color */
  25.197  }
  25.198 @@ -513,10 +478,9 @@
  25.199    font-weight: bold;
  25.200  }
  25.201  
  25.202 -.drafts .draft .author_name {
  25.203 -  font-style: italic;
  25.204 +.box.issue .row.unit_name {
  25.205 +  border-bottom-color: #ccc;
  25.206  }
  25.207 -
  25.208  /* Draft */
  25.209  
  25.210  .draft {
    26.1 Binary file static/lf2/back.jpg has changed
    27.1 Binary file static/lf2/icon_delegation.png has changed
    28.1 Binary file static/lf2/icon_delegation_issue.png has changed

Impressum / About Us