annotate app/main/index/email_unconfirmed.lua @ 1720:a63c2dacf619
If only one policy is available, choose it automatically
 | author | 
 bsw | 
 | date | 
 Mon Sep 27 13:09:30 2021 +0200 (2021-09-27) | 
 | parents | 
 ad1107fc0fbf  | 
 | children | 
  | 
 
 | rev | 
   line source | 
| 
bsw@1487
 | 
     1 ui.title(_"Confirm notification address")
 | 
| 
bsw@1487
 | 
     2 
 | 
| 
bsw@558
 | 
     3 if app.session.member.notify_email_unconfirmed then
 | 
| 
bsw@558
 | 
     4 
 | 
| 
bsw@1487
 | 
     5 ui.grid{ content = function()
 | 
| 
bsw@1487
 | 
     6   ui.cell_full{ content = function()
 | 
| 
bsw@1487
 | 
     7 
 | 
| 
bsw@1487
 | 
     8     ui.container { attr = { class = "mdl-card mdl-shadow--2dp mdl-card__fullwidth" }, content = function()
 | 
| 
bsw@558
 | 
     9 
 | 
| 
bsw@1487
 | 
    10       ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function()
 | 
| 
bsw@1487
 | 
    11         ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Notification address unconfirmed" }
 | 
| 
bsw@1487
 | 
    12       end }
 | 
| 
bsw@1487
 | 
    13       ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function()
 | 
| 
bsw@1487
 | 
    14 
 | 
| 
bsw@1487
 | 
    15         local current = Member:new_selector()
 | 
| 
bsw@1487
 | 
    16           :add_where{ "id = ?", app.session.member_id }
 | 
| 
bsw@1487
 | 
    17           :add_where("notify_email_unconfirmed NOTNULL")
 | 
| 
bsw@1487
 | 
    18           :add_where("notify_email_secret_expiry > now()")
 | 
| 
bsw@1487
 | 
    19           :optional_object_mode()
 | 
| 
bsw@1487
 | 
    20           :exec()
 | 
| 
bsw@558
 | 
    21 
 | 
| 
bsw@1487
 | 
    22         if current then
 | 
| 
bsw@1487
 | 
    23           ui.tag{
 | 
| 
bsw@1487
 | 
    24             tag = "div",
 | 
| 
bsw@1487
 | 
    25             content = _("You didn't confirm your email address '#{email}'. You have received an email with an activation link.", { email = app.session.member.notify_email_unconfirmed })
 | 
| 
bsw@1487
 | 
    26           }
 | 
| 
bsw@1487
 | 
    27         else
 | 
| 
bsw@1487
 | 
    28           ui.tag{
 | 
| 
bsw@1487
 | 
    29             tag = "div",
 | 
| 
bsw@1487
 | 
    30             content = _("You didn't confirm your email address '#{email}' within 7 days.", { email = app.session.member.notify_email_unconfirmed })
 | 
| 
bsw@1487
 | 
    31           }
 | 
| 
bsw@1487
 | 
    32         end
 | 
| 
bsw@1487
 | 
    33         slot.put("<br />")
 | 
| 
bsw@1487
 | 
    34 
 | 
| 
bsw@1487
 | 
    35         ui.link{
 | 
| 
bsw@1487
 | 
    36           text = _"Change email address",
 | 
| 
bsw@1487
 | 
    37           module = "member",
 | 
| 
bsw@1487
 | 
    38           view = "settings_email",
 | 
| 
bsw@1045
 | 
    39         }
 | 
| 
bsw@1487
 | 
    40         slot.put("<br />")
 | 
| 
bsw@1487
 | 
    41         slot.put("<br />")
 | 
| 
bsw@558
 | 
    42 
 | 
| 
bsw@1487
 | 
    43         ui.link{
 | 
| 
bsw@1487
 | 
    44           text = _("Resend activation email to '#{email}'", { email = app.session.member.notify_email_unconfirmed }),
 | 
| 
bsw@1487
 | 
    45           module = "member",
 | 
| 
bsw@1487
 | 
    46           action = "update_email",
 | 
| 
bsw@1487
 | 
    47           params = {
 | 
| 
bsw@1487
 | 
    48             resend = true
 | 
| 
bsw@1487
 | 
    49           },
 | 
| 
bsw@1487
 | 
    50           routing = {
 | 
| 
bsw@1487
 | 
    51             default = {
 | 
| 
bsw@1487
 | 
    52               mode = "redirect",
 | 
| 
bsw@1487
 | 
    53               module = "index",
 | 
| 
bsw@1487
 | 
    54               view = "index"
 | 
| 
bsw@1487
 | 
    55             }
 | 
| 
bsw@1045
 | 
    56           }
 | 
| 
bsw@1045
 | 
    57         }
 | 
| 
bsw@1487
 | 
    58 
 | 
| 
bsw@1487
 | 
    59       end }
 | 
| 
bsw@1487
 | 
    60     end }
 | 
| 
bsw@1487
 | 
    61   end }
 | 
| 
bsw@1487
 | 
    62 end }
 | 
| 
bsw@1487
 | 
    63 
 | 
| 
bsw@1487
 | 
    64 
 | 
| 
bsw@558
 | 
    65 end
 |