liquid_feedback_frontend

annotate app/main/initiative/history.lua @ 1526:45fd259aa1ad

Added login api interface and login scope
author bsw
date Mon Aug 24 13:48:03 2020 +0200 (2020-08-24)
parents 3ab878ba277e
children 294437b78505
rev   line source
bsw@1045 1 local initiative = Initiative:by_id(param.get_id())
bsw@1045 2
bsw@1045 3 initiative:load_everything_for_member_id(app.session.member_id)
bsw@1045 4 initiative.issue:load_everything_for_member_id(app.session.member_id)
bsw@1045 5
bsw@1045 6
bsw/jbe@1309 7 ui.grid{ content = function()
bsw@1045 8
bsw/jbe@1309 9 ui.cell_main{ content = function()
bsw/jbe@1309 10 ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
bsw@1045 11
bsw/jbe@1309 12 ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function ()
bsw/jbe@1309 13 ui.heading {
bsw/jbe@1309 14 attr = { class = "mdl-card__title-text" },
bsw/jbe@1309 15 content = function()
bsw/jbe@1309 16 ui.link{
bsw/jbe@1309 17 module = "initiative", view = "show", id = initiative.id,
bsw/jbe@1309 18 content = initiative.display_name
bsw/jbe@1309 19 }
bsw/jbe@1309 20 end
bsw/jbe@1309 21 }
bsw/jbe@1309 22 ui.container { content = _"Draft history" }
bsw/jbe@1309 23 end }
bsw/jbe@1309 24
bsw/jbe@1309 25 ui.container {
bsw/jbe@1309 26 attr = { class = "mdl-card__content" },
bsw/jbe@1309 27 content = function()
bsw/jbe@1309 28 ui.form{
bsw/jbe@1309 29 method = "get",
bsw/jbe@1309 30 module = "draft",
bsw/jbe@1309 31 view = "diff",
bsw/jbe@1309 32 attr = { class = "section" },
bsw/jbe@1309 33 content = function()
bsw/jbe@1309 34 ui.field.hidden{ name = "initiative_id", value = initiative.id }
bsw/jbe@1309 35
bsw/jbe@1309 36 ui.sectionRow( function()
bsw/jbe@1309 37
bsw/jbe@1309 38 local columns = {
bsw/jbe@1309 39 {
bsw/jbe@1309 40 content = function(record)
bsw@1489 41 slot.put('<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="old_draft_id_' .. record.id .. '"><input type="radio" class="mdl-radio__button" id="old_draft_id_' .. record.id .. '" name="old_draft_id" value="' .. tostring(record.id) .. '">')
bsw@1489 42 ui.tag { content = "compare" }
bsw@1489 43 slot.put(" ")
bsw/jbe@1309 44 ui.link{
bsw/jbe@1309 45 attr = { class = "action" },
bsw/jbe@1309 46 module = "draft", view = "show", id = record.id,
bsw/jbe@1309 47 text = format.timestamp(record.created)
bsw/jbe@1309 48 }
bsw@1489 49 slot.put("</label>")
bsw/jbe@1309 50 end
bsw/jbe@1309 51 },
bsw/jbe@1309 52 {
bsw/jbe@1309 53 content = function(record)
bsw@1489 54 slot.put('<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="new_draft_id_' .. record.id .. '"><input type="radio" class="mdl-radio__button" id="new_draft_id_' .. record.id .. '" name="new_draft_id" value="' .. tostring(record.id) .. '">')
bsw@1489 55 ui.tag { content = _"with" }
bsw@1489 56 slot.put(" ")
bsw@1489 57 ui.link{
bsw@1489 58 attr = { class = "action" },
bsw@1489 59 module = "draft", view = "show", id = record.id,
bsw@1489 60 text = format.timestamp(record.created)
bsw@1489 61 }
bsw@1489 62 slot.put("</label>")
bsw/jbe@1309 63 end
bsw/jbe@1309 64 }
bsw/jbe@1309 65 }
bsw/jbe@1309 66
bsw/jbe@1309 67 if app.session:has_access("authors_pseudonymous") then
bsw/jbe@1309 68 columns[#columns+1] = {
bsw/jbe@1309 69 label = _"author",
bsw/jbe@1309 70 content = function(record)
bsw/jbe@1309 71 if record.author then
bsw/jbe@1309 72 return util.micro_avatar ( record.author )
bsw/jbe@1309 73 end
bsw/jbe@1309 74 end
bsw/jbe@1309 75 }
bsw/jbe@1309 76 end
bsw/jbe@1309 77
bsw/jbe@1309 78 if config.render_external_reference and config.render_external_reference.draft then
bsw/jbe@1309 79 columns[#columns+1] = {
bsw/jbe@1309 80 label = _"external reference",
bsw/jbe@1309 81 content = function(draft)
bsw/jbe@1309 82 config.render_external_reference.draft(draft, function (callback)
bsw/jbe@1309 83 callback()
bsw/jbe@1309 84 end)
bsw/jbe@1309 85 end
bsw/jbe@1309 86 }
bsw/jbe@1309 87 end
bsw/jbe@1309 88
bsw/jbe@1309 89 ui.list{
bsw/jbe@1309 90 records = initiative.drafts,
bsw/jbe@1309 91 columns = columns
bsw/jbe@1309 92 }
bsw/jbe@1309 93
bsw/jbe@1309 94 slot.put("<br />")
bsw/jbe@1309 95 ui.container { attr = { class = "actions" }, content = function()
bsw/jbe@1309 96 ui.tag{
bsw/jbe@1309 97 tag = "input",
bsw/jbe@1309 98 attr = {
bsw/jbe@1309 99 type = "submit",
bsw/jbe@1309 100 class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored",
bsw/jbe@1309 101 value = _"compare revisions"
bsw/jbe@1309 102 },
bsw/jbe@1309 103 content = ""
bsw/jbe@1309 104 }
bsw/jbe@1309 105 end }
bsw/jbe@1309 106 end )
bsw/jbe@1309 107 end
bsw@1045 108 }
bsw@1045 109 end
bsw@1045 110 }
bsw/jbe@1309 111 end }
bsw/jbe@1309 112 end }
bsw/jbe@1309 113
bsw/jbe@1309 114 ui.cell_sidebar{ content = function()
bsw/jbe@1309 115 execute.view{ module = "issue", view = "_sidebar", params = {
bsw/jbe@1309 116 initiative = initiative,
bsw/jbe@1309 117 issue = initiative.issue
bsw/jbe@1309 118 } }
bsw/jbe@1309 119
bsw/jbe@1309 120 execute.view {
bsw/jbe@1309 121 module = "issue", view = "_sidebar_whatcanido",
bsw/jbe@1309 122 params = { initiative = initiative }
bsw/jbe@1309 123 }
bsw/jbe@1309 124
bsw/jbe@1309 125 execute.view {
bsw/jbe@1309 126 module = "issue", view = "_sidebar_members", params = {
bsw/jbe@1309 127 issue = initiative.issue, initiative = initiative
bsw@1045 128 }
bsw/jbe@1309 129 }
bsw/jbe@1309 130 end }
bsw/jbe@1309 131
bsw/jbe@1309 132 end }

Impressum / About Us