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