liquid_feedback_frontend
view app/main/member/edit.lua @ 543:8b6bc2958126
merge
| author | bsw | 
|---|---|
| date | Sun May 27 23:05:46 2012 +0200 (2012-05-27) | 
| parents | 9e6a23f11f32 | 
| children | 418b590fa9ed | 
 line source
     1 slot.put_into("title", _"Edit my profile")
     3 slot.select("actions", function()
     4   ui.link{
     5     content = function()
     6         ui.image{ static = "icons/16/cancel.png" }
     7         slot.put(_"Cancel")
     8     end,
     9     module = "member",
    10     view = "settings"
    11   }
    12 end)
    14 util.help("member.edit", _"Edit my page")
    16 ui.form{
    17   record = app.session.member,
    18   attr = { class = "vertical" },
    19   module = "member",
    20   action = "update",
    21   routing = {
    22     ok = {
    23       mode = "redirect",
    24       module = "index",
    25       view = "index"
    26     }
    27   },
    28   content = function()
    29     ui.field.text{ label = _"Identification", name = "identification", readonly = true }
    30     ui.field.text{ label = _"Organizational unit", name = "organizational_unit", readonly = config.locked_profile_fields.organizational_unit }
    31     ui.field.text{ label = _"Internal posts", name = "internal_posts", readonly = config.locked_profile_fields.internal_posts }
    32     ui.field.text{ label = _"Real name", name = "realname", readonly = config.locked_profile_fields.realname }
    33     ui.field.text{ label = _"Birthday" .. " YYYY-MM-DD ", name = "birthday", attr = { id = "profile_birthday" }, readonly = config.locked_profile_fields.birthday }
    34     ui.script{ static = "gregor.js/gregor.js" }
    35     util.gregor("profile_birthday", "document.getElementById('timeline_search_date').form.submit();")
    36     ui.field.text{ label = _"Address", name = "address", multiline = true, readonly = config.locked_profile_fields.address }
    37     ui.field.text{ label = _"email", name = "email", readonly = config.locked_profile_fields.email }
    38     ui.field.text{ label = _"xmpp", name = "xmpp_address", readonly = config.locked_profile_fields.xmpp_address }
    39     ui.field.text{ label = _"Website", name = "website", readonly = config.locked_profile_fields.website }
    40     ui.field.text{ label = _"Phone", name = "phone", readonly = config.locked_profile_fields.phone }
    41     ui.field.text{ label = _"Mobile phone", name = "mobile_phone", readonly = config.locked_profile_fields.mobile_phone }
    42     ui.field.text{ label = _"Profession", name = "profession", readonly = config.locked_profile_fields.profession }
    43     ui.field.text{ label = _"External memberships", name = "external_memberships", multiline = true, readonly = config.locked_profile_fields.external_memberships }
    44     ui.field.text{ label = _"External posts", name = "external_posts", multiline = true, readonly = config.locked_profile_fields.external_posts }
    46     ui.field.select{
    47       label = _"Wiki engine for statement",
    48       name = "formatting_engine",
    49       foreign_records = {
    50         { id = "rocketwiki", name = "RocketWiki" },
    51         { id = "compat", name = _"Traditional wiki syntax" }
    52       },
    53       attr = {id = "formatting_engine"},
    54       foreign_id = "id",
    55       foreign_name = "name",
    56       value = param.get("formatting_engine")
    57     }
    58     ui.tag{
    59       tag = "div",
    60       content = function()
    61         ui.tag{
    62           tag = "label",
    63           attr = { class = "ui_field_label" },
    64           content = function() slot.put(" ") end,
    65         }
    66         ui.tag{
    67           content = function()
    68             ui.link{
    69               text = _"Syntax help",
    70               module = "help",
    71               view = "show",
    72               id = "wikisyntax",
    73               attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
    74             }
    75             slot.put(" ")
    76             ui.link{
    77               text = _"(new window)",
    78               module = "help",
    79               view = "show",
    80               id = "wikisyntax",
    81               attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
    82             }
    83           end
    84         }
    85       end
    86     }
    87     ui.field.text{
    88       label = _"Statement",
    89       name = "statement",
    90       multiline = true, 
    91       attr = { style = "height: 50ex;" },
    92       value = param.get("statement")
    93     }
    96     ui.submit{ value = _"Save" }
    97   end
    98 }
