liquid_feedback_frontend

diff app/main/index/index.lua @ 61:f77ca23f9ebd

merge
author jbe
date Thu Apr 22 16:03:53 2010 +0200 (2010-04-22)
parents 4f39f0a0d5b5
children 7d0f4721d2f3
line diff
     1.1 --- a/app/main/index/index.lua	Tue Apr 20 10:19:37 2010 +0200
     1.2 +++ b/app/main/index/index.lua	Thu Apr 22 16:03:53 2010 +0200
     1.3 @@ -55,7 +55,6 @@
     1.4        module = "member",
     1.5        view = "edit"
     1.6      }
     1.7 -  
     1.8      ui.link{
     1.9        content = function()
    1.10            ui.image{ static = "icons/16/user_gray.png" }
    1.11 @@ -64,12 +63,10 @@
    1.12        module = "member",
    1.13        view = "edit_images"
    1.14      }
    1.15 -  
    1.16      execute.view{
    1.17        module = "delegation",
    1.18        view = "_show_box"
    1.19      }
    1.20 -  
    1.21      ui.link{
    1.22        content = function()
    1.23            ui.image{ static = "icons/16/wrench.png" }
    1.24 @@ -78,7 +75,6 @@
    1.25        module = "member",
    1.26        view = "settings"
    1.27      }
    1.28 -  
    1.29      if config.download_dir then
    1.30        ui.link{
    1.31          content = function()
    1.32 @@ -92,133 +88,13 @@
    1.33    end
    1.34  end)
    1.35  
    1.36 -local lang = locale.get("lang")
    1.37 -local basepath = request.get_app_basepath() 
    1.38 -local file_name = basepath .. "/locale/motd/" .. lang .. ".txt"
    1.39 -local file = io.open(file_name)
    1.40 -if file ~= nil then
    1.41 -  local help_text = file:read("*a")
    1.42 -  if #help_text > 0 then
    1.43 -    ui.container{
    1.44 -      attr = { class = "motd wiki" },
    1.45 -      content = function()
    1.46 -        slot.put(format.wiki_text(help_text))
    1.47 -      end
    1.48 -    }
    1.49 -  end
    1.50 -end
    1.51 -
    1.52 -
    1.53  util.help("index.index", _"Home")
    1.54  
    1.55 -local areas = {}
    1.56 -if app.session.member then
    1.57 -  local selector = Area:new_selector()
    1.58 -    :reset_fields()
    1.59 -    :add_field("area.id", nil, { "grouped" })
    1.60 -    :add_field("area.name", nil, { "grouped" })
    1.61 -    :add_field("membership.member_id NOTNULL", "is_member", { "grouped" })
    1.62 -    :add_field("count(issue.id)", "issues_to_vote_count")
    1.63 -    :add_field("count(interest.member_id)", "interested_issues_to_vote_count")
    1.64 -    :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL")
    1.65 -    :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id })
    1.66 -    :add_where{ "direct_voter.member_id ISNULL" }
    1.67 -    :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id })
    1.68 -    :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id })
    1.69 -  
    1.70 -  for i, area in ipairs(selector:exec()) do
    1.71 -    if area.is_member or area.interested_issues_to_vote_count > 0 then
    1.72 -      areas[#areas+1] = area
    1.73 -    end
    1.74 -  end
    1.75 -end
    1.76 -
    1.77 -if #areas > 0 then
    1.78 -  ui.container{
    1.79 -    attr = { style = "font-weight: bold;" },
    1.80 -    content = _"Current votings in areas you are member of and issues you are interested in:"
    1.81 +execute.view{
    1.82 +  module = "member",
    1.83 +  view = "_show",
    1.84 +  params = {
    1.85 +    member = app.session.member,
    1.86 +    show_as_homepage = true
    1.87    }
    1.88 -  
    1.89 -  ui.list{
    1.90 -    records = areas,
    1.91 -    columns = {
    1.92 -      {
    1.93 -        name = "name"
    1.94 -      },
    1.95 -      {
    1.96 -        content = function(record)
    1.97 -          if record.is_member and record.issues_to_vote_count > 0 then
    1.98 -            ui.link{
    1.99 -              content = function()
   1.100 -                if record.issues_to_vote_count > 1 then
   1.101 -                  slot.put(_("#{issues_to_vote_count} issue(s)", { issues_to_vote_count = record.issues_to_vote_count }))
   1.102 -                else
   1.103 -                  slot.put(_("One issue"))
   1.104 -                end
   1.105 -              end,
   1.106 -              module = "area",
   1.107 -              view = "show",
   1.108 -              id = record.id,
   1.109 -              params = { 
   1.110 -                filter = "frozen",
   1.111 -                filter_voting = "not_voted"
   1.112 -              }
   1.113 -            }
   1.114 -          else
   1.115 -            slot.put(_"Not a member")
   1.116 -          end
   1.117 -        end
   1.118 -      },
   1.119 -      {
   1.120 -        content = function(record)
   1.121 -          if record.interested_issues_to_vote_count > 0 then
   1.122 -            ui.link{
   1.123 -              content = function()
   1.124 -                if record.interested_issues_to_vote_count > 1 then
   1.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 }))
   1.126 -                else
   1.127 -                  slot.put(_"One issue you are interested in")
   1.128 -                end
   1.129 -              end,
   1.130 -              module = "area",
   1.131 -              view = "show",
   1.132 -              id = record.id,
   1.133 -              params = { 
   1.134 -                filter = "frozen",
   1.135 -                filter_interest = "my",
   1.136 -                filter_voting = "not_voted"
   1.137 -              }
   1.138 -            }
   1.139 -          end
   1.140 -        end
   1.141 -      },
   1.142 -    }
   1.143 -  }
   1.144 -end
   1.145 -
   1.146 -local initiatives_selector = Initiative:new_selector()
   1.147 -  :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id")
   1.148 -  :join("initiator", nil, { "initiator.initiative_id = initiative.id AND initiator.member_id = ? AND initiator.accepted ISNULL", app.session.member.id })
   1.149 -  :add_where("_issue_state.closed ISNULL AND _issue_state.half_frozen ISNULL")
   1.150 -
   1.151 -if initiatives_selector:count() > 0 then
   1.152 -  ui.container{
   1.153 -    attr = { style = "font-weight: bold;" },
   1.154 -    content = _"Initiatives that invited you to become initiator:"
   1.155 -  }
   1.156 -
   1.157 -  execute.view{
   1.158 -    module = "initiative",
   1.159 -    view = "_list",
   1.160 -    params = { initiatives_selector = initiatives_selector }
   1.161 -  }
   1.162 -end
   1.163 -
   1.164 -
   1.165 -if app.session.member then
   1.166 -  execute.view{
   1.167 -    module = "member",
   1.168 -    view = "_show",
   1.169 -    params = { member = app.session.member }
   1.170 -  }
   1.171 -end
   1.172 +}

Impressum / About Us