allow custom message for link attribute in modal and message page

merge-requests/208/head
fatchan 4 years ago
parent c8e61222cb
commit 262100effa
  1. 2
      gulp/res/js/modal.js
  2. 12
      helpers/checks/blockbypass.js
  3. 2
      views/mixins/modal.pug
  4. 6
      views/pages/message.pug

@ -55,7 +55,7 @@ pug_html = pug_html + "\u003Cli\u003E" + (pug_escape(null == (pug_interp = error
}
pug_html = pug_html + "\u003C\u002Ful\u003E\u003C\u002Fdiv\u003E";
if (data.link) {
pug_html = pug_html + "\u003Cdiv class=\"row\"\u003E\u003Ca" + (pug_attr("href", data.link, true, false)+" target=\"_blank\"") + "\u003E" + (pug_escape(null == (pug_interp = data.link) ? "" : pug_interp)) + "\u003C\u002Fa\u003E\u003C\u002Fdiv\u003E";
pug_html = pug_html + "\u003Cdiv class=\"row\"\u003E\u003Ca" + (pug_attr("href", data.link.href, true, false)+" target=\"_blank\"") + "\u003E" + (pug_escape(null == (pug_interp = data.link.text) ? "" : pug_interp)) + "\u003C\u002Fa\u003E\u003C\u002Fdiv\u003E";
}
}
else

@ -18,8 +18,10 @@ module.exports = async (req, res, next) => {
return dynamicResponse(req, res, 403, 'message', {
'title': 'Forbidden',
'message': 'Missing or invalid block bypass',
'redirect': '/bypass.html',
'link': '/bypass.html',
'link': {
'href': '/bypass.html',
'text': 'Get block bypass',
},
});
}
@ -55,8 +57,10 @@ module.exports = async (req, res, next) => {
return dynamicResponse(req, res, 403, 'message', {
'title': 'Forbidden',
'message': 'Block bypass expired or exceeded max uses',
'redirect': '/bypass.html',
'link': '/bypass.html',
'link': {
'href': '/bypass.html',
'text': 'Get block bypass',
},
});
}

@ -19,7 +19,7 @@ mixin modal(data)
li #{error}
if data.link
.row
a(href=data.link target='_blank') #{data.link}
a(href=data.link.href target='_blank') #{data.link.text}
else if data.settings
.row
.form-wrapper.flexleft.mt-10

@ -19,8 +19,8 @@ block content
if errors
each error in errors
li #{error}
if link
li
a(href=link target='_blank') #{link}
if link
div
a(href=link.href target='_blank') #{link.text}
if redirect
p You will be redirected shortly. If you are not redirected automatically, you can #[a(href=redirect) click here].

Loading…
Cancel
Save