bsw@211: local initiative = param.get("initiative", "table")
bsw@211:
bsw@211: local drafts = Draft:new_selector()
bsw@211: :add_where{ "draft.initiative_id = ?", initiative.id }
bsw@211: :add_order_by("id DESC")
bsw@211: :exec()
bsw@211:
bsw@211: ui.container{ attr = { class = "boxhead" }, content = _"Draft revisions" }
bsw@211:
bsw@211: ui.box{ class = "drafts", content = function()
bsw@211: if drafts then
bsw@211: ui.form{
bsw@211: method = "get",
bsw@211: module = "draft",
bsw@211: view = "diff",
bsw@211: content = function()
bsw@211: ui.box_row{ class = "", content = function()
bsw@211: ui.box_col{ class = "scrolled", content = function()
bsw@211:
bsw@211: for i, draft in ipairs(drafts) do
bsw@211: ui.box_row{ class = "draft", content = function()
bsw@211: ui.box_col{ class = "left", content = function()
bsw@211: ui.link{
bsw@211: attr = { class = "created" },
bsw@211: text = format.timestamp(draft.created),
bsw@211: module = "draft",
bsw@211: view = "show",
bsw@211: id = draft.id
bsw@211: }
bsw@211: slot.put("
")
bsw@211: ui.tag{ content = _"by" }
bsw@211: slot.put(" ")
bsw@211: ui.link{
bsw@211: attr = { class = "author_name" },
bsw@211: module = "lf2", view = "issue", id = initiative.issue_id,
bsw@211: params = { member_id = author_id },
bsw@211: text = draft.author.name
bsw@211: }
bsw@211: end }
bsw@211: ui.box_col{ class = "right", content = function()
bsw@211: slot.put('')
bsw@211: slot.put('')
bsw@211: end }
bsw@211: end }
bsw@211: end
bsw@211: end } end }
bsw@211:
bsw@211: ui.box_row{ content = function() ui.box_col{ class = "right", content = function()
bsw@211: ui.submit{ text = _"Compare selected" }
bsw@211: end } end }
bsw@211: end
bsw@211: }
bsw@211: else
bsw@211: end
bsw@211: end }