liquid_feedback_frontend

diff app/main/draft/new.lua @ 95:6a12fb7e4963

Suggestion API, draft preview, word based diff, multiple fixes
- Added suggestion API
- Initiative API: Drafts optionally delivered as rendered html fragment
- Initiative API: Fixed wrong output of revoked timestamp when using JSON
- Preview added for initiative drafts
- Improved (word based) diff added
- Improved suggestion list
- Added missing sorting of initiative in vote list
- Filter state for member page initiative lists
- Fixed wrong status output in member history
- Fixed wrongly closed div in layout
author bsw
date Mon Aug 30 21:52:19 2010 +0200 (2010-08-30)
parents 80c215dbf076
children fa55c8ded9fd
line diff
     1.1 --- a/app/main/draft/new.lua	Thu Aug 19 15:37:51 2010 +0200
     1.2 +++ b/app/main/draft/new.lua	Mon Aug 30 21:52:19 2010 +0200
     1.3 @@ -14,6 +14,8 @@
     1.4    }
     1.5  end)
     1.6  
     1.7 +
     1.8 +
     1.9  ui.form{
    1.10    record = initiative.current_draft,
    1.11    attr = { class = "vertical" },
    1.12 @@ -21,7 +23,7 @@
    1.13    action = "add",
    1.14    params = { initiative_id = initiative.id },
    1.15    routing = {
    1.16 -    default = {
    1.17 +    ok = {
    1.18        mode = "redirect",
    1.19        module = "initiative",
    1.20        view = "show",
    1.21 @@ -31,6 +33,22 @@
    1.22    content = function()
    1.23  
    1.24      ui.field.text{ label = _"Author", value = app.session.member.name, readonly = true }
    1.25 +
    1.26 +    if param.get("preview") then
    1.27 +      ui.container{
    1.28 +        attr = { class = "draft_content wiki" },
    1.29 +        content = function()
    1.30 +          slot.put(format.wiki_text(param.get("content"), param.get("formatting_engine")))
    1.31 +        end
    1.32 +      }
    1.33 +      slot.put("<br />")
    1.34 +      ui.submit{ text = _"Save" }
    1.35 +      slot.put("<br />")
    1.36 +      slot.put("<br />")
    1.37 +    end
    1.38 +    slot.put("<br />")
    1.39 +
    1.40 +
    1.41      ui.field.select{
    1.42        label = _"Wiki engine",
    1.43        name = "formatting_engine",
    1.44 @@ -45,9 +63,11 @@
    1.45        label = _"Content",
    1.46        name = "content",
    1.47        multiline = true,
    1.48 -      attr = { style = "height: 50ex;" }
    1.49 +      attr = { style = "height: 50ex;" },
    1.50 +      value = param.get("content")
    1.51     }
    1.52  
    1.53 +    ui.submit{ name = "preview", text = _"Preview" }
    1.54      ui.submit{ text = _"Save" }
    1.55    end
    1.56  }

Impressum / About Us