liquid_feedback_frontend
view app/main/initiative/add_initiator.lua @ 1678:50b9d23dcbde
Updated French translation
| author | bsw | 
|---|---|
| date | Tue Jun 15 10:34:39 2021 +0200 (2021-06-15) | 
| parents | 5edf916b7cd2 | 
| 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
    10 local records = {
    11   {
    12     id = "-1",
    13     name = _"Choose member"
    14   }
    15 }
    16 local contact_members = app.session.member:get_reference_selector("saved_members"):add_order_by("name"):exec()
    17 for i, record in ipairs(contact_members) do
    18   records[#records+1] = record
    19 end
    21 execute.view {
    22   module = "issue", view = "_head", params = {
    23     issue = initiative.issue,
    24     member = app.session.member
    25   }
    26 }
    28 ui.grid{ content = function()
    29   ui.cell_main{ content = function()
    31     ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function()
    33       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
    34         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = initiative.display_name }
    35       end }
    37       ui.container{ attr = { class = "mdl-card__content" }, content = function()
    38         ui.form{
    39           attr = { class = "wide section" },
    40           module = "initiative",
    41           action = "add_initiator",
    42           params = {
    43             initiative_id = initiative.id,
    44           },
    45           routing = {
    46             ok = {
    47               mode = "redirect",
    48               module = "initiative",
    49               view = "show",
    50               id = initiative.id,
    51               params = {
    52                 tab = "initiators",
    53               }
    54             }
    55           },
    56           content = function()
    58             ui.heading { level = 3, content = _"Invite an initiator to initiative" }
    59             ui.container{ content = _"You can choose only members which you have been saved as contact before." }
    60             slot.put("<br />")
    61             ui.field.select{
    62               name = "member_id",
    63               foreign_records = records,
    64               foreign_id = "id",
    65               foreign_name = "name"
    66             }
    67            slot.put("<br />")
    68            slot.put("<br />")
    69             ui.tag{
    70               tag = "input",
    71               attr = {
    72                 type = "submit",
    73                 class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored",
    74                 value = _"Invite member"
    75               },
    76               content = ""
    77             }
    78             slot.put("   ")
    79             ui.link{
    80               attr = { class = "mdl-button mdl-js-button mdl-button--raised" },
    81               content = _"Cancel",
    82               module = "initiative",
    83               view = "show",
    84               id = initiative.id,
    85               params = {
    86                 tab = "initiators"
    87               }
    88             }
    89           end
    90         }
    92       end }
    93     end }
    94   end }
    96 end }
