liquid_feedback_frontend

annotate app/main/initiative/remove_initiator.lua @ 1309:32cc544d5a5b

Cumulative patch for upcoming frontend version 4
author bsw/jbe
date Sun Jul 15 14:07:29 2018 +0200 (2018-07-15)
parents 701a5cf6b067
children ca68bd1c851d
rev   line source
bsw@10 1 local initiative = Initiative:by_id(param.get("initiative_id"))
bsw@10 2
bsw@1045 3 local member = app.session.member
bsw@1045 4 if member then
bsw@1045 5 initiative:load_everything_for_member_id(member.id)
bsw@1045 6 initiative.issue:load_everything_for_member_id(member.id)
bsw@1045 7 end
bsw@1045 8
bsw@10 9 local initiator = Initiator:by_pk(initiative.id, app.session.member.id)
bsw@10 10 if not initiator or initiator.accepted ~= true then
bsw/jbe@1309 11 return execute.view { module = "index", view = "403" }
bsw@10 12 end
bsw@10 13
bsw@1045 14 execute.view {
bsw@1045 15 module = "issue", view = "_head", params = {
bsw@1045 16 issue = initiative.issue,
bsw@1045 17 member = app.session.member
bsw@1045 18 }
bsw@1045 19 }
bsw@1045 20
bsw@1045 21 execute.view{ module = "issue", view = "_sidebar_state", params = {
bsw@1045 22 initiative = initiative
bsw@1045 23 } }
bsw@10 24
bsw@1045 25 execute.view {
bsw@1045 26 module = "issue", view = "_sidebar_issue",
bsw@1045 27 params = {
bsw@1045 28 issue = initiative.issue,
bsw@1045 29 highlight_initiative_id = initiative.id
bsw@10 30 }
bsw@1045 31 }
bsw@10 32
bsw@1045 33 execute.view {
bsw@1045 34 module = "issue", view = "_sidebar_whatcanido",
bsw@1045 35 params = { initiative = initiative }
bsw@1045 36 }
bsw@1045 37
bsw@1045 38 execute.view {
bsw@1045 39 module = "issue", view = "_sidebar_members", params = {
bsw@1045 40 issue = initiative.issue, initiative = initiative
bsw@1045 41 }
bsw@1045 42 }
bsw@10 43
bsw@10 44 ui.form{
bsw@1045 45 attr = { class = "vertical section" },
bsw@10 46 module = "initiative",
bsw@10 47 action = "remove_initiator",
bsw@10 48 params = {
bsw@10 49 initiative_id = initiative.id,
bsw@10 50 },
bsw@10 51 routing = {
bsw@10 52 ok = {
bsw@10 53 mode = "redirect",
bsw@10 54 module = "initiative",
bsw@10 55 view = "show",
bsw@10 56 id = initiative.id,
bsw@10 57 params = {
bsw@10 58 tab = "initiators",
bsw@10 59 }
bsw@10 60 }
bsw@10 61 },
bsw@10 62 content = function()
bsw@1045 63
bsw@1045 64 ui.sectionHead( function()
bsw@1045 65 ui.link{
bsw@1045 66 module = "initiative", view = "show", id = initiative.id,
bsw@1045 67 content = function ()
bsw@1045 68 ui.heading {
bsw@1045 69 level = 1,
bsw@1045 70 content = initiative.display_name
bsw@1045 71 }
bsw@1045 72 end
bsw@1045 73 }
bsw@1045 74 ui.heading { level = 2, content = _"Remove an initiator from initiative" }
bsw@1045 75 end )
bsw@1045 76
bsw@1045 77 ui.sectionRow( function()
bsw@1045 78 local records = initiative:get_reference_selector("initiating_members"):add_where("accepted OR accepted ISNULL"):exec()
bsw@1045 79 ui.heading{ level = 2, content = _"Choose an initiator to remove" }
bsw@1045 80 ui.field.select{
bsw@1045 81 name = "member_id",
bsw@1045 82 foreign_records = records,
bsw@1045 83 foreign_id = "id",
bsw@1045 84 foreign_name = "name",
bsw@10 85 }
bsw@1045 86 slot.put("<br />")
bsw@1045 87 ui.tag{
bsw@1045 88 tag = "input",
bsw@1045 89 attr = {
bsw@1045 90 type = "submit",
bsw@1045 91 class = "btn btn-dangerous",
bsw@1045 92 value = _"Remove initiator"
bsw@1045 93 },
bsw@1045 94 content = ""
bsw@1045 95 }
bsw@1045 96 slot.put("<br />")
bsw@1045 97 slot.put("<br />")
bsw@1045 98 ui.link{
bsw@1045 99 content = _"Cancel",
bsw@1045 100 module = "initiative",
bsw@1045 101 view = "show",
bsw@1045 102 id = initiative.id,
bsw@1045 103 params = {
bsw@1045 104 tab = "initiators"
bsw@1045 105 }
bsw@1045 106 }
bsw@1045 107 end )
bsw@10 108 end
bsw/jbe@1309 109 }

Impressum / About Us