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