bsw/jbe@0: local draft = Draft:new_selector():add_where{ "id = ?", param.get_id() }:single_object_mode():exec() poelzi@160: local source = param.get("source", atom.boolean) poelzi@160: poelzi@160: execute.view{ bsw@1045: module = "issue", poelzi@160: view = "_head", bsw@1045: params = { issue = draft.initiative.issue } poelzi@160: } poelzi@160: bsw@1045: ui.section( function() bsw@1045: bsw@1045: ui.sectionHead( function() poelzi@160: ui.link{ bsw@1045: module = "initiative", view = "show", id = draft.initiative.id, bsw@1045: content = function () bsw@1045: ui.heading { bsw@1045: level = 1, bsw@1045: content = draft.initiative.display_name bsw@1045: } bsw@1045: end poelzi@160: } bsw@1045: ui.container { attr = { class = "right" }, content = function() bsw@1045: if source then bsw@1045: ui.link{ bsw@1045: content = _"Rendered", bsw@1045: module = "draft", bsw@1045: view = "show", bsw@1045: id = param.get_id(), bsw@1045: params = { source = false } bsw@1045: } bsw@1045: else bsw@1045: ui.link{ bsw@1045: content = _"Source", bsw@1045: module = "draft", bsw@1045: view = "show", bsw@1045: id = param.get_id(), bsw@1045: params = { source = true } bsw@1045: } bsw@1045: end bsw@1045: end } bsw@1045: ui.heading { level = 2, content = _("Draft revision #{id}", { id = draft.id } ) } bsw@1045: end) bsw@1045: bsw@1209: if config.render_external_reference and config.render_external_reference.draft then bsw@1209: config.render_external_reference.draft(draft, function (callback) bsw@1209: ui.sectionRow(callback) bsw@1209: end) bsw@1209: end bsw@1209: bsw@1045: ui.sectionRow( function() bsw@1045: bsw@1045: execute.view{ bsw@1045: module = "draft", bsw@1045: view = "_show", bsw@1045: params = { draft = draft, source = source } bsw@1045: } bsw@1045: end) bsw@1045: end)