liquid_feedback_frontend
view app/main/draft/list.lua @ 759:08052bcabb7f
Added tag translate for changeset ea5e8d55a5f0
| author | bsw | 
|---|---|
| date | Thu Jun 28 22:57:50 2012 +0200 (2012-06-28) | 
| parents | 344e5fdce8c9 | 
| children | 
 line source
     1 local initiative = Initiative:by_id(param.get("initiative_id", atom.number))
     3 execute.view{
     4   module = "initiative", view = "_show", params = {
     5     initiative = initiative, show_as_head = true
     6   }
     7 }
     9 ui.link{
    10   text = _"Back to initiative",
    11   module = "initiative", view = "show", id = initiative.id
    12 }
    14 slot.put("<br />")
    15 slot.put("<br />")
    17 ui.form{
    18   method = "get",
    19   module = "draft",
    20   view = "diff",
    21   content = function()
    22     ui.list{
    23       records = initiative.drafts,
    24       columns = {
    25         {
    26           label = _"Created at",
    27           content = function(record)
    28             ui.field.text{ readonly = true, value = format.timestamp(record.created) }
    29           end
    30         },
    31         {
    32           label = _"Author",
    33           content = function(record)
    34             if record.author then
    35               return record.author:ui_field_text()
    36             end
    37           end
    38         },
    39         {
    40           content = function(record)
    41             ui.link{
    42               attr = { class = "action" },
    43               text = _"Show",
    44               module = "draft",
    45               view = "show",
    46               id = record.id
    47             }
    48           end
    49         },
    50         {
    51           label = _"Compare",
    52           content = function(record)
    53             slot.put('<input type="radio" name="old_draft_id" value="' .. tostring(record.id) .. '">')
    54             slot.put('<input type="radio" name="new_draft_id" value="' .. tostring(record.id) .. '">')
    55           end
    56         }
    57       }
    58     }
    59     ui.submit{ text = _"Compare" }
    60   end
    61 }
