liquid_feedback_frontend
view app/main/draft/new.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 | 6a12fb7e4963 |
children | fa55c8ded9fd |
line source
1 slot.put_into("title", _"Edit draft")
3 local initiative = Initiative:by_id(param.get("initiative_id"))
5 slot.select("actions", function()
6 ui.link{
7 content = function()
8 ui.image{ static = "icons/16/cancel.png" }
9 slot.put(_"Cancel")
10 end,
11 module = "initiative",
12 view = "show",
13 id = initiative.id
14 }
15 end)
19 ui.form{
20 record = initiative.current_draft,
21 attr = { class = "vertical" },
22 module = "draft",
23 action = "add",
24 params = { initiative_id = initiative.id },
25 routing = {
26 ok = {
27 mode = "redirect",
28 module = "initiative",
29 view = "show",
30 id = initiative.id
31 }
32 },
33 content = function()
35 ui.field.text{ label = _"Author", value = app.session.member.name, readonly = true }
37 if param.get("preview") then
38 ui.container{
39 attr = { class = "draft_content wiki" },
40 content = function()
41 slot.put(format.wiki_text(param.get("content"), param.get("formatting_engine")))
42 end
43 }
44 slot.put("<br />")
45 ui.submit{ text = _"Save" }
46 slot.put("<br />")
47 slot.put("<br />")
48 end
49 slot.put("<br />")
52 ui.field.select{
53 label = _"Wiki engine",
54 name = "formatting_engine",
55 foreign_records = {
56 { id = "rocketwiki", name = "RocketWiki" },
57 { id = "compat", name = _"Traditional wiki syntax" }
58 },
59 foreign_id = "id",
60 foreign_name = "name"
61 }
62 ui.field.text{
63 label = _"Content",
64 name = "content",
65 multiline = true,
66 attr = { style = "height: 50ex;" },
67 value = param.get("content")
68 }
70 ui.submit{ name = "preview", text = _"Preview" }
71 ui.submit{ text = _"Save" }
72 end
73 }