liquid_feedback_frontend

changeset 61:f77ca23f9ebd

merge
author jbe
date Thu Apr 22 16:03:53 2010 +0200 (2010-04-22)
parents 1d08cf5dca3d 7bc629bc1c20
children 0e75b5f04fe5
files
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/index/_initiator_invites.lua	Thu Apr 22 16:03:53 2010 +0200
     1.3 @@ -0,0 +1,16 @@
     1.4 +local initiatives_selector = param.get("initiatives_selector", "table")
     1.5 +
     1.6 +if initiatives_selector:count() > 0 then
     1.7 +  ui.container{
     1.8 +    attr = { style = "font-weight: bold;" },
     1.9 +    content = _"Initiatives that invited you to become initiator:"
    1.10 +  }
    1.11 +
    1.12 +  execute.view{
    1.13 +    module = "initiative",
    1.14 +    view = "_list",
    1.15 +    params = { initiatives_selector = initiatives_selector }
    1.16 +  }
    1.17 +else
    1.18 +  ui.field.text{ value = _"You are currently not invited to any initiative." }
    1.19 +end
    1.20 \ No newline at end of file
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/app/main/index/_motd.lua	Thu Apr 22 16:03:53 2010 +0200
     2.3 @@ -0,0 +1,15 @@
     2.4 +local lang = locale.get("lang")
     2.5 +local basepath = request.get_app_basepath() 
     2.6 +local file_name = basepath .. "/locale/motd/" .. lang .. ".txt"
     2.7 +local file = io.open(file_name)
     2.8 +if file ~= nil then
     2.9 +  local help_text = file:read("*a")
    2.10 +  if #help_text > 0 then
    2.11 +    ui.container{
    2.12 +      attr = { class = "wiki" },
    2.13 +      content = function()
    2.14 +        slot.put(format.wiki_text(help_text))
    2.15 +      end
    2.16 +    }
    2.17 +  end
    2.18 +end
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/app/main/index/_not_voted_issues.lua	Thu Apr 22 16:03:53 2010 +0200
     3.3 @@ -0,0 +1,64 @@
     3.4 +local areas = param.get("areas", "table")
     3.5 +
     3.6 +if #areas > 0 then
     3.7 +  ui.container{
     3.8 +    attr = { style = "font-weight: bold;" },
     3.9 +    content = _"Current votings in areas you are member of and issues you are interested in:"
    3.10 +  }
    3.11 +  
    3.12 +  ui.list{
    3.13 +    records = areas,
    3.14 +    columns = {
    3.15 +      {
    3.16 +        name = "name"
    3.17 +      },
    3.18 +      {
    3.19 +        content = function(record)
    3.20 +          if record.is_member and record.issues_to_vote_count > 0 then
    3.21 +            ui.link{
    3.22 +              content = function()
    3.23 +                if record.issues_to_vote_count > 1 then
    3.24 +                  slot.put(_("#{issues_to_vote_count} issue(s)", { issues_to_vote_count = record.issues_to_vote_count }))
    3.25 +                else
    3.26 +                  slot.put(_("One issue"))
    3.27 +                end
    3.28 +              end,
    3.29 +              module = "area",
    3.30 +              view = "show",
    3.31 +              id = record.id,
    3.32 +              params = { 
    3.33 +                filter = "frozen",
    3.34 +                filter_voting = "not_voted"
    3.35 +              }
    3.36 +            }
    3.37 +          else
    3.38 +            slot.put(_"Not a member")
    3.39 +          end
    3.40 +        end
    3.41 +      },
    3.42 +      {
    3.43 +        content = function(record)
    3.44 +          if record.interested_issues_to_vote_count > 0 then
    3.45 +            ui.link{
    3.46 +              content = function()
    3.47 +                if record.interested_issues_to_vote_count > 1 then
    3.48 +                  slot.put(_("#{interested_issues_to_vote_count} issue(s) you are interested in", { interested_issues_to_vote_count = record.interested_issues_to_vote_count }))
    3.49 +                else
    3.50 +                  slot.put(_"One issue you are interested in")
    3.51 +                end
    3.52 +              end,
    3.53 +              module = "area",
    3.54 +              view = "show",
    3.55 +              id = record.id,
    3.56 +              params = { 
    3.57 +                filter = "frozen",
    3.58 +                filter_interest = "my",
    3.59 +                filter_voting = "not_voted"
    3.60 +              }
    3.61 +            }
    3.62 +          end
    3.63 +        end
    3.64 +      },
    3.65 +    }
    3.66 +  }
    3.67 +end
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/app/main/index/_updated_drafts.lua	Thu Apr 22 16:03:53 2010 +0200
     4.3 @@ -0,0 +1,17 @@
     4.4 +local initiatives_selector = Initiative:new_selector()
     4.5 +  :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id AND _issue_state.closed ISNULL AND _issue_state.fully_frozen ISNULL")
     4.6 +  :join("current_draft", "_current_draft", "_current_draft.initiative_id = initiative.id")
     4.7 +  :join("supporter", "supporter", { "supporter.member_id = ? AND supporter.initiative_id = initiative.id AND supporter.draft_id < _current_draft.id", app.session.member_id })
     4.8 +
     4.9 +if initiatives_selector:count() > 0 then
    4.10 +  ui.container{
    4.11 +    attr = { style = "font-weight: bold;" },
    4.12 +    content = _"Open initiatives you are supporting which has been updated their draft:"
    4.13 +  }
    4.14 +
    4.15 +  execute.view{
    4.16 +    module = "initiative",
    4.17 +    view = "_list",
    4.18 +    params = { initiatives_selector = initiatives_selector }
    4.19 +  }
    4.20 +end
    4.21 \ No newline at end of file
     5.1 --- a/app/main/index/index.lua	Tue Apr 20 10:19:37 2010 +0200
     5.2 +++ b/app/main/index/index.lua	Thu Apr 22 16:03:53 2010 +0200
     5.3 @@ -55,7 +55,6 @@
     5.4        module = "member",
     5.5        view = "edit"
     5.6      }
     5.7 -  
     5.8      ui.link{
     5.9        content = function()
    5.10            ui.image{ static = "icons/16/user_gray.png" }
    5.11 @@ -64,12 +63,10 @@
    5.12        module = "member",
    5.13        view = "edit_images"
    5.14      }
    5.15 -  
    5.16      execute.view{
    5.17        module = "delegation",
    5.18        view = "_show_box"
    5.19      }
    5.20 -  
    5.21      ui.link{
    5.22        content = function()
    5.23            ui.image{ static = "icons/16/wrench.png" }
    5.24 @@ -78,7 +75,6 @@
    5.25        module = "member",
    5.26        view = "settings"
    5.27      }
    5.28 -  
    5.29      if config.download_dir then
    5.30        ui.link{
    5.31          content = function()
    5.32 @@ -92,133 +88,13 @@
    5.33    end
    5.34  end)
    5.35  
    5.36 -local lang = locale.get("lang")
    5.37 -local basepath = request.get_app_basepath() 
    5.38 -local file_name = basepath .. "/locale/motd/" .. lang .. ".txt"
    5.39 -local file = io.open(file_name)
    5.40 -if file ~= nil then
    5.41 -  local help_text = file:read("*a")
    5.42 -  if #help_text > 0 then
    5.43 -    ui.container{
    5.44 -      attr = { class = "motd wiki" },
    5.45 -      content = function()
    5.46 -        slot.put(format.wiki_text(help_text))
    5.47 -      end
    5.48 -    }
    5.49 -  end
    5.50 -end
    5.51 -
    5.52 -
    5.53  util.help("index.index", _"Home")
    5.54  
    5.55 -local areas = {}
    5.56 -if app.session.member then
    5.57 -  local selector = Area:new_selector()
    5.58 -    :reset_fields()
    5.59 -    :add_field("area.id", nil, { "grouped" })
    5.60 -    :add_field("area.name", nil, { "grouped" })
    5.61 -    :add_field("membership.member_id NOTNULL", "is_member", { "grouped" })
    5.62 -    :add_field("count(issue.id)", "issues_to_vote_count")
    5.63 -    :add_field("count(interest.member_id)", "interested_issues_to_vote_count")
    5.64 -    :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL")
    5.65 -    :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id })
    5.66 -    :add_where{ "direct_voter.member_id ISNULL" }
    5.67 -    :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id })
    5.68 -    :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id })
    5.69 -  
    5.70 -  for i, area in ipairs(selector:exec()) do
    5.71 -    if area.is_member or area.interested_issues_to_vote_count > 0 then
    5.72 -      areas[#areas+1] = area
    5.73 -    end
    5.74 -  end
    5.75 -end
    5.76 -
    5.77 -if #areas > 0 then
    5.78 -  ui.container{
    5.79 -    attr = { style = "font-weight: bold;" },
    5.80 -    content = _"Current votings in areas you are member of and issues you are interested in:"
    5.81 +execute.view{
    5.82 +  module = "member",
    5.83 +  view = "_show",
    5.84 +  params = {
    5.85 +    member = app.session.member,
    5.86 +    show_as_homepage = true
    5.87    }
    5.88 -  
    5.89 -  ui.list{
    5.90 -    records = areas,
    5.91 -    columns = {
    5.92 -      {
    5.93 -        name = "name"
    5.94 -      },
    5.95 -      {
    5.96 -        content = function(record)
    5.97 -          if record.is_member and record.issues_to_vote_count > 0 then
    5.98 -            ui.link{
    5.99 -              content = function()
   5.100 -                if record.issues_to_vote_count > 1 then
   5.101 -                  slot.put(_("#{issues_to_vote_count} issue(s)", { issues_to_vote_count = record.issues_to_vote_count }))
   5.102 -                else
   5.103 -                  slot.put(_("One issue"))
   5.104 -                end
   5.105 -              end,
   5.106 -              module = "area",
   5.107 -              view = "show",
   5.108 -              id = record.id,
   5.109 -              params = { 
   5.110 -                filter = "frozen",
   5.111 -                filter_voting = "not_voted"
   5.112 -              }
   5.113 -            }
   5.114 -          else
   5.115 -            slot.put(_"Not a member")
   5.116 -          end
   5.117 -        end
   5.118 -      },
   5.119 -      {
   5.120 -        content = function(record)
   5.121 -          if record.interested_issues_to_vote_count > 0 then
   5.122 -            ui.link{
   5.123 -              content = function()
   5.124 -                if record.interested_issues_to_vote_count > 1 then
   5.125 -                  slot.put(_("#{interested_issues_to_vote_count} issue(s) you are interested in", { interested_issues_to_vote_count = record.interested_issues_to_vote_count }))
   5.126 -                else
   5.127 -                  slot.put(_"One issue you are interested in")
   5.128 -                end
   5.129 -              end,
   5.130 -              module = "area",
   5.131 -              view = "show",
   5.132 -              id = record.id,
   5.133 -              params = { 
   5.134 -                filter = "frozen",
   5.135 -                filter_interest = "my",
   5.136 -                filter_voting = "not_voted"
   5.137 -              }
   5.138 -            }
   5.139 -          end
   5.140 -        end
   5.141 -      },
   5.142 -    }
   5.143 -  }
   5.144 -end
   5.145 -
   5.146 -local initiatives_selector = Initiative:new_selector()
   5.147 -  :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id")
   5.148 -  :join("initiator", nil, { "initiator.initiative_id = initiative.id AND initiator.member_id = ? AND initiator.accepted ISNULL", app.session.member.id })
   5.149 -  :add_where("_issue_state.closed ISNULL AND _issue_state.half_frozen ISNULL")
   5.150 -
   5.151 -if initiatives_selector:count() > 0 then
   5.152 -  ui.container{
   5.153 -    attr = { style = "font-weight: bold;" },
   5.154 -    content = _"Initiatives that invited you to become initiator:"
   5.155 -  }
   5.156 -
   5.157 -  execute.view{
   5.158 -    module = "initiative",
   5.159 -    view = "_list",
   5.160 -    params = { initiatives_selector = initiatives_selector }
   5.161 -  }
   5.162 -end
   5.163 -
   5.164 -
   5.165 -if app.session.member then
   5.166 -  execute.view{
   5.167 -    module = "member",
   5.168 -    view = "_show",
   5.169 -    params = { member = app.session.member }
   5.170 -  }
   5.171 -end
   5.172 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/app/main/index/show_tab.lua	Thu Apr 22 16:03:53 2010 +0200
     6.3 @@ -0,0 +1,72 @@
     6.4 +local tabs = {
     6.5 +  module = "index",
     6.6 +  view = "show_tab"
     6.7 +}
     6.8 +
     6.9 +local selector = Area:new_selector()
    6.10 +  :reset_fields()
    6.11 +  :add_field("area.id", nil, { "grouped" })
    6.12 +  :add_field("area.name", nil, { "grouped" })
    6.13 +  :add_field("membership.member_id NOTNULL", "is_member", { "grouped" })
    6.14 +  :add_field("count(issue.id)", "issues_to_vote_count")
    6.15 +  :add_field("count(interest.member_id)", "interested_issues_to_vote_count")
    6.16 +  :add_field("count(interest.member_id NOTNULL OR interest.member_id NOTNULL)", "issues_to_vote_count_sum")
    6.17 +  :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL")
    6.18 +  :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id })
    6.19 +  :add_where{ "direct_voter.member_id ISNULL" }
    6.20 +  :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id })
    6.21 +  :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id })
    6.22 +
    6.23 +local not_voted_areas = {}
    6.24 +local issues_to_vote_count = 0
    6.25 +for i, area in ipairs(selector:exec()) do
    6.26 +  if area.is_member or area.interested_issues_to_vote_count > 0 then
    6.27 +    not_voted_areas[#not_voted_areas+1] = area
    6.28 +  end
    6.29 +  issues_to_vote_count = issues_to_vote_count + area.issues_to_vote_count_sum
    6.30 +end
    6.31 +
    6.32 +tabs[#tabs+1] = {
    6.33 +  name = "not_voted_issues",
    6.34 +  label = _"Not voted issues" .. " (" .. tostring(issues_to_vote_count) .. ")",
    6.35 +  icon = { static = "icons/16/email_open.png" },
    6.36 +  module = "index",
    6.37 +  view = "_not_voted_issues",
    6.38 +  params = {
    6.39 +    areas = not_voted_areas
    6.40 +  }
    6.41 +}
    6.42 +
    6.43 +local initiator_invites_selector = Initiative:new_selector()
    6.44 +  :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id")
    6.45 +  :join("initiator", nil, { "initiator.initiative_id = initiative.id AND initiator.member_id = ? AND initiator.accepted ISNULL", app.session.member.id })
    6.46 +  :add_where("_issue_state.closed ISNULL AND _issue_state.half_frozen ISNULL")
    6.47 +
    6.48 +tabs[#tabs+1] = {
    6.49 +  name = "initiator_invites",
    6.50 +  label = _"Initiator invites" .. " (" .. tostring(initiator_invites_selector:count()) .. ")",
    6.51 +  icon = { static = "icons/16/email_open.png" },
    6.52 +  module = "index",
    6.53 +  view = "_initiator_invites",
    6.54 +  params = {
    6.55 +    initiatives_selector = initiator_invites_selector
    6.56 +  }
    6.57 +}
    6.58 +
    6.59 +local updated_drafts_selector = Initiative:new_selector()
    6.60 +  :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id AND _issue_state.closed ISNULL AND _issue_state.fully_frozen ISNULL")
    6.61 +  :join("current_draft", "_current_draft", "_current_draft.initiative_id = initiative.id")
    6.62 +  :join("supporter", "supporter", { "supporter.member_id = ? AND supporter.initiative_id = initiative.id AND supporter.draft_id < _current_draft.id", app.session.member_id })
    6.63 +
    6.64 +tabs[#tabs+1] = {
    6.65 +  name = "updated_drafts",
    6.66 +  label = _"Updated drafts" .. " (" .. tostring(updated_drafts_selector:count()) .. ")",
    6.67 +  icon = { static = "icons/16/email_open.png" },
    6.68 +  module = "index",
    6.69 +  view = "_updated_drafts",
    6.70 +  params = {
    6.71 +    initiatives_selector = updated_drafts_selector
    6.72 +  }
    6.73 +}
    6.74 +
    6.75 +ui.tabs(tabs)
    6.76 \ No newline at end of file
     7.1 --- a/app/main/initiative/_list.lua	Tue Apr 20 10:19:37 2010 +0200
     7.2 +++ b/app/main/initiative/_list.lua	Thu Apr 22 16:03:53 2010 +0200
     7.3 @@ -9,7 +9,7 @@
     7.4  
     7.5  if app.session.member_id then
     7.6    initiatives_selector
     7.7 -    :left_join("initiator", "_initiator", { "_initiator.initiative_id = initiative.id AND _initiator.member_id = ?", app.session.member.id} )
     7.8 +    :left_join("initiator", "_initiator", { "_initiator.initiative_id = initiative.id AND _initiator.member_id = ? AND _initiator.accepted", app.session.member.id} )
     7.9      :left_join("supporter", "_supporter", { "_supporter.initiative_id = initiative.id AND _supporter.member_id = ?", app.session.member.id} )
    7.10    
    7.11      :add_field("(_initiator.member_id NOTNULL)", "is_initiator")
     8.1 --- a/app/main/issue/_show_head.lua	Tue Apr 20 10:19:37 2010 +0200
     8.2 +++ b/app/main/issue/_show_head.lua	Thu Apr 22 16:03:53 2010 +0200
     8.3 @@ -102,8 +102,11 @@
     8.4  
     8.5  --  ui.twitter("http://example.com/t" .. tostring(issue.id))
     8.6  
     8.7 +if config.public_access_issue_head and not app.session.member_id then
     8.8 +  config.public_access_issue_head(issue)
     8.9 +end
    8.10  
    8.11 -if issue.state == 'voting' and not direct_voter then
    8.12 +if app.session.member_id and issue.state == 'voting' and not direct_voter then
    8.13    ui.container{
    8.14      attr = { class = "voting_active_info" },
    8.15      content = function()
     9.1 --- a/app/main/member/_show.lua	Tue Apr 20 10:19:37 2010 +0200
     9.2 +++ b/app/main/member/_show.lua	Thu Apr 22 16:03:53 2010 +0200
     9.3 @@ -2,6 +2,7 @@
     9.4    module = "member",
     9.5    view = "show_tab",
     9.6    params = { 
     9.7 -    member = param.get("member", "table")
     9.8 +    member = param.get("member", "table"),
     9.9 +    show_as_homepage = param.get("show_as_homepage", atom.boolean)
    9.10    }
    9.11  }
    9.12 \ No newline at end of file
    10.1 --- a/app/main/member/show.lua	Tue Apr 20 10:19:37 2010 +0200
    10.2 +++ b/app/main/member/show.lua	Thu Apr 22 16:03:53 2010 +0200
    10.3 @@ -13,11 +13,12 @@
    10.4  
    10.5  slot.put_into("title", encode.html(_"Member '#{member}'":gsub("#{member}", member.name)))
    10.6  
    10.7 -if member.id ~= app.session.member.id then
    10.8 -  --TODO performance
    10.9 -  local contact = Contact:by_pk(app.session.member.id, member.id)
   10.10 -  if contact then
   10.11 -    slot.select("actions", function()
   10.12 +slot.select("actions", function()
   10.13 +  if member.id == app.session.member.id then
   10.14 +  else
   10.15 +    --TODO performance
   10.16 +    local contact = Contact:by_pk(app.session.member.id, member.id)
   10.17 +    if contact then
   10.18        ui.container{
   10.19          attr = { class = "interest" },
   10.20          content = _"You have saved this member as contact."
   10.21 @@ -38,9 +39,7 @@
   10.22            }
   10.23          }
   10.24        }
   10.25 -    end)
   10.26 -  else
   10.27 -    slot.select("actions", function()
   10.28 +    else
   10.29        ui.link{
   10.30          image   = { static = "icons/16/book_add.png" },
   10.31          text    = _"Add to my contacts",
   10.32 @@ -57,9 +56,9 @@
   10.33            }
   10.34          }
   10.35        }
   10.36 -    end)
   10.37 +    end
   10.38    end
   10.39 -end
   10.40 +end)
   10.41  
   10.42  slot.select("actions", function()
   10.43    ui.link{
    11.1 --- a/app/main/member/show_tab.lua	Tue Apr 20 10:19:37 2010 +0200
    11.2 +++ b/app/main/member/show_tab.lua	Thu Apr 22 16:03:53 2010 +0200
    11.3 @@ -1,3 +1,5 @@
    11.4 +local show_as_homepage = param.get("show_as_homepage", atom.boolean)
    11.5 +
    11.6  local member
    11.7  
    11.8  if request.get_json_request_slots() then
    11.9 @@ -6,84 +8,183 @@
   11.10    member = param.get("member", "table")
   11.11  end
   11.12  
   11.13 +local tabs = {
   11.14 +  module = "member",
   11.15 +  view = "show_tab",
   11.16 +  static_params = {
   11.17 +    member_id = member.id,
   11.18 +    show_as_homepage = show_as_homepage
   11.19 +  }
   11.20 +}
   11.21 +
   11.22 +if show_as_homepage and app.session.member_id == member.id then
   11.23 +  tabs[#tabs+1] = {
   11.24 +    class = "yellow",
   11.25 +    name = "motd",
   11.26 +    label = _"Message of the day",
   11.27 +    icon = { static = "icons/16/bell.png" },
   11.28 +    module = "index",
   11.29 +    view = "_motd",
   11.30 +    params = {}
   11.31 +  }
   11.32 +
   11.33 +  local selector = Area:new_selector()
   11.34 +    :reset_fields()
   11.35 +    :add_field("area.id", nil, { "grouped" })
   11.36 +    :add_field("area.name", nil, { "grouped" })
   11.37 +    :add_field("membership.member_id NOTNULL", "is_member", { "grouped" })
   11.38 +    :add_field("count(issue.id)", "issues_to_vote_count")
   11.39 +    :add_field("count(interest.member_id)", "interested_issues_to_vote_count")
   11.40 +    :add_field("count(interest.member_id NOTNULL OR interest.member_id NOTNULL)", "issues_to_vote_count_sum")
   11.41 +    :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL")
   11.42 +    :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id })
   11.43 +    :add_where{ "direct_voter.member_id ISNULL" }
   11.44 +    :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id })
   11.45 +    :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id })
   11.46 +
   11.47 +  local not_voted_areas = {}
   11.48 +  local issues_to_vote_count = 0
   11.49 +  for i, area in ipairs(selector:exec()) do
   11.50 +    if area.is_member or area.interested_issues_to_vote_count > 0 then
   11.51 +      not_voted_areas[#not_voted_areas+1] = area
   11.52 +    end
   11.53 +    issues_to_vote_count = issues_to_vote_count + area.issues_to_vote_count_sum
   11.54 +  end
   11.55 +
   11.56 +  if issues_to_vote_count > 0 then
   11.57 +    tabs[#tabs+1] = {
   11.58 +      class = "yellow",
   11.59 +      name = "not_voted_issues",
   11.60 +      label = _"Not voted issues" .. " (" .. tostring(issues_to_vote_count) .. ")",
   11.61 +      icon = { static = "icons/16/email_open.png" },
   11.62 +      module = "index",
   11.63 +      view = "_not_voted_issues",
   11.64 +      params = {
   11.65 +        areas = not_voted_areas
   11.66 +      }
   11.67 +    }
   11.68 +  end
   11.69 +
   11.70 +  local initiator_invites_selector = Initiative:new_selector()
   11.71 +    :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id")
   11.72 +    :join("initiator", nil, { "initiator.initiative_id = initiative.id AND initiator.member_id = ? AND initiator.accepted ISNULL", app.session.member.id })
   11.73 +    :add_where("_issue_state.closed ISNULL AND _issue_state.half_frozen ISNULL")
   11.74 +
   11.75 +  if initiator_invites_selector:count() > 0 then
   11.76 +    tabs[#tabs+1] = {
   11.77 +      class = "yellow",
   11.78 +      name = "initiator_invites",
   11.79 +      label = _"Initiator invites" .. " (" .. tostring(initiator_invites_selector:count()) .. ")",
   11.80 +      icon = { static = "icons/16/user_add.png" },
   11.81 +      module = "index",
   11.82 +      view = "_initiator_invites",
   11.83 +      params = {
   11.84 +        initiatives_selector = initiator_invites_selector
   11.85 +      }
   11.86 +    }
   11.87 +  end
   11.88 +
   11.89 +  local updated_drafts_selector = Initiative:new_selector()
   11.90 +    :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id AND _issue_state.closed ISNULL AND _issue_state.fully_frozen ISNULL")
   11.91 +    :join("current_draft", "_current_draft", "_current_draft.initiative_id = initiative.id")
   11.92 +    :join("supporter", "supporter", { "supporter.member_id = ? AND supporter.initiative_id = initiative.id AND supporter.draft_id < _current_draft.id", app.session.member_id })
   11.93 +
   11.94 +  if updated_drafts_selector:count() > 0 then
   11.95 +    tabs[#tabs+1] = {
   11.96 +      class = "yellow",
   11.97 +      name = "updated_drafts",
   11.98 +      label = _"Updated drafts" .. " (" .. tostring(updated_drafts_selector:count()) .. ")",
   11.99 +      icon = { static = "icons/16/script.png" },
  11.100 +      module = "index",
  11.101 +      view = "_updated_drafts",
  11.102 +      params = {
  11.103 +        initiatives_selector = updated_drafts_selector
  11.104 +      }
  11.105 +    }
  11.106 +  end
  11.107 +end
  11.108 +
  11.109 +tabs[#tabs+1] = {
  11.110 +  name = "profile",
  11.111 +  label = _"Profile",
  11.112 +  icon = { static = "icons/16/application_form.png" },
  11.113 +  module = "member",
  11.114 +  view = "_profile",
  11.115 +  params = { member = member },
  11.116 +}
  11.117 +
  11.118  local areas_selector = member:get_reference_selector("areas")
  11.119 +tabs[#tabs+1] = {
  11.120 +  name = "areas",
  11.121 +  label = _"Areas" .. " (" .. tostring(areas_selector:count()) .. ")",
  11.122 +  icon = { static = "icons/16/package.png" },
  11.123 +  module = "area",
  11.124 +  view = "_list",
  11.125 +  params = { areas_selector = areas_selector },
  11.126 +}
  11.127 +
  11.128  local issues_selector = member:get_reference_selector("issues")
  11.129 +tabs[#tabs+1] = {
  11.130 +  name = "issues",
  11.131 +  label = _"Issues" .. " (" .. tostring(issues_selector:count()) .. ")",
  11.132 +  icon = { static = "icons/16/folder.png" },
  11.133 +  module = "issue",
  11.134 +  view = "_list",
  11.135 +  params = { issues_selector = issues_selector },
  11.136 +}
  11.137 +
  11.138  local supported_initiatives_selector = member:get_reference_selector("supported_initiatives")
  11.139 +tabs[#tabs+1] = {
  11.140 +  name = "supported_initiatives",
  11.141 +  label = _"Supported initiatives" .. " (" .. tostring(supported_initiatives_selector:count()) .. ")",
  11.142 +  icon = { static = "icons/16/thumb_up_green.png" },
  11.143 +  module = "initiative",
  11.144 +  view = "_list",
  11.145 +  params = { initiatives_selector = supported_initiatives_selector },
  11.146 +}
  11.147 +
  11.148  local initiated_initiatives_selector = member:get_reference_selector("initiated_initiatives"):add_where("initiator.accepted = true")
  11.149 +tabs[#tabs+1] = {
  11.150 +  name = "initiatied_initiatives",
  11.151 +  label = _"Initiated initiatives" .. " (" .. tostring(initiated_initiatives_selector:count()) .. ")",
  11.152 +  icon = { static = "icons/16/user_edit.png" },
  11.153 +  module = "initiative",
  11.154 +  view = "_list",
  11.155 +  params = { initiatives_selector = initiated_initiatives_selector },
  11.156 +}
  11.157 +
  11.158  local incoming_delegations_selector = member:get_reference_selector("incoming_delegations")
  11.159    :left_join("issue", "_member_showtab_issue", "_member_showtab_issue.id = delegation.issue_id")
  11.160    :add_where("_member_showtab_issue.closed ISNULL")
  11.161 +tabs[#tabs+1] = {
  11.162 +  name = "incoming_delegations",
  11.163 +  label = _"Incoming delegations" .. " (" .. tostring(incoming_delegations_selector:count()) .. ")",
  11.164 +  icon = { static = "icons/16/table_go.png" },
  11.165 +  module = "delegation",
  11.166 +  view = "_list",
  11.167 +  params = { delegations_selector = incoming_delegations_selector, incoming = true },
  11.168 +}
  11.169 +
  11.170  local outgoing_delegations_selector = member:get_reference_selector("outgoing_delegations")
  11.171    :left_join("issue", "_member_showtab_issue", "_member_showtab_issue.id = delegation.issue_id")
  11.172    :add_where("_member_showtab_issue.closed ISNULL")
  11.173 -local contacts_selector = member:get_reference_selector("saved_members"):add_where("public")
  11.174 +tabs[#tabs+1] = {
  11.175 +  name = "outgoing_delegations",
  11.176 +  label = _"Outgoing delegations" .. " (" .. tostring(outgoing_delegations_selector:count()) .. ")",
  11.177 +  icon = { static = "icons/16/table_go.png" },
  11.178 +  module = "delegation",
  11.179 +  view = "_list",
  11.180 +  params = { delegations_selector = outgoing_delegations_selector, outgoing = true },
  11.181 +}
  11.182  
  11.183 -ui.tabs{
  11.184 +local contacts_selector = member:get_reference_selector("saved_members"):add_where("public")
  11.185 +tabs[#tabs+1] = {
  11.186 +  name = "contacts",
  11.187 +  label = _"Contacts" .. " (" .. tostring(contacts_selector:count()) .. ")",
  11.188 +  icon = { static = "icons/16/book_edit.png" },
  11.189    module = "member",
  11.190 -  view = "show_tab",
  11.191 -  static_params = { member_id = member.id },
  11.192 -  {
  11.193 -    name = "profile",
  11.194 -    label = _"Profile",
  11.195 -    icon = { static = "icons/16/application_form.png" },
  11.196 -    module = "member",
  11.197 -    view = "_profile",
  11.198 -    params = { member = member },
  11.199 -  },
  11.200 -  {
  11.201 -    name = "areas",
  11.202 -    label = _"Areas" .. " (" .. tostring(areas_selector:count()) .. ")",
  11.203 -    icon = { static = "icons/16/package.png" },
  11.204 -    module = "area",
  11.205 -    view = "_list",
  11.206 -    params = { areas_selector = areas_selector },
  11.207 -  },
  11.208 -  {
  11.209 -    name = "issues",
  11.210 -    label = _"Issues" .. " (" .. tostring(issues_selector:count()) .. ")",
  11.211 -    icon = { static = "icons/16/folder.png" },
  11.212 -    module = "issue",
  11.213 -    view = "_list",
  11.214 -    params = { issues_selector = issues_selector },
  11.215 -  },
  11.216 -  {
  11.217 -    name = "supported_initiatives",
  11.218 -    label = _"Supported initiatives" .. " (" .. tostring(supported_initiatives_selector:count()) .. ")",
  11.219 -    icon = { static = "icons/16/thumb_up_green.png" },
  11.220 -    module = "initiative",
  11.221 -    view = "_list",
  11.222 -    params = { initiatives_selector = supported_initiatives_selector },
  11.223 -  },
  11.224 -  {
  11.225 -    name = "initiatied_initiatives",
  11.226 -    label = _"Initiated initiatives" .. " (" .. tostring(initiated_initiatives_selector:count()) .. ")",
  11.227 -    icon = { static = "icons/16/user_edit.png" },
  11.228 -    module = "initiative",
  11.229 -    view = "_list",
  11.230 -    params = { initiatives_selector = initiated_initiatives_selector },
  11.231 -  },
  11.232 -  {
  11.233 -    name = "incoming_delegations",
  11.234 -    label = _"Incoming delegations" .. " (" .. tostring(incoming_delegations_selector:count()) .. ")",
  11.235 -    icon = { static = "icons/16/table_go.png" },
  11.236 -    module = "delegation",
  11.237 -    view = "_list",
  11.238 -    params = { delegations_selector = incoming_delegations_selector, incoming = true },
  11.239 -  },
  11.240 -  {
  11.241 -    name = "outgoing_delegations",
  11.242 -    label = _"Outgoing delegations" .. " (" .. tostring(outgoing_delegations_selector:count()) .. ")",
  11.243 -    icon = { static = "icons/16/table_go.png" },
  11.244 -    module = "delegation",
  11.245 -    view = "_list",
  11.246 -    params = { delegations_selector = outgoing_delegations_selector, outgoing = true },
  11.247 -  },
  11.248 -  {
  11.249 -    name = "contacts",
  11.250 -    label = _"Contacts" .. " (" .. tostring(contacts_selector:count()) .. ")",
  11.251 -    icon = { static = "icons/16/book_edit.png" },
  11.252 -    module = "member",
  11.253 -    view = "_list",
  11.254 -    params = { members_selector = contacts_selector },
  11.255 -  }
  11.256 +  view = "_list",
  11.257 +  params = { members_selector = contacts_selector },
  11.258  }
  11.259 +
  11.260 +ui.tabs(tabs)
  11.261 \ No newline at end of file
    12.1 --- a/config/default.lua	Tue Apr 20 10:19:37 2010 +0200
    12.2 +++ b/config/default.lua	Thu Apr 22 16:03:53 2010 +0200
    12.3 @@ -1,5 +1,5 @@
    12.4  config.app_name = "LiquidFeedback"
    12.5 -config.app_version = "beta16"
    12.6 +config.app_version = "beta17"
    12.7  
    12.8  config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)"
    12.9  
    13.1 --- a/env/ui/tabs.lua	Tue Apr 20 10:19:37 2010 +0200
    13.2 +++ b/env/ui/tabs.lua	Thu Apr 22 16:03:53 2010 +0200
    13.3 @@ -77,9 +77,9 @@
    13.4          attr = {
    13.5            name = "tab_" .. tab.name,
    13.6            class = (
    13.7 -            tab.name == current_tab and "ui_tabs_accordeon_head selected" or
    13.8 -            not current_tab and i == 1 and "ui_tabs_accordeon_head selected" or
    13.9 -            "ui_tabs_accordeon_head"
   13.10 +            tab.name == current_tab and "ui_tabs_accordeon_head selected" .. (tab.class and (" " .. tab.class) or "") or
   13.11 +            not current_tab and i == 1 and "ui_tabs_accordeon_head selected" .. (tab.class and (" " .. tab.class) or "")  or
   13.12 +            "ui_tabs_accordeon_head" .. (tab.class and (" " .. tab.class) or "") 
   13.13            ),
   13.14            id = "tab" .. unique_string .. "_head_" .. tab.name,
   13.15            onclick = onclick,
   13.16 @@ -105,7 +105,7 @@
   13.17        local expanded = active or not request.get_json_request_slots() and config.user_tab_mode == "accordeon_all_expanded" and not current_tabs_string
   13.18        ui.container{
   13.19          attr = {
   13.20 -          class = "ui_tabs_accordeon_content",
   13.21 +          class = "ui_tabs_accordeon_content" .. (tab.class and (" " .. tab.class) or ""),
   13.22            style = not expanded and "display: none;" or nil,
   13.23            id = "tab" .. unique_string .. "_content_" .. tab.name
   13.24          },
   13.25 @@ -198,9 +198,9 @@
   13.26                ui.link{
   13.27                  attr = { 
   13.28                    class = (
   13.29 -                    tab.name == current_tab and "selected" or
   13.30 -                    not current_tab and i == 1 and "selected" or
   13.31 -                    ""
   13.32 +                    tab.name == current_tab and "selected" .. (tab.class and (" " .. tab.class) or "") or
   13.33 +                    not current_tab and i == 1 and "selected" .. (tab.class and (" " .. tab.class) or "") or
   13.34 +                    "" .. (tab.class and (" " .. tab.class) or "")
   13.35                    )
   13.36                  },
   13.37                  module  = request.get_module(),
    14.1 Binary file static/icons/16/bell.png has changed
    15.1 --- a/static/style.css	Tue Apr 20 10:19:37 2010 +0200
    15.2 +++ b/static/style.css	Thu Apr 22 16:03:53 2010 +0200
    15.3 @@ -503,7 +503,32 @@
    15.4    font-size: 120%;
    15.5  }
    15.6  
    15.7 +.ui_tabs_links a.yellow {
    15.8 +  background-color: #fec;
    15.9 +  color: #000;
   15.10 +}
   15.11  
   15.12 +.ui_tabs_links a.yellow:hover {
   15.13 +  background-color: #edb;
   15.14 +}
   15.15 +
   15.16 +.ui_tabs_links a.yellow.selected {
   15.17 +  background-color: #654;
   15.18 +  color: #fff;
   15.19 +  text-decoration: none;
   15.20 +  padding: 1ex;
   15.21 +}
   15.22 +
   15.23 +.web20 .ui_tabs_accordeon_head.yellow {
   15.24 +  background-color: #fec;
   15.25 +  border-color: #b96;
   15.26 +  xpadding: 1ex;
   15.27 +  xmargin-bottom: 2ex;
   15.28 +}
   15.29 +
   15.30 +.web20 .ui_tabs_accordeon_content.yellow {
   15.31 +  border-color: #b96;
   15.32 +}
   15.33  
   15.34  /*************************************************************************
   15.35   * ui.filters
   15.36 @@ -955,7 +980,8 @@
   15.37  .draft_updated_info,
   15.38  .voting_active_info,
   15.39  .initiator_invite_info,
   15.40 -.motd {
   15.41 +.motd,
   15.42 +.public_access_issue_head {
   15.43    background-color: #fec;
   15.44    border: 1px solid #b96;
   15.45    padding: 1ex;

Impressum / About Us