liquid_feedback_frontend
view app/main/initiative/remove_initiator.lua @ 1697:7cbc5a4638b8
Capitalization of some strings
| author | bsw | 
|---|---|
| date | Thu Sep 23 17:59:48 2021 +0200 (2021-09-23) | 
| parents | ca68bd1c851d | 
| children | 
 line source
     1 local initiative = Initiative:by_id(param.get("initiative_id"))
     3 local member = app.session.member
     4 if member then
     5   initiative:load_everything_for_member_id(member.id)
     6   initiative.issue:load_everything_for_member_id(member.id)
     7 end
     9 local initiator = Initiator:by_pk(initiative.id, app.session.member.id)
    10 if not initiator or initiator.accepted ~= true then
    11   return execute.view { module = "index", view = "403" }
    12 end
    14 execute.view {
    15   module = "issue", view = "_head", params = {
    16     issue = initiative.issue,
    17     member = app.session.member
    18   }
    19 }
    21 ui.grid{ content = function()
    22   ui.cell_main{ content = function()
    24     ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
    26       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
    27         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = initiative.display_name }
    28       end }
    30       ui.container{ attr = { class = "mdl-card__content" }, content = function()
    32         ui.form{
    33           attr = { class = "vertical section" },
    34           module = "initiative",
    35           action = "remove_initiator",
    36           params = {
    37             initiative_id = initiative.id,
    38           },
    39           routing = {
    40             ok = {
    41               mode = "redirect",
    42               module = "initiative",
    43               view = "show",
    44               id = initiative.id,
    45               params = {
    46                 tab = "initiators",
    47               }
    48             }
    49           },
    50           content = function()
    52             ui.heading { level = 3, content = _"Remove an initiator from initiative" }
    54             local records = initiative:get_reference_selector("initiating_members"):add_where("accepted OR accepted ISNULL"):exec()
    56             ui.field.select{
    57               name = "member_id",
    58               foreign_records = records,
    59               foreign_id = "id",
    60               foreign_name = "name",
    61             }
    62             slot.put("<br />")
    63             ui.tag{
    64               tag = "input",
    65               attr = {
    66                 type = "submit",
    67                 class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored",
    68                 value = _"Remove initiator"
    69               },
    70               content = ""
    71             }
    72             slot.put("   ")
    73             ui.link{
    74               attr = { class = "mdl-button mdl-js-button mdl-button--raised" },
    75               content = _"Cancel",
    76               module = "initiative",
    77               view = "show",
    78               id = initiative.id,
    79               params = {
    80                 tab = "initiators"
    81               }
    82             }
    83           end
    84         }
    85       end }
    86     end }
    87   end }
    88 end }
