liquid_feedback_frontend

annotate app/main/draft/new.lua @ 213:acf92c2d33f4

Seperated css and fixed issue delegations for second generation frontend
author bsw
date Thu Mar 03 21:26:35 2011 +0100 (2011-03-03)
parents fa55c8ded9fd
children 6e13a7da16b5
rev   line source
bsw/jbe@4 1 slot.put_into("title", _"Edit draft")
bsw/jbe@0 2
bsw@2 3 local initiative = Initiative:by_id(param.get("initiative_id"))
bsw/jbe@0 4
bsw/jbe@4 5 slot.select("actions", function()
bsw/jbe@4 6 ui.link{
bsw/jbe@4 7 content = function()
bsw/jbe@4 8 ui.image{ static = "icons/16/cancel.png" }
bsw/jbe@4 9 slot.put(_"Cancel")
bsw/jbe@4 10 end,
bsw/jbe@4 11 module = "initiative",
bsw/jbe@4 12 view = "show",
bsw/jbe@4 13 id = initiative.id
bsw/jbe@4 14 }
bsw/jbe@4 15 end)
bsw/jbe@4 16
bsw@95 17
bsw@95 18
bsw/jbe@0 19 ui.form{
bsw@2 20 record = initiative.current_draft,
bsw/jbe@0 21 attr = { class = "vertical" },
bsw/jbe@0 22 module = "draft",
bsw/jbe@0 23 action = "add",
bsw@2 24 params = { initiative_id = initiative.id },
bsw/jbe@0 25 routing = {
bsw@95 26 ok = {
bsw/jbe@0 27 mode = "redirect",
bsw/jbe@0 28 module = "initiative",
bsw/jbe@0 29 view = "show",
bsw@2 30 id = initiative.id
bsw/jbe@0 31 }
bsw/jbe@0 32 },
bsw/jbe@0 33 content = function()
bsw/jbe@0 34
bsw/jbe@0 35 ui.field.text{ label = _"Author", value = app.session.member.name, readonly = true }
bsw@95 36
bsw@95 37 if param.get("preview") then
bsw@95 38 ui.container{
bsw@95 39 attr = { class = "draft_content wiki" },
bsw@95 40 content = function()
bsw@95 41 slot.put(format.wiki_text(param.get("content"), param.get("formatting_engine")))
bsw@95 42 end
bsw@95 43 }
bsw@95 44 slot.put("<br />")
bsw@95 45 ui.submit{ text = _"Save" }
bsw@95 46 slot.put("<br />")
bsw@95 47 slot.put("<br />")
bsw@95 48 end
bsw@95 49 slot.put("<br />")
bsw@95 50
bsw@95 51
bsw/jbe@4 52 ui.field.select{
bsw/jbe@4 53 label = _"Wiki engine",
bsw/jbe@4 54 name = "formatting_engine",
bsw/jbe@4 55 foreign_records = {
bsw/jbe@4 56 { id = "rocketwiki", name = "RocketWiki" },
bsw/jbe@4 57 { id = "compat", name = _"Traditional wiki syntax" }
bsw/jbe@4 58 },
poelzi@133 59 attr = {id = "formatting_engine"},
bsw/jbe@4 60 foreign_id = "id",
bsw/jbe@4 61 foreign_name = "name"
bsw/jbe@4 62 }
poelzi@133 63 ui.tag{
poelzi@133 64 tag = "div",
poelzi@133 65 content = function()
poelzi@133 66 ui.tag{
poelzi@133 67 tag = "label",
poelzi@133 68 attr = { class = "ui_field_label" },
poelzi@133 69 content = function() slot.put("&nbsp;") end,
poelzi@133 70 }
poelzi@133 71 ui.tag{
poelzi@133 72 content = function()
poelzi@133 73 ui.link{
poelzi@133 74 text = _"Syntax help",
poelzi@133 75 module = "help",
poelzi@133 76 view = "show",
poelzi@133 77 id = "wikisyntax",
poelzi@133 78 attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
poelzi@133 79 }
poelzi@133 80 slot.put(" ")
poelzi@133 81 ui.link{
poelzi@133 82 text = _"(new window)",
poelzi@133 83 module = "help",
poelzi@133 84 view = "show",
poelzi@133 85 id = "wikisyntax",
poelzi@133 86 attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
poelzi@133 87 }
poelzi@133 88 end
poelzi@133 89 }
poelzi@133 90 end
poelzi@133 91 }
bsw@2 92 ui.field.text{
bsw@2 93 label = _"Content",
bsw@2 94 name = "content",
bsw@2 95 multiline = true,
bsw@95 96 attr = { style = "height: 50ex;" },
bsw@95 97 value = param.get("content")
bsw@2 98 }
bsw/jbe@0 99
bsw@95 100 ui.submit{ name = "preview", text = _"Preview" }
bsw/jbe@0 101 ui.submit{ text = _"Save" }
bsw/jbe@0 102 end
bsw/jbe@0 103 }

Impressum / About Us