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
|
||||
script(src="/JS/polyfill.app.js" defer)
|
||||
|
||||
block content
|
||||
div(id="home" class="cardboard")
|
||||
p
|
||||
|
@ -19,7 +19,6 @@ div(id="triple-column")
|
||||
}
|
||||
let rotation=0, lastCar;
|
||||
col=1;
|
||||
|
||||
for colQuestionaires in questionnaires_col
|
||||
div(class="column-"+col)
|
||||
for questionnaire in colQuestionaires
|
||||
@ -29,10 +28,16 @@ div(id="triple-column")
|
||||
if(lastCar > 4)
|
||||
rotation*=-1;
|
||||
let imgAttributes = { alt: txtIllustration.defaultAlt };
|
||||
if(tool.isEmpty(questionnaire.Illustrations[0].alt)===false)
|
||||
imgAttributes.alt=questionnaire.Illustrations[0].alt;
|
||||
if(tool.isEmpty(questionnaire.Illustrations[0].title)===false)
|
||||
imgAttributes.title=questionnaire.Illustrations[0].title;
|
||||
if(tool.isEmpty(questionnaire.Illustrations[0].alt !==undefined))
|
||||
{
|
||||
if(tool.isEmpty(questionnaire.Illustrations[0].alt)===false)
|
||||
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);
|
||||
|
||||
div(class="quiz cardboard" style="transform: rotate("+rotation+"deg);")
|
||||
@ -44,4 +49,4 @@ div(id="triple-column")
|
||||
p#intro #{introduction}
|
||||
p
|
||||
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")
|
||||
if(linkCanonical)
|
||||
link(rel="canonical" href=linkCanonical)
|
||||
body(class="cardboard")
|
||||
header(class="cardboard")
|
||||
a(href="/" title=configTpl.homePageTxt)
|
||||
img(src="/themes/wikilerni/img/wikilerni-purple-2-128.png" alt=config.siteName+" (logo)")
|
||||
ul(id="headLinks")
|
||||
- const nbItemHead=configTpl.headLinks.length; const lang=config.adminLang+"";
|
||||
for item in configTpl.headLinks
|
||||
li
|
||||
a(href="/"+item.url)&attributes(item.attributes) #{item.anchor}
|
||||
block content
|
||||
- const nbItemFoot = configTpl.footLinks.length;
|
||||
footer(class="cardboard")
|
||||
ul(id="footLinks")
|
||||
for item in configTpl.footLinks
|
||||
li
|
||||
a()&attributes(item.attributes) #{item.anchor}
|
||||
body(class="cardboard")
|
||||
header(class="cardboard")
|
||||
a(href="/" title=configTpl.homePageTxt)
|
||||
img(src="/themes/wikilerni/img/wikilerni-purple-2-128.png" alt=config.siteName+" (logo)")
|
||||
ul(id="headLinks")
|
||||
- const nbItemHead=configTpl.headLinks.length; const lang=config.adminLang+"";
|
||||
for item in configTpl.headLinks
|
||||
li
|
||||
a(href="/"+item.url)&attributes(item.attributes) #{item.anchor}
|
||||
block content
|
||||
- const nbItemFoot = configTpl.footLinks.length;
|
||||
footer(class="cardboard")
|
||||
ul(id="footLinks")
|
||||
for item in configTpl.footLinks
|
||||
li
|
||||
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")
|
||||
h2(class="cardboard") #{config.siteName+" - "+configTpl.siteSlogan}
|
||||
div#listsIntro !{configTpl.newsListTitle}
|
||||
// p
|
||||
// a(href="/"+configTpl.subscribePage class="button cardboard" title=configTpl.homeBtnSubscribeTxt) #{configTpl.homeBtnSubscribeTxt}
|
||||
- nbQuestionnairesList=configTpl.maxQuestionnairesByPage;
|
||||
include includes/listing-questionnaires.pug
|
Loading…
Reference in New Issue
Block a user