liquid_feedback_frontend
annotate app/main/member/developer_settings.lua @ 124:f740026b1518
add initiator support in delegation
if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Mon Sep 20 20:32:04 2010 +0200 (2010-09-20) |
parents | 733f65c0c0a0 |
children | 976d493106a1 |
rev | line source |
---|---|
bsw@75 | 1 slot.put_into("title", _"Developer settings") |
bsw@10 | 2 |
bsw@10 | 3 slot.select("actions", function() |
bsw@10 | 4 ui.link{ |
bsw@10 | 5 content = function() |
bsw@10 | 6 ui.image{ static = "icons/16/cancel.png" } |
bsw@10 | 7 slot.put(_"Cancel") |
bsw@10 | 8 end, |
bsw@10 | 9 module = "member", |
bsw@10 | 10 view = "settings" |
bsw@10 | 11 } |
bsw@10 | 12 end) |
bsw@10 | 13 |
bsw@51 | 14 local setting_key = "liquidfeedback_frontend_developer_features" |
bsw@51 | 15 local setting = Setting:by_pk(app.session.member.id, setting_key) |
bsw@51 | 16 |
bsw@51 | 17 if setting then |
bsw@51 | 18 ui.form{ |
bsw@51 | 19 attr = { class = "vertical" }, |
bsw@51 | 20 module = "member", |
bsw@51 | 21 action = "update_stylesheet_url", |
bsw@51 | 22 routing = { |
bsw@51 | 23 ok = { |
bsw@51 | 24 mode = "redirect", |
bsw@51 | 25 module = "index", |
bsw@51 | 26 view = "index" |
bsw@51 | 27 } |
bsw@51 | 28 }, |
bsw@51 | 29 content = function() |
bsw@51 | 30 local setting_key = "liquidfeedback_frontend_stylesheet_url" |
bsw@51 | 31 local setting = Setting:by_pk(app.session.member.id, setting_key) |
bsw@51 | 32 local value = setting and setting.value |
bsw@51 | 33 ui.field.text{ |
bsw@51 | 34 label = _"Stylesheet URL", |
bsw@51 | 35 name = "stylesheet_url", |
bsw@51 | 36 value = value |
bsw@51 | 37 } |
bsw@51 | 38 ui.submit{ value = _"Set URL" } |
bsw@51 | 39 end |
bsw@10 | 40 } |
bsw@51 | 41 end |
bsw@51 | 42 |
bsw@51 | 43 local setting_key = "liquidfeedback_frontend_api_key" |
bsw@51 | 44 local setting = Setting:by_pk(app.session.member.id, setting_key) |
bsw@51 | 45 local api_key |
bsw@51 | 46 if setting then |
bsw@51 | 47 api_key = setting.value |
bsw@51 | 48 end |
bsw@51 | 49 |
bsw@51 | 50 ui.heading{ content = _"Generate / change API key" } |
bsw@51 | 51 util.help("member.developer_settings.api_key", _"API key") |
bsw@51 | 52 |
bsw@51 | 53 if api_key then |
bsw@51 | 54 slot.put(_"Your API key:") |
bsw@51 | 55 slot.put(" ") |
bsw@51 | 56 slot.put("<tt>", api_key, "</tt>") |
bsw@51 | 57 slot.put(" ") |
bsw@51 | 58 ui.link{ |
bsw@51 | 59 text = _"Change API key", |
bsw@51 | 60 module = "member", |
bsw@51 | 61 action = "update_api_key", |
bsw@51 | 62 routing = { |
bsw@51 | 63 default = { |
bsw@51 | 64 mode = "redirect", |
bsw@51 | 65 module = "member", |
bsw@51 | 66 view = "developer_settings" |
bsw@51 | 67 } |
bsw@51 | 68 } |
bsw@10 | 69 } |
bsw@51 | 70 slot.put(" ") |
bsw@51 | 71 ui.link{ |
bsw@51 | 72 text = _"Delete API key", |
bsw@51 | 73 module = "member", |
bsw@51 | 74 action = "update_api_key", |
bsw@51 | 75 params = { delete = true }, |
bsw@51 | 76 routing = { |
bsw@51 | 77 default = { |
bsw@51 | 78 mode = "redirect", |
bsw@51 | 79 module = "member", |
bsw@51 | 80 view = "developer_settings", |
bsw@51 | 81 } |
bsw@51 | 82 } |
bsw@51 | 83 } |
bsw@51 | 84 else |
bsw@51 | 85 slot.put(_"Currently no API key is set.") |
bsw@51 | 86 slot.put(" ") |
bsw@51 | 87 ui.link{ |
bsw@51 | 88 text = _"Generate API key", |
bsw@51 | 89 module = "member", |
bsw@51 | 90 action = "update_api_key", |
bsw@51 | 91 routing = { |
bsw@51 | 92 default = { |
bsw@51 | 93 mode = "redirect", |
bsw@51 | 94 module = "member", |
bsw@51 | 95 view = "developer_settings" |
bsw@51 | 96 } |
bsw@51 | 97 } |
bsw@51 | 98 } |
bsw@10 | 99 end |