bsw@1045: ui.titleMember(_"Edit your profile data") bsw/jbe@0: bsw@1045: execute.view { bsw@1045: module = "member", view = "_sidebar_whatcanido", params = { bsw@1045: member = app.session.member bsw@1045: } bsw@1045: } bsw/jbe@4: bsw/jbe@0: ui.form{ bsw/jbe@0: record = app.session.member, bsw/jbe@0: attr = { class = "vertical" }, bsw/jbe@0: module = "member", bsw/jbe@0: action = "update", bsw/jbe@0: routing = { bsw/jbe@0: ok = { bsw/jbe@0: mode = "redirect", bsw@564: module = "member", bsw@564: view = "show", bsw@564: id = app.session.member_id bsw/jbe@0: } bsw/jbe@0: }, bsw/jbe@0: content = function() bsw@1045: bsw@1045: ui.section( function() bsw@1045: bsw@1045: ui.sectionHead( function() bsw@1045: ui.heading{ level = 1, content = _"Edit your profile data" } bsw@1045: end ) bsw@1045: bsw@1045: ui.sectionRow( _"All fields are optional. Please enter only data which should be published." ) bsw@1045: bsw@1045: ui.sectionRow( function() bsw@1045: bsw@1045: ui.field.text{ label = _"Organizational unit", name = "organizational_unit", readonly = config.locked_profile_fields.organizational_unit } bsw@1045: ui.field.text{ label = _"Internal posts", name = "internal_posts", readonly = config.locked_profile_fields.internal_posts } bsw@1045: ui.field.text{ label = _"Real name", name = "realname", readonly = config.locked_profile_fields.realname } bsw@1045: ui.field.text{ label = _"Birthday" .. " YYYY-MM-DD ", name = "birthday", attr = { id = "profile_birthday" }, readonly = config.locked_profile_fields.birthday } bsw@1045: ui.script{ static = "gregor.js/gregor.js" } bsw@1045: util.gregor("profile_birthday", "document.getElementById('timeline_search_date').form.submit();") bsw@1045: ui.field.text{ label = _"Address", name = "address", multiline = true, readonly = config.locked_profile_fields.address } bsw@1045: ui.field.text{ label = _"email", name = "email", readonly = config.locked_profile_fields.email } bsw@1045: ui.field.text{ label = _"xmpp", name = "xmpp_address", readonly = config.locked_profile_fields.xmpp_address } bsw@1045: ui.field.text{ label = _"Website", name = "website", readonly = config.locked_profile_fields.website } bsw@1045: ui.field.text{ label = _"Phone", name = "phone", readonly = config.locked_profile_fields.phone } bsw@1045: ui.field.text{ label = _"Mobile phone", name = "mobile_phone", readonly = config.locked_profile_fields.mobile_phone } bsw@1045: ui.field.text{ label = _"Profession", name = "profession", readonly = config.locked_profile_fields.profession } bsw@1045: ui.field.text{ label = _"External memberships", name = "external_memberships", multiline = true, readonly = config.locked_profile_fields.external_memberships } bsw@1045: ui.field.text{ label = _"External posts", name = "external_posts", multiline = true, readonly = config.locked_profile_fields.external_posts } bsw@280: bsw@1045: if not config.enforce_formatting_engine then bsw@1045: ui.field.select{ bsw@1045: label = _"Wiki engine for statement", bsw@1045: name = "formatting_engine", bsw@1045: foreign_records = config.formatting_engines, bsw@1045: attr = {id = "formatting_engine"}, bsw@1045: foreign_id = "id", bsw@1045: foreign_name = "name", bsw@1045: value = param.get("formatting_engine") bsw@1045: } bsw@1045: ui.tag{ bsw@1045: tag = "div", bsw@1045: content = function() bsw@1045: ui.tag{ bsw@1045: tag = "label", bsw@1045: attr = { class = "ui_field_label" }, bsw@1045: content = function() slot.put(" ") end, bsw@1045: } bsw@1045: ui.tag{ bsw@1045: content = function() bsw@1045: ui.link{ bsw@1045: text = _"Syntax help", bsw@1045: module = "help", bsw@1045: view = "show", bsw@1045: id = "wikisyntax", bsw@1045: attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"} bsw@1045: } bsw@1045: slot.put(" ") bsw@1045: ui.link{ bsw@1045: text = _"(new window)", bsw@1045: module = "help", bsw@1045: view = "show", bsw@1045: id = "wikisyntax", bsw@1045: attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"} bsw@1045: } bsw@1045: end bsw@1045: } bsw@1045: end bsw@1045: } bsw@1045: end bsw@1045: ui.field.text{ bsw@1045: label = _"Statement", bsw@1045: name = "statement", bsw@1045: multiline = true, bsw@1045: attr = { style = "height: 50ex;" }, bsw@1045: value = param.get("statement") bsw@280: } bsw@1045: slot.put("
") bsw@1045: ui.container{ attr = { class = "actions" }, content = function() bsw@1045: ui.tag{ bsw@1045: tag = "input", bsw@1045: attr = { bsw@1045: type = "submit", bsw@1045: class = "btn btn-default", bsw@1045: value = _"publish profile data" bsw@1045: }, bsw@1045: content = "" bsw@1045: } bsw@1045: slot.put("


") bsw@1045: ui.link{ bsw@1045: content = _"cancel", bsw@1045: module = "member", view = "show", id = app.session.member.id bsw@1045: } bsw@1045: end } bsw@1045: end ) bsw@1045: end ) bsw/jbe@0: end bsw/jbe@0: }