liquid_feedback_frontend

diff app/main/membership/_show_box.lua @ 0:3bfb2fcf7ab9

Version alpha1
author bsw/jbe
date Wed Nov 18 12:00:00 2009 +0100 (2009-11-18)
parents
children 5c601807d397
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/membership/_show_box.lua	Wed Nov 18 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,69 @@
     1.4 +local area = param.get("area", "table")
     1.5 +
     1.6 +slot.select("interest", function()
     1.7 +  local membership = Membership:by_pk(area.id, app.session.member.id)
     1.8 +
     1.9 +  ui.container{
    1.10 +    attr = { 
    1.11 +      class = "head",
    1.12 +      onclick = "document.getElementById('interest_content').style.display = 'block';"
    1.13 +    },
    1.14 +    content = function()
    1.15 +      if membership then
    1.16 +        ui.field.text{ value = _"You are member. [more]" }
    1.17 +      else
    1.18 +        ui.field.text{ value = _"You are not a member. [more]" }
    1.19 +      end
    1.20 +    end
    1.21 +  }
    1.22 +
    1.23 +  ui.container{
    1.24 +    attr = { class = "content", id = "interest_content" },
    1.25 +    content = function()
    1.26 +      if membership then
    1.27 +        ui.link{
    1.28 +          content = _"Remove my membership",
    1.29 +          module = "membership",
    1.30 +          action = "update",
    1.31 +          params = { area_id = area.id, delete = true },
    1.32 +          routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    1.33 +        }
    1.34 +        if membership.autoreject then
    1.35 +          ui.field.text{ value = _"Autoreject is on." }
    1.36 +          ui.link{
    1.37 +            content = _"Remove autoreject",
    1.38 +            module = "membership",
    1.39 +            action = "update",
    1.40 +            params = { area_id = area.id, autoreject = false },
    1.41 +            routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    1.42 +          }
    1.43 +        else
    1.44 +          ui.field.text{ value = _"Autoreject is off." }
    1.45 +          ui.link{
    1.46 +            content = _"Set autoreject",
    1.47 +            module = "membership",
    1.48 +            action = "update",
    1.49 +            params = { area_id = area.id, autoreject = true },
    1.50 +            routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    1.51 +          }
    1.52 +        end
    1.53 +      else
    1.54 +        ui.link{
    1.55 +          content = _"Add my membership to this area",
    1.56 +          module = "membership",
    1.57 +          action = "update",
    1.58 +          params = { area_id = area.id },
    1.59 +          routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    1.60 +        }
    1.61 +      end
    1.62 +        ui.container{
    1.63 +          attr = {
    1.64 +            class = "head",
    1.65 +            style = "cursor: pointer;",
    1.66 +            onclick = "document.getElementById('interest_content').style.display = 'none';"
    1.67 +          },
    1.68 +          content = _"Click here to close."
    1.69 +        }
    1.70 +    end
    1.71 +  }
    1.72 +end)

Impressum / About Us