bsw@725: local initiative = Initiative:by_id(param.get("initiative_id", atom.number)) bsw@725: bsw@725: execute.view{ bsw@725: module = "initiative", view = "_show", params = { bsw@725: initiative = initiative, show_as_head = true bsw@725: } bsw@725: } bsw@725: bsw@725: ui.link{ bsw@725: text = _"Back to initiative", bsw@725: module = "initiative", view = "show", id = initiative.id bsw@725: } bsw@725: bsw@725: slot.put("
") bsw@725: slot.put("
") bsw@725: bsw@725: ui.form{ bsw@725: method = "get", bsw@725: module = "draft", bsw@725: view = "diff", bsw@725: content = function() bsw@725: ui.list{ bsw@725: records = initiative.drafts, bsw@725: columns = { bsw@725: { bsw@725: label = _"Created at", bsw@725: content = function(record) bsw@725: ui.field.text{ readonly = true, value = format.timestamp(record.created) } bsw@725: end bsw@725: }, bsw@725: { bsw@725: label = _"Author", bsw@725: content = function(record) bsw@725: if record.author then bsw@725: return record.author:ui_field_text() bsw@725: end bsw@725: end bsw@725: }, bsw@725: { bsw@725: content = function(record) bsw@725: ui.link{ bsw@725: attr = { class = "action" }, bsw@725: text = _"Show", bsw@725: module = "draft", bsw@725: view = "show", bsw@725: id = record.id bsw@725: } bsw@725: end bsw@725: }, bsw@725: { bsw@725: label = _"Compare", bsw@725: content = function(record) bsw@725: slot.put('') bsw@725: slot.put('') bsw@725: end bsw@725: } bsw@725: } bsw@725: } bsw@725: ui.submit{ text = _"Compare" } bsw@725: end bsw@725: }