liquid_feedback_frontend

diff app/main/initiative/_show.lua @ 525:63d6549cc00b

Delegation chain preview improved, better visualisation of current context, code cleanup
author bsw
date Fri May 18 19:07:07 2012 +0200 (2012-05-18)
parents 01cf3c50cbee
children 4cee33ad5e16
line diff
     1.1 --- a/app/main/initiative/_show.lua	Tue Apr 17 00:07:04 2012 +0200
     1.2 +++ b/app/main/initiative/_show.lua	Fri May 18 19:07:07 2012 +0200
     1.3 @@ -14,121 +14,125 @@
     1.4  
     1.5  
     1.6  local initiatives_selector = initiative.issue:get_reference_selector("initiatives")
     1.7 -slot.select("initiatives_list", function()
     1.8 +slot.select("head", function()
     1.9    execute.view{
    1.10 -    module = "initiative",
    1.11 -    view = "_list",
    1.12 +    module = "issue",
    1.13 +    view = "_show",
    1.14      params = {
    1.15        issue = initiative.issue,
    1.16 -      initiatives_selector = initiatives_selector,
    1.17 -      no_sort = true, highlight_initiative = initiative, limit = 3
    1.18 +      initiative_limit = 3
    1.19      }
    1.20    }
    1.21  end)
    1.22  
    1.23 -slot.select("initiative_head", function()
    1.24 +ui.container{ attr = { class = "initiative_head" }, content = function()
    1.25  
    1.26    ui.container{
    1.27 -    attr = { class = "initiative_name" },
    1.28 +    attr = { class = "title" },
    1.29      content = _("Initiative i#{id}: #{name}", { id = initiative.id, name = initiative.name })
    1.30    }
    1.31  
    1.32 -  if app.session.member_id or config.public_access == "pseudonym" or config.public_access == "full" then
    1.33 -    ui.tag{
    1.34 -      attr = { class = "initiator_names" },
    1.35 -      content = function()
    1.36 -        for i, initiator in ipairs(initiators) do
    1.37 -          slot.put(" ")
    1.38 -          if app.session.member_id then
    1.39 +  ui.container{ attr = { class = "content" }, content = function()
    1.40 +    if app.session.member_id or config.public_access == "pseudonym" or config.public_access == "full" then
    1.41 +      ui.tag{
    1.42 +        attr = { class = "initiator_names" },
    1.43 +        content = function()
    1.44 +          for i, initiator in ipairs(initiators) do
    1.45 +            slot.put(" ")
    1.46 +            if app.session.member_id then
    1.47 +              ui.link{
    1.48 +                content = function ()
    1.49 +                  execute.view{
    1.50 +                    module = "member_image",
    1.51 +                    view = "_show",
    1.52 +                    params = {
    1.53 +                      member = initiator,
    1.54 +                      image_type = "avatar",
    1.55 +                      show_dummy = true,
    1.56 +                      class = "micro_avatar",
    1.57 +                      popup_text = text
    1.58 +                    }
    1.59 +                  }
    1.60 +                end,
    1.61 +                module = "member", view = "show", id = initiator.id
    1.62 +              }
    1.63 +              slot.put(" ")
    1.64 +            end
    1.65              ui.link{
    1.66 -              content = function ()
    1.67 -                execute.view{
    1.68 -                  module = "member_image",
    1.69 -                  view = "_show",
    1.70 -                  params = {
    1.71 -                    member = initiator,
    1.72 -                    image_type = "avatar",
    1.73 -                    show_dummy = true,
    1.74 -                    class = "micro_avatar",
    1.75 -                    popup_text = text
    1.76 -                  }
    1.77 -                }
    1.78 -              end,
    1.79 +              text = initiator.name,
    1.80                module = "member", view = "show", id = initiator.id
    1.81              }
    1.82 -            slot.put(" ")
    1.83 -          end
    1.84 -          ui.link{
    1.85 -            text = initiator.name,
    1.86 -            module = "member", view = "show", id = initiator.id
    1.87 -          }
    1.88 -          if not initiator.accepted then
    1.89 -            ui.tag{ attr = { title = _"Not accepted yet" }, content = "?" }
    1.90 +            if not initiator.accepted then
    1.91 +              ui.tag{ attr = { title = _"Not accepted yet" }, content = "?" }
    1.92 +            end
    1.93            end
    1.94          end
    1.95 -      end
    1.96 -    }
    1.97 -  end
    1.98 -
    1.99 -  if initiator and initiator.accepted and not initiative.issue.fully_frozen and not initiative.issue.closed and not initiative.revoked then
   1.100 -    slot.put(" · ")
   1.101 -    ui.link{
   1.102 -      attr = { class = "action" },
   1.103 -      content = function()
   1.104 -        slot.put(_"Invite initiator")
   1.105 -      end,
   1.106 -      module = "initiative",
   1.107 -      view = "add_initiator",
   1.108 -      params = { initiative_id = initiative.id }
   1.109 -    }
   1.110 -    if #initiators > 1 then
   1.111 -      slot.put(" · ")
   1.112 -      ui.link{
   1.113 -        content = function()
   1.114 -          slot.put(_"Remove initiator")
   1.115 -        end,
   1.116 -        module = "initiative",
   1.117 -        view = "remove_initiator",
   1.118 -        params = { initiative_id = initiative.id }
   1.119        }
   1.120      end
   1.121 -  end
   1.122 -  if initiator and initiator.accepted == false then
   1.123 +
   1.124 +    if initiator and initiator.accepted and not initiative.issue.fully_frozen and not initiative.issue.closed and not initiative.revoked then
   1.125        slot.put(" · ")
   1.126        ui.link{
   1.127 -        text   = _"Cancel refuse of invitation",
   1.128 +        attr = { class = "action" },
   1.129 +        content = function()
   1.130 +          slot.put(_"Invite initiator")
   1.131 +        end,
   1.132          module = "initiative",
   1.133 -        action = "remove_initiator",
   1.134 -        params = {
   1.135 -          initiative_id = initiative.id,
   1.136 -          member_id = app.session.member.id
   1.137 -        },
   1.138 -        routing = {
   1.139 -          ok = {
   1.140 -            mode = "redirect",
   1.141 -            module = "initiative",
   1.142 -            view = "show",
   1.143 -            id = initiative.id
   1.144 +        view = "add_initiator",
   1.145 +        params = { initiative_id = initiative.id }
   1.146 +      }
   1.147 +      if #initiators > 1 then
   1.148 +        slot.put(" · ")
   1.149 +        ui.link{
   1.150 +          content = function()
   1.151 +            slot.put(_"Remove initiator")
   1.152 +          end,
   1.153 +          module = "initiative",
   1.154 +          view = "remove_initiator",
   1.155 +          params = { initiative_id = initiative.id }
   1.156 +        }
   1.157 +      end
   1.158 +    end
   1.159 +    if initiator and initiator.accepted == false then
   1.160 +        slot.put(" · ")
   1.161 +        ui.link{
   1.162 +          text   = _"Cancel refuse of invitation",
   1.163 +          module = "initiative",
   1.164 +          action = "remove_initiator",
   1.165 +          params = {
   1.166 +            initiative_id = initiative.id,
   1.167 +            member_id = app.session.member.id
   1.168 +          },
   1.169 +          routing = {
   1.170 +            ok = {
   1.171 +              mode = "redirect",
   1.172 +              module = "initiative",
   1.173 +              view = "show",
   1.174 +              id = initiative.id
   1.175 +            }
   1.176            }
   1.177          }
   1.178 +    end
   1.179 +  end }
   1.180 +  ui.container{ attr = { class = "content" }, content = function()
   1.181 +    if app.session.member_id then
   1.182 +      execute.view{
   1.183 +        module = "supporter",
   1.184 +        view = "_show_box",
   1.185 +        params = {
   1.186 +          initiative = initiative
   1.187 +        }
   1.188        }
   1.189 -  end
   1.190 -  if app.session.member_id then
   1.191 -    execute.view{
   1.192 -      module = "supporter",
   1.193 -      view = "_show_box",
   1.194 -      params = {
   1.195 -        initiative = initiative
   1.196 -      }
   1.197 -    }
   1.198 -  end
   1.199 +    end
   1.200  
   1.201 -end )
   1.202 +  end }
   1.203 +
   1.204 +end }
   1.205  
   1.206  
   1.207  util.help("initiative.show")
   1.208  
   1.209 -slot.select("initiative_head", function()
   1.210 +--slot.select("initiative_head", function()
   1.211  
   1.212    if initiative.issue.ranks_available and initiative.admitted then
   1.213      local class = initiative.winner and "admitted_info" or "not_admitted_info"
   1.214 @@ -199,7 +203,7 @@
   1.215        content = _("This issue has been cancelled. It failed the quorum of #{quorum}.", { quorum = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) })
   1.216      }
   1.217    end
   1.218 -end)
   1.219 +--end)
   1.220  
   1.221  if initiator and initiator.accepted == nil and not initiative.issue.half_frozen and not initiative.issue.closed then
   1.222    ui.container{

Impressum / About Us