| rev | 
   line source | 
| 
bsw@1045
 | 
     1 ui.titleMember(_"Edit your profile data")
 | 
| 
bsw/jbe@0
 | 
     2 
 | 
| 
bsw/jbe@1309
 | 
     3 local profile = app.session.member.profile
 | 
| 
bsw/jbe@1309
 | 
     4 
 | 
| 
bsw/jbe@1309
 | 
     5 ui.grid{ content = function()
 | 
| 
bsw/jbe@1309
 | 
     6   ui.cell_main{ content = function()
 | 
| 
bsw/jbe@4
 | 
     7 
 | 
| 
bsw/jbe@1309
 | 
     8     ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
     9       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    10         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Edit your profile data" }
 | 
| 
bsw/jbe@1309
 | 
    11       end }
 | 
| 
bsw/jbe@1309
 | 
    12       ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    13         ui.form{
 | 
| 
bsw/jbe@1309
 | 
    14           record = profile,
 | 
| 
bsw/jbe@1309
 | 
    15           attr = { class = "vertical" },
 | 
| 
bsw/jbe@1309
 | 
    16           module = "member",
 | 
| 
bsw/jbe@1309
 | 
    17           action = "update",
 | 
| 
bsw/jbe@1309
 | 
    18           routing = {
 | 
| 
bsw/jbe@1309
 | 
    19             ok = {
 | 
| 
bsw/jbe@1309
 | 
    20               mode = "redirect",
 | 
| 
bsw/jbe@1309
 | 
    21               module = "member",
 | 
| 
bsw/jbe@1309
 | 
    22               view = "show",
 | 
| 
bsw/jbe@1309
 | 
    23               id = app.session.member_id
 | 
| 
bsw/jbe@1309
 | 
    24             }
 | 
| 
bsw/jbe@1309
 | 
    25           },
 | 
| 
bsw/jbe@1309
 | 
    26           content = function()
 | 
| 
bsw/jbe@1309
 | 
    27           
 | 
| 
bsw@1489
 | 
    28 --            ui.container{ content = _"All fields are optional. Please enter only data which should be published." }
 | 
| 
bsw/jbe@1309
 | 
    29             
 | 
| 
bsw@1488
 | 
    30             if config.member_profile_fields then
 | 
| 
bsw@1488
 | 
    31               for i, field in ipairs(config.member_profile_fields) do
 | 
| 
bsw@1488
 | 
    32                 ui.container{
 | 
| 
bsw@1488
 | 
    33                   attr = { class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label" },
 | 
| 
bsw@1488
 | 
    34                   content = function()
 | 
| 
bsw@1817
 | 
    35                     ui.tag{ tag = "input", attr = { class = "mdl-textfield__input", name = field.id, id = "input_" .. field.id, readonly = field.validate_func and "readonly" or nil, value = profile and profile.profile and profile.profile[field.id] or nil } }
 | 
| 
bsw@1488
 | 
    36                     ui.tag{ tag = "label", attr = { class = "mdl-textfield__label", ["for"] = "input_" .. field.id }, content = field.name }
 | 
| 
bsw@1488
 | 
    37                 end }
 | 
| 
bsw@1488
 | 
    38                 slot.put("<br />")
 | 
| 
bsw@1488
 | 
    39               end
 | 
| 
bsw/jbe@1309
 | 
    40             end
 | 
| 
bsw/jbe@1309
 | 
    41             ui.field.text{
 | 
| 
bsw/jbe@1309
 | 
    42               label = _"Statement",
 | 
| 
bsw/jbe@1309
 | 
    43               name = "statement",
 | 
| 
bsw/jbe@1309
 | 
    44               multiline = true, 
 | 
| 
bsw/jbe@1309
 | 
    45               attr = { style = "height: 50ex;" },
 | 
| 
bsw/jbe@1309
 | 
    46               value = param.get("statement")
 | 
| 
bsw/jbe@1309
 | 
    47             }
 | 
| 
bsw/jbe@1309
 | 
    48             slot.put("<br />")
 | 
| 
bsw/jbe@1309
 | 
    49             ui.container{ attr = { class = "actions" }, content = function()
 | 
| 
bsw/jbe@1309
 | 
    50               ui.tag{
 | 
| 
bsw/jbe@1309
 | 
    51                 tag = "input",
 | 
| 
bsw/jbe@1309
 | 
    52                 attr = {
 | 
| 
bsw/jbe@1309
 | 
    53                   type = "submit",
 | 
| 
bsw/jbe@1309
 | 
    54                   class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored mdl-js-ripple-effect",
 | 
| 
bsw/jbe@1309
 | 
    55                   value = _"publish profile data"
 | 
| 
bsw/jbe@1309
 | 
    56                 },
 | 
| 
bsw/jbe@1309
 | 
    57                 content = ""
 | 
| 
bsw/jbe@1309
 | 
    58               }
 | 
| 
bsw/jbe@1309
 | 
    59               slot.put("   ")
 | 
| 
bsw@1644
 | 
    60               ui.link {
 | 
| 
bsw@1644
 | 
    61                 attr = { class = "mdl-button mdl-js-button" },
 | 
| 
bsw@1644
 | 
    62                 module = "member", view = "show", id = app.session.member_id,
 | 
| 
bsw@1644
 | 
    63                 content = _"Cancel"
 | 
| 
bsw/jbe@1309
 | 
    64               }
 | 
| 
bsw/jbe@1309
 | 
    65             end }
 | 
| 
bsw/jbe@1309
 | 
    66           end
 | 
| 
bsw@280
 | 
    67         }
 | 
| 
bsw/jbe@1309
 | 
    68 
 | 
| 
bsw/jbe@1309
 | 
    69       end }
 | 
| 
bsw/jbe@1309
 | 
    70     end }
 | 
| 
bsw/jbe@1309
 | 
    71   end }
 | 
| 
bsw/jbe@1309
 | 
    72   
 | 
| 
bsw/jbe@1309
 | 
    73   ui.cell_sidebar{ content = function()
 | 
| 
bsw/jbe@1309
 | 
    74     execute.view {
 | 
| 
bsw/jbe@1309
 | 
    75       module = "member", view = "_sidebar_whatcanido", params = {
 | 
| 
bsw/jbe@1309
 | 
    76         member = app.session.member
 | 
| 
bsw/jbe@1309
 | 
    77       }
 | 
| 
bsw/jbe@1309
 | 
    78     }
 | 
| 
bsw/jbe@1309
 | 
    79   end }
 | 
| 
bsw/jbe@1309
 | 
    80 
 | 
| 
bsw/jbe@1309
 | 
    81 end }
 |