liquid_feedback_frontend
view app/main/draft/_list.lua @ 915:60ab8e410e78
Backed out changeset 17d1856de31e
| author | bsw | 
|---|---|
| date | Mon Sep 24 15:48:43 2012 +0200 (2012-09-24) | 
| parents | de6b80867eb7 | 
| children | 
 line source
     1 ui.form{
     2   method = "get",
     3   module = "draft",
     4   view = "diff",
     5   content = function()
     6     ui.list{
     7       records = param.get("drafts", "table"),
     8       columns = {
     9         {
    10           label = _"Created at",
    11           content = function(record)
    12             ui.field.text{ readonly = true, value = format.timestamp(record.created) }
    13           end
    14         },
    15         {
    16           label = _"Author",
    17           content = function(record)
    18             if record.author then
    19               return record.author:ui_field_text()
    20             end
    21           end
    22         },
    23         {
    24           content = function(record)
    25             ui.link{
    26               attr = { class = "action" },
    27               text = _"Show",
    28               module = "draft",
    29               view = "show",
    30               id = record.id
    31             }
    32           end
    33         },
    34         {
    35           label = _"Compare",
    36           content = function(record)
    37             slot.put('<input type="radio" name="old_draft_id" value="' .. tostring(record.id) .. '">')
    38             slot.put('<input type="radio" name="new_draft_id" value="' .. tostring(record.id) .. '">')
    39           end
    40         }
    41       }
    42     }
    43     ui.submit{ text = _"Compare" }
    44   end
    45 }
