liquid_feedback_frontend

diff app/main/membership/_show_box.lua @ 4:80c215dbf076

Version alpha5

Many optical changes and improved usability

Support for different wiki-formatting-engines

Help system
author bsw/jbe
date Thu Dec 10 12:00:00 2009 +0100 (2009-12-10)
parents 5c601807d397
children 00d1004545f1
line diff
     1.1 --- a/app/main/membership/_show_box.lua	Mon Nov 30 12:00:00 2009 +0100
     1.2 +++ b/app/main/membership/_show_box.lua	Thu Dec 10 12:00:00 2009 +0100
     1.3 @@ -1,34 +1,40 @@
     1.4  local area = param.get("area", "table")
     1.5  
     1.6 +local membership = Membership:by_pk(area.id, app.session.member.id)
     1.7 +
     1.8  slot.select("interest", function()
     1.9 -  local membership = Membership:by_pk(area.id, app.session.member.id)
    1.10  
    1.11 -  ui.container{
    1.12 -    attr = { 
    1.13 -      class = "head",
    1.14 -      onclick = "document.getElementById('membership_content').style.display = 'block';"
    1.15 -    },
    1.16 -    content = function()
    1.17 -      if membership then
    1.18 -        ui.field.text{ value = _"You are member. [more]" }
    1.19 -      else
    1.20 -        ui.field.text{ value = _"You are not a member. [more]" }
    1.21 +  if membership then
    1.22 +  
    1.23 +    ui.container{
    1.24 +      attr = { 
    1.25 +        class = "head head_active",
    1.26 +        onclick = "document.getElementById('membership_content').style.display = 'block';"
    1.27 +      },
    1.28 +      content = function()
    1.29 +        ui.image{
    1.30 +          static = "icons/16/user_green.png"
    1.31 +        }
    1.32 +        slot.put(_"You are member")
    1.33 +        ui.image{
    1.34 +          static = "icons/16/dropdown.png"
    1.35 +        }
    1.36        end
    1.37 -    end
    1.38 -  }
    1.39 -
    1.40 -  ui.container{
    1.41 -    attr = { class = "content", id = "membership_content" },
    1.42 -    content = function()
    1.43 -      ui.container{
    1.44 -        attr = {
    1.45 -          class = "close",
    1.46 -          style = "cursor: pointer;",
    1.47 -          onclick = "document.getElementById('membership_content').style.display = 'none';"
    1.48 -        },
    1.49 -        content = _"X"
    1.50 -      }
    1.51 -      if membership then
    1.52 +    }
    1.53 +    
    1.54 +    ui.container{
    1.55 +      attr = { class = "content", id = "membership_content" },
    1.56 +      content = function()
    1.57 +        ui.container{
    1.58 +          attr = {
    1.59 +            class = "close",
    1.60 +            style = "cursor: pointer;",
    1.61 +            onclick = "document.getElementById('membership_content').style.display = 'none';"
    1.62 +          },
    1.63 +          content = function()
    1.64 +            ui.image{ static = "icons/16/cross.png" }
    1.65 +          end
    1.66 +        }
    1.67          ui.link{
    1.68            content = _"Remove my membership",
    1.69            module = "membership",
    1.70 @@ -55,15 +61,26 @@
    1.71              routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    1.72            }
    1.73          end
    1.74 -      else
    1.75 -        ui.link{
    1.76 -          content = _"Add my membership to this area",
    1.77 -          module = "membership",
    1.78 -          action = "update",
    1.79 -          params = { area_id = area.id },
    1.80 -          routing = { default = { mode = "redirect", module = "area", view = "show", id = area.id } }
    1.81 +      end
    1.82 +    }
    1.83 +  else
    1.84 +    ui.link{
    1.85 +    content = function()
    1.86 +      ui.image{ static = "icons/16/user_add.png" }
    1.87 +      slot.put(_"Become a member")
    1.88 +    end,
    1.89 +      module = "membership",
    1.90 +      action = "update",
    1.91 +      params = { area_id = area.id },
    1.92 +      routing = {
    1.93 +        default = {
    1.94 +          mode = "redirect",
    1.95 +          module = "area",
    1.96 +          view = "show",
    1.97 +          id = area.id
    1.98          }
    1.99 -      end
   1.100 -    end
   1.101 -  }
   1.102 +      }
   1.103 +    }
   1.104 +  end
   1.105 +
   1.106  end)

Impressum / About Us