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/jbe@1309
|
28 ui.container{ content = _"All fields are optional. Please enter only data which should be published." }
|
bsw/jbe@1309
|
29
|
bsw/jbe@1309
|
30 for i, field in ipairs(config.member_profile_fields) do
|
bsw/jbe@1309
|
31 ui.container{
|
bsw/jbe@1309
|
32 attr = { class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label" },
|
bsw/jbe@1309
|
33 content = function()
|
bsw/jbe@1309
|
34 ui.tag{ tag = "input", attr = { class = "mdl-textfield__input", name = field.id, id = "input_" .. field.id, readonly = config.locked_profile_fields[field.id], value = profile and profile.profile and profile.profile[field.id] or nil } }
|
bsw/jbe@1309
|
35 ui.tag{ tag = "label", attr = { class = "mdl-textfield__label", ["for"] = "input_" .. field.id }, content = field.name }
|
bsw/jbe@1309
|
36 end }
|
bsw/jbe@1309
|
37 slot.put("<br />")
|
bsw/jbe@1309
|
38 end
|
bsw@280
|
39
|
bsw/jbe@1309
|
40 if not config.enforce_formatting_engine then
|
bsw/jbe@1309
|
41 ui.field.select{
|
bsw/jbe@1309
|
42 label = _"Wiki engine for statement",
|
bsw/jbe@1309
|
43 name = "formatting_engine",
|
bsw/jbe@1309
|
44 foreign_records = config.formatting_engines,
|
bsw/jbe@1309
|
45 attr = {id = "formatting_engine"},
|
bsw/jbe@1309
|
46 foreign_id = "id",
|
bsw/jbe@1309
|
47 foreign_name = "name",
|
bsw/jbe@1309
|
48 value = param.get("formatting_engine")
|
bsw@1045
|
49 }
|
bsw@1045
|
50 ui.tag{
|
bsw/jbe@1309
|
51 tag = "div",
|
bsw@1045
|
52 content = function()
|
bsw/jbe@1309
|
53 ui.tag{
|
bsw/jbe@1309
|
54 tag = "label",
|
bsw/jbe@1309
|
55 attr = { class = "ui_field_label" },
|
bsw/jbe@1309
|
56 content = function() slot.put(" ") end,
|
bsw@1045
|
57 }
|
bsw/jbe@1309
|
58 ui.tag{
|
bsw/jbe@1309
|
59 content = function()
|
bsw/jbe@1309
|
60 ui.link{
|
bsw/jbe@1309
|
61 text = _"Syntax help",
|
bsw/jbe@1309
|
62 module = "help",
|
bsw/jbe@1309
|
63 view = "show",
|
bsw/jbe@1309
|
64 id = "wikisyntax",
|
bsw/jbe@1309
|
65 attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
|
bsw/jbe@1309
|
66 }
|
bsw/jbe@1309
|
67 slot.put(" ")
|
bsw/jbe@1309
|
68 ui.link{
|
bsw/jbe@1309
|
69 text = _"(new window)",
|
bsw/jbe@1309
|
70 module = "help",
|
bsw/jbe@1309
|
71 view = "show",
|
bsw/jbe@1309
|
72 id = "wikisyntax",
|
bsw/jbe@1309
|
73 attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
|
bsw/jbe@1309
|
74 }
|
bsw/jbe@1309
|
75 end
|
bsw@1045
|
76 }
|
bsw@1045
|
77 end
|
bsw@1045
|
78 }
|
bsw@1045
|
79 end
|
bsw/jbe@1309
|
80 ui.field.text{
|
bsw/jbe@1309
|
81 label = _"Statement",
|
bsw/jbe@1309
|
82 name = "statement",
|
bsw/jbe@1309
|
83 multiline = true,
|
bsw/jbe@1309
|
84 attr = { style = "height: 50ex;" },
|
bsw/jbe@1309
|
85 value = param.get("statement")
|
bsw/jbe@1309
|
86 }
|
bsw/jbe@1309
|
87 slot.put("<br />")
|
bsw/jbe@1309
|
88 ui.container{ attr = { class = "actions" }, content = function()
|
bsw/jbe@1309
|
89 ui.tag{
|
bsw/jbe@1309
|
90 tag = "input",
|
bsw/jbe@1309
|
91 attr = {
|
bsw/jbe@1309
|
92 type = "submit",
|
bsw/jbe@1309
|
93 class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored mdl-js-ripple-effect",
|
bsw/jbe@1309
|
94 value = _"publish profile data"
|
bsw/jbe@1309
|
95 },
|
bsw/jbe@1309
|
96 content = ""
|
bsw/jbe@1309
|
97 }
|
bsw/jbe@1309
|
98 slot.put(" ")
|
bsw/jbe@1309
|
99 ui.link{
|
bsw/jbe@1309
|
100 attr = {
|
bsw/jbe@1309
|
101 class = "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect",
|
bsw/jbe@1309
|
102 },
|
bsw/jbe@1309
|
103 content = _"cancel",
|
bsw/jbe@1309
|
104 module = "member", view = "show", id = app.session.member.id
|
bsw/jbe@1309
|
105 }
|
bsw/jbe@1309
|
106 end }
|
bsw/jbe@1309
|
107 end
|
bsw@280
|
108 }
|
bsw/jbe@1309
|
109
|
bsw/jbe@1309
|
110 end }
|
bsw/jbe@1309
|
111 end }
|
bsw/jbe@1309
|
112 end }
|
bsw/jbe@1309
|
113
|
bsw/jbe@1309
|
114 ui.cell_sidebar{ content = function()
|
bsw/jbe@1309
|
115 execute.view {
|
bsw/jbe@1309
|
116 module = "member", view = "_sidebar_whatcanido", params = {
|
bsw/jbe@1309
|
117 member = app.session.member
|
bsw/jbe@1309
|
118 }
|
bsw/jbe@1309
|
119 }
|
bsw/jbe@1309
|
120 end }
|
bsw/jbe@1309
|
121
|
bsw/jbe@1309
|
122 end }
|