liquid_feedback_frontend
view app/main/draft/new.lua @ 113:e0b091e2a0f3
setting <title> tag. fallback: take class="title"-contents
| author | jorges | 
|---|---|
| date | Mon Sep 20 01:18:03 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 }
