Debug problème layout pug quand aucune illustration n'est fournie
This commit is contained in:
parent
470a2a313b
commit
5b8b854053
@ -2,6 +2,7 @@ extends layout.pug
|
|||||||
|
|
||||||
block append scripts
|
block append scripts
|
||||||
script(src="/JS/polyfill.app.js" defer)
|
script(src="/JS/polyfill.app.js" defer)
|
||||||
|
|
||||||
block content
|
block content
|
||||||
div(id="home" class="cardboard")
|
div(id="home" class="cardboard")
|
||||||
p
|
p
|
||||||
|
@ -19,7 +19,6 @@ div(id="triple-column")
|
|||||||
}
|
}
|
||||||
let rotation=0, lastCar;
|
let rotation=0, lastCar;
|
||||||
col=1;
|
col=1;
|
||||||
|
|
||||||
for colQuestionaires in questionnaires_col
|
for colQuestionaires in questionnaires_col
|
||||||
div(class="column-"+col)
|
div(class="column-"+col)
|
||||||
for questionnaire in colQuestionaires
|
for questionnaire in colQuestionaires
|
||||||
@ -29,10 +28,16 @@ div(id="triple-column")
|
|||||||
if(lastCar > 4)
|
if(lastCar > 4)
|
||||||
rotation*=-1;
|
rotation*=-1;
|
||||||
let imgAttributes = { alt: txtIllustration.defaultAlt };
|
let imgAttributes = { alt: txtIllustration.defaultAlt };
|
||||||
if(tool.isEmpty(questionnaire.Illustrations[0].alt)===false)
|
if(tool.isEmpty(questionnaire.Illustrations[0].alt !==undefined))
|
||||||
imgAttributes.alt=questionnaire.Illustrations[0].alt;
|
{
|
||||||
if(tool.isEmpty(questionnaire.Illustrations[0].title)===false)
|
if(tool.isEmpty(questionnaire.Illustrations[0].alt)===false)
|
||||||
imgAttributes.title=questionnaire.Illustrations[0].title;
|
imgAttributes.alt=questionnaire.Illustrations[0].alt;
|
||||||
|
}
|
||||||
|
if(tool.isEmpty(questionnaire.Illustrations[0].title !==undefined))
|
||||||
|
{
|
||||||
|
if(tool.isEmpty(questionnaire.Illustrations[0].title)===false)
|
||||||
|
imgAttributes.title=questionnaire.Illustrations[0].title;
|
||||||
|
}
|
||||||
let introduction=tool.shortenIfLongerThan(striptags(questionnaire.Questionnaire.introduction.replace("<br>", " ").replace("</p>", " ")), 200);
|
let introduction=tool.shortenIfLongerThan(striptags(questionnaire.Questionnaire.introduction.replace("<br>", " ").replace("</p>", " ")), 200);
|
||||||
|
|
||||||
div(class="quiz cardboard" style="transform: rotate("+rotation+"deg);")
|
div(class="quiz cardboard" style="transform: rotate("+rotation+"deg);")
|
||||||
@ -44,4 +49,4 @@ div(id="triple-column")
|
|||||||
p#intro #{introduction}
|
p#intro #{introduction}
|
||||||
p
|
p
|
||||||
a(href="/quiz/"+questionnaire.Questionnaire.slug+".html" class="button cardboard") #{txtGeneral.btnLinkToQuestionnaire}
|
a(href="/quiz/"+questionnaire.Questionnaire.slug+".html" class="button cardboard") #{txtGeneral.btnLinkToQuestionnaire}
|
||||||
- col++;
|
- col++;
|
@ -24,19 +24,19 @@ html(lang=(pageLang) ? pageLang : config.adminLang)
|
|||||||
link(rel="alternate" type="application/atom+xml" title=config.siteName href="/atom.xml")
|
link(rel="alternate" type="application/atom+xml" title=config.siteName href="/atom.xml")
|
||||||
if(linkCanonical)
|
if(linkCanonical)
|
||||||
link(rel="canonical" href=linkCanonical)
|
link(rel="canonical" href=linkCanonical)
|
||||||
body(class="cardboard")
|
body(class="cardboard")
|
||||||
header(class="cardboard")
|
header(class="cardboard")
|
||||||
a(href="/" title=configTpl.homePageTxt)
|
a(href="/" title=configTpl.homePageTxt)
|
||||||
img(src="/themes/wikilerni/img/wikilerni-purple-2-128.png" alt=config.siteName+" (logo)")
|
img(src="/themes/wikilerni/img/wikilerni-purple-2-128.png" alt=config.siteName+" (logo)")
|
||||||
ul(id="headLinks")
|
ul(id="headLinks")
|
||||||
- const nbItemHead=configTpl.headLinks.length; const lang=config.adminLang+"";
|
- const nbItemHead=configTpl.headLinks.length; const lang=config.adminLang+"";
|
||||||
for item in configTpl.headLinks
|
for item in configTpl.headLinks
|
||||||
li
|
li
|
||||||
a(href="/"+item.url)&attributes(item.attributes) #{item.anchor}
|
a(href="/"+item.url)&attributes(item.attributes) #{item.anchor}
|
||||||
block content
|
block content
|
||||||
- const nbItemFoot = configTpl.footLinks.length;
|
- const nbItemFoot = configTpl.footLinks.length;
|
||||||
footer(class="cardboard")
|
footer(class="cardboard")
|
||||||
ul(id="footLinks")
|
ul(id="footLinks")
|
||||||
for item in configTpl.footLinks
|
for item in configTpl.footLinks
|
||||||
li
|
li
|
||||||
a()&attributes(item.attributes) #{item.anchor}
|
a()&attributes(item.attributes) #{item.anchor}
|
@ -8,7 +8,5 @@ block content
|
|||||||
img(id="logo" src="/themes/wikilerni/img/wikilerni-purple-2-512.png" alt="Logo WikiLerni")
|
img(id="logo" src="/themes/wikilerni/img/wikilerni-purple-2-512.png" alt="Logo WikiLerni")
|
||||||
h2(class="cardboard") #{config.siteName+" - "+configTpl.siteSlogan}
|
h2(class="cardboard") #{config.siteName+" - "+configTpl.siteSlogan}
|
||||||
div#listsIntro !{configTpl.newsListTitle}
|
div#listsIntro !{configTpl.newsListTitle}
|
||||||
// p
|
|
||||||
// a(href="/"+configTpl.subscribePage class="button cardboard" title=configTpl.homeBtnSubscribeTxt) #{configTpl.homeBtnSubscribeTxt}
|
|
||||||
- nbQuestionnairesList=configTpl.maxQuestionnairesByPage;
|
- nbQuestionnairesList=configTpl.maxQuestionnairesByPage;
|
||||||
include includes/listing-questionnaires.pug
|
include includes/listing-questionnaires.pug
|
Loading…
x
Reference in New Issue
Block a user