liquid_feedback_frontend

diff app/main/draft/list.lua @ 725:344e5fdce8c9

Fixed public search, made draft history available again
author bsw
date Thu Jun 28 13:52:42 2012 +0200 (2012-06-28)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/draft/list.lua	Thu Jun 28 13:52:42 2012 +0200
     1.3 @@ -0,0 +1,61 @@
     1.4 +local initiative = Initiative:by_id(param.get("initiative_id", atom.number))
     1.5 +
     1.6 +execute.view{
     1.7 +  module = "initiative", view = "_show", params = {
     1.8 +    initiative = initiative, show_as_head = true
     1.9 +  }
    1.10 +}
    1.11 +
    1.12 +ui.link{
    1.13 +  text = _"Back to initiative",
    1.14 +  module = "initiative", view = "show", id = initiative.id
    1.15 +}
    1.16 +
    1.17 +slot.put("<br />")
    1.18 +slot.put("<br />")
    1.19 +
    1.20 +ui.form{
    1.21 +  method = "get",
    1.22 +  module = "draft",
    1.23 +  view = "diff",
    1.24 +  content = function()
    1.25 +    ui.list{
    1.26 +      records = initiative.drafts,
    1.27 +      columns = {
    1.28 +        {
    1.29 +          label = _"Created at",
    1.30 +          content = function(record)
    1.31 +            ui.field.text{ readonly = true, value = format.timestamp(record.created) }
    1.32 +          end
    1.33 +        },
    1.34 +        {
    1.35 +          label = _"Author",
    1.36 +          content = function(record)
    1.37 +            if record.author then
    1.38 +              return record.author:ui_field_text()
    1.39 +            end
    1.40 +          end
    1.41 +        },
    1.42 +        {
    1.43 +          content = function(record)
    1.44 +            ui.link{
    1.45 +              attr = { class = "action" },
    1.46 +              text = _"Show",
    1.47 +              module = "draft",
    1.48 +              view = "show",
    1.49 +              id = record.id
    1.50 +            }
    1.51 +          end
    1.52 +        },
    1.53 +        {
    1.54 +          label = _"Compare",
    1.55 +          content = function(record)
    1.56 +            slot.put('<input type="radio" name="old_draft_id" value="' .. tostring(record.id) .. '">')
    1.57 +            slot.put('<input type="radio" name="new_draft_id" value="' .. tostring(record.id) .. '">')
    1.58 +          end
    1.59 +        }
    1.60 +      }
    1.61 +    }
    1.62 +    ui.submit{ text = _"Compare" }
    1.63 +  end
    1.64 +}

Impressum / About Us