liquid_feedback_frontend

diff app/main/initiative/_show.lua @ 313:56dc44366c38

More color changes again...
author bsw
date Mon Feb 27 18:06:11 2012 +0100 (2012-02-27)
parents c587d8762e62
children 4608babc79f2
line diff
     1.1 --- a/app/main/initiative/_show.lua	Mon Feb 27 16:19:11 2012 +0100
     1.2 +++ b/app/main/initiative/_show.lua	Mon Feb 27 18:06:11 2012 +0100
     1.3 @@ -32,87 +32,98 @@
     1.4      attr = { class = "initiative_name" },
     1.5      content = _("Initiative i#{id}: #{name}", { id = initiative.id, name = initiative.name })
     1.6    }
     1.7 -end )
     1.8  
     1.9 -if app.session.member_id or config.public_access == "pseudonym" or config.public_access == "full" then
    1.10 -  ui.tag{
    1.11 -    attr = { class = "initiator_names" },
    1.12 -    content = function()
    1.13 -      for i, initiator in ipairs(initiators) do
    1.14 -        slot.put(" ")
    1.15 -        ui.link{
    1.16 -          content = function ()
    1.17 -            execute.view{
    1.18 -              module = "member_image",
    1.19 -              view = "_show",
    1.20 -              params = {
    1.21 -                member = initiator,
    1.22 -                image_type = "avatar",
    1.23 -                show_dummy = true,
    1.24 -                class = "micro_avatar",
    1.25 -                popup_text = text
    1.26 +  if app.session.member_id or config.public_access == "pseudonym" or config.public_access == "full" then
    1.27 +    ui.tag{
    1.28 +      attr = { class = "initiator_names" },
    1.29 +      content = function()
    1.30 +        for i, initiator in ipairs(initiators) do
    1.31 +          slot.put(" ")
    1.32 +          ui.link{
    1.33 +            content = function ()
    1.34 +              execute.view{
    1.35 +                module = "member_image",
    1.36 +                view = "_show",
    1.37 +                params = {
    1.38 +                  member = initiator,
    1.39 +                  image_type = "avatar",
    1.40 +                  show_dummy = true,
    1.41 +                  class = "micro_avatar",
    1.42 +                  popup_text = text
    1.43 +                }
    1.44                }
    1.45 -            }
    1.46 -          end,
    1.47 -          module = "member", view = "show", id = initiator.id
    1.48 -        }
    1.49 -        slot.put(" ")
    1.50 -        ui.link{
    1.51 -          text = initiator.name,
    1.52 -          module = "member", view = "show", id = initiator.id
    1.53 -        }
    1.54 -        if not initiator.accepted then
    1.55 -          ui.tag{ attr = { title = _"Not accepted yet" }, content = "?" }
    1.56 +            end,
    1.57 +            module = "member", view = "show", id = initiator.id
    1.58 +          }
    1.59 +          slot.put(" ")
    1.60 +          ui.link{
    1.61 +            text = initiator.name,
    1.62 +            module = "member", view = "show", id = initiator.id
    1.63 +          }
    1.64 +          if not initiator.accepted then
    1.65 +            ui.tag{ attr = { title = _"Not accepted yet" }, content = "?" }
    1.66 +          end
    1.67          end
    1.68        end
    1.69 -    end
    1.70 -  }
    1.71 -end
    1.72 +    }
    1.73 +  end
    1.74  
    1.75 -if initiator and initiator.accepted and not initiative.issue.fully_frozen and not initiative.issue.closed and not initiative.revoked then
    1.76 -  slot.put(" · ")
    1.77 -  ui.link{
    1.78 -    attr = { class = "action" },
    1.79 -    content = function()
    1.80 -      slot.put(_"Invite initiator")
    1.81 -    end,
    1.82 -    module = "initiative",
    1.83 -    view = "add_initiator",
    1.84 -    params = { initiative_id = initiative.id }
    1.85 -  }
    1.86 -  if #initiators > 1 then
    1.87 +  if initiator and initiator.accepted and not initiative.issue.fully_frozen and not initiative.issue.closed and not initiative.revoked then
    1.88      slot.put(" · ")
    1.89      ui.link{
    1.90 +      attr = { class = "action" },
    1.91        content = function()
    1.92 -        slot.put(_"Remove initiator")
    1.93 +        slot.put(_"Invite initiator")
    1.94        end,
    1.95        module = "initiative",
    1.96 -      view = "remove_initiator",
    1.97 +      view = "add_initiator",
    1.98        params = { initiative_id = initiative.id }
    1.99      }
   1.100 +    if #initiators > 1 then
   1.101 +      slot.put(" · ")
   1.102 +      ui.link{
   1.103 +        content = function()
   1.104 +          slot.put(_"Remove initiator")
   1.105 +        end,
   1.106 +        module = "initiative",
   1.107 +        view = "remove_initiator",
   1.108 +        params = { initiative_id = initiative.id }
   1.109 +      }
   1.110 +    end
   1.111 +  end
   1.112 +  if initiator and initiator.accepted == false then
   1.113 +      slot.put(" · ")
   1.114 +      ui.link{
   1.115 +        text   = _"Cancel refuse of invitation",
   1.116 +        module = "initiative",
   1.117 +        action = "remove_initiator",
   1.118 +        params = {
   1.119 +          initiative_id = initiative.id,
   1.120 +          member_id = app.session.member.id
   1.121 +        },
   1.122 +        routing = {
   1.123 +          ok = {
   1.124 +            mode = "redirect",
   1.125 +            module = "initiative",
   1.126 +            view = "show",
   1.127 +            id = initiative.id
   1.128 +          }
   1.129 +        }
   1.130 +      }
   1.131 +  end
   1.132 +  if app.session.member_id then
   1.133 +    execute.view{
   1.134 +      module = "supporter",
   1.135 +      view = "_show_box",
   1.136 +      params = {
   1.137 +        initiative = initiative
   1.138 +      }
   1.139 +    }
   1.140    end
   1.141 -end
   1.142 -if initiator and initiator.accepted == false then
   1.143 -    slot.put(" · ")
   1.144 -    ui.link{
   1.145 -      text   = _"Cancel refuse of invitation",
   1.146 -      module = "initiative",
   1.147 -      action = "remove_initiator",
   1.148 -      params = {
   1.149 -        initiative_id = initiative.id,
   1.150 -        member_id = app.session.member.id
   1.151 -      },
   1.152 -      routing = {
   1.153 -        ok = {
   1.154 -          mode = "redirect",
   1.155 -          module = "initiative",
   1.156 -          view = "show",
   1.157 -          id = initiative.id
   1.158 -        }
   1.159 -      }
   1.160 -    }
   1.161 -end
   1.162 -  
   1.163 +
   1.164 +end )
   1.165 +
   1.166 +
   1.167  util.help("initiative.show")
   1.168  
   1.169  
   1.170 @@ -234,16 +245,6 @@
   1.171  end
   1.172  
   1.173  
   1.174 -if app.session.member_id then
   1.175 -  execute.view{
   1.176 -    module = "supporter",
   1.177 -    view = "_show_box",
   1.178 -    params = {
   1.179 -      initiative = initiative
   1.180 -    }
   1.181 -  }
   1.182 -end
   1.183 -
   1.184  local supporter
   1.185  
   1.186  if app.session.member_id then

Impressum / About Us