Skip to content

Commit

Permalink
Flash Message Fix and client newshub (#415)
Browse files Browse the repository at this point in the history
* Flash Message Fix + client newshub

Fix done in order to pass the faf test. Apparently the flash messages can break easily.
Small client newshub fix so it doesn't open browser links inside the client.

* Update flash-messages.pug

* Update flash-messages.pug
  • Loading branch information
JaviTrek authored Jan 2, 2023
1 parent 37caa66 commit d8b44ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions public/js/app/newshub.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ function articleActivate(article) {
});
}

let links = document.getElementsByTagName('a');
let linksLength = links.length;
for (let i= 0; i < linksLength; i++) {
links[i].target = '_blank';
}
7 changes: 3 additions & 4 deletions templates/mixins/flash-messages.pug
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mixin flash-messages(messages)
div.alert(class=flash['class'])
ul.flash-errors
if flash.messages
if flash.messages[0].msg
li <strong>#{flash.type}</strong> !{flash.messages[0].msg}
if flash.messages[1].msg
li <strong>#{flash.type}</strong> !{flash.messages[1].msg}
if flash.messages[0]
if flash.messages[0].msg
li <strong>#{flash.type}</strong> !{flash.messages[0].msg}

0 comments on commit d8b44ba

Please sign in to comment.