liquid_feedback_frontend

annotate app/main/draft/new.lua @ 558:18e8de7a2b6a

Show notifications on start page as ulli list with links instead of tabs
author bsw
date Tue Jun 19 21:20:46 2012 +0200 (2012-06-19)
parents 6e13a7da16b5
children 99852ec8ee37
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@477 35 ui.field.text{ label = _"Unit", value = initiative.issue.area.unit.name, readonly = true }
bsw@477 36 ui.field.text{ label = _"Area", value = initiative.issue.area.name, readonly = true }
bsw@477 37 ui.field.text{ label = _"Policy", value = initiative.issue.policy.name, readonly = true }
bsw@477 38 ui.field.text{ label = _"Issue", value = _("Issue ##{id}", { id = initiative.issue.id } ), readonly = true }
bsw@477 39 slot.put("<br />")
bsw@477 40 ui.field.text{ label = _"Initiative", value = initiative.name, readonly = true }
bsw@95 41
bsw@95 42 if param.get("preview") then
bsw@95 43 ui.container{
bsw@95 44 attr = { class = "draft_content wiki" },
bsw@95 45 content = function()
bsw@95 46 slot.put(format.wiki_text(param.get("content"), param.get("formatting_engine")))
bsw@95 47 end
bsw@95 48 }
bsw@95 49 slot.put("<br />")
bsw@95 50 ui.submit{ text = _"Save" }
bsw@95 51 slot.put("<br />")
bsw@95 52 slot.put("<br />")
bsw@95 53 end
bsw@95 54 slot.put("<br />")
bsw@95 55
bsw@95 56
bsw/jbe@4 57 ui.field.select{
bsw/jbe@4 58 label = _"Wiki engine",
bsw/jbe@4 59 name = "formatting_engine",
bsw/jbe@4 60 foreign_records = {
bsw/jbe@4 61 { id = "rocketwiki", name = "RocketWiki" },
bsw/jbe@4 62 { id = "compat", name = _"Traditional wiki syntax" }
bsw/jbe@4 63 },
poelzi@133 64 attr = {id = "formatting_engine"},
bsw/jbe@4 65 foreign_id = "id",
bsw/jbe@4 66 foreign_name = "name"
bsw/jbe@4 67 }
poelzi@133 68 ui.tag{
poelzi@133 69 tag = "div",
poelzi@133 70 content = function()
poelzi@133 71 ui.tag{
poelzi@133 72 tag = "label",
poelzi@133 73 attr = { class = "ui_field_label" },
poelzi@133 74 content = function() slot.put("&nbsp;") end,
poelzi@133 75 }
poelzi@133 76 ui.tag{
poelzi@133 77 content = function()
poelzi@133 78 ui.link{
poelzi@133 79 text = _"Syntax help",
poelzi@133 80 module = "help",
poelzi@133 81 view = "show",
poelzi@133 82 id = "wikisyntax",
poelzi@133 83 attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
poelzi@133 84 }
poelzi@133 85 slot.put(" ")
poelzi@133 86 ui.link{
poelzi@133 87 text = _"(new window)",
poelzi@133 88 module = "help",
poelzi@133 89 view = "show",
poelzi@133 90 id = "wikisyntax",
poelzi@133 91 attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"}
poelzi@133 92 }
poelzi@133 93 end
poelzi@133 94 }
poelzi@133 95 end
poelzi@133 96 }
bsw@2 97 ui.field.text{
bsw@2 98 label = _"Content",
bsw@2 99 name = "content",
bsw@2 100 multiline = true,
bsw@95 101 attr = { style = "height: 50ex;" },
bsw@95 102 value = param.get("content")
bsw@2 103 }
bsw/jbe@0 104
bsw@95 105 ui.submit{ name = "preview", text = _"Preview" }
bsw/jbe@0 106 ui.submit{ text = _"Save" }
bsw/jbe@0 107 end
bsw/jbe@0 108 }

Impressum / About Us