Skip to content

Commit

Permalink
Merge pull request #2017 from Inist-CNRS/fix-theme-istex-legacy
Browse files Browse the repository at this point in the history
fix istex legacy blank page
  • Loading branch information
touv authored Jun 3, 2024
2 parents 945314e + 992348a commit 0b9d15e
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 16 deletions.
9 changes: 8 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,14 @@
"istex": {
"host": "/",
"title": "Services",
"summary": "Les technologies et les outils ISTEX pour les projets de recherche."
"summary": "Les technologies et les outils ISTEX pour les projets de recherche.",
"matomoID": "39"
},
"istex-legacy": {
"host": "/",
"title": "Services",
"summary": "Les technologies et les outils ISTEX pour les projets de recherche.",
"matomoID": "39"
},
"inist": {
"title": "Etudes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@
</a>
<div id="pageText" class="pageHead-texte">
<div id="pageTitle">
<%= theme.title %>
<%= custom.title %>
</div>
<p id="pageSubTitle" class="text-center">
<%= theme.summary %>
<%= custom.summary %>
</p>
</div>
</div>
Expand All @@ -117,13 +117,16 @@
</div>
</footer>
<!-- Footer - bloc-8 END -->
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<script src="/js/responsiveMenu.js"></script>
<script src="/js/tooltip.js"></script>
<!-- Piwik -->
<script src="<%= theme.base.href %>/themes/istex/js/jquery-3.6.0.min.js"></script>
<script src="<%= theme.base.href %>/themes/istex/js/responsiveMenu.js"></script>
<script src="<%= theme.base.href %>/themes/istex/js/tooltip.js"></script>
<script>
window.__PRELOADED_STATE__ = <%- lodex.preload %>;
window.__TENANT__ = '<%= lodex.tenant %>';
window.ISTEX_API_URL = '<%= lodex.istexApi %>';
</script>
<script src="<%= lodex.base.href %>/index.js"></script>
<!-- Piwik -->
<script>
var _paq = _paq || [];
_paq.push([
Expand All @@ -146,7 +149,7 @@
(function () {
var u = "https://piwik2.inist.fr/";
_paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(["setSiteId", "39"]);
_paq.push(["setSiteId", "<%= custom.matomoID %>"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
Expand Down
4 changes: 2 additions & 2 deletions src/app/custom/themes/istex-legacy/lodex-theme.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2",
"version": "3",
"restricted": true,
"name": {
"fr": "ISTEX",
Expand All @@ -12,7 +12,7 @@
"files": {
"theme": {
"main": "customTheme.js",
"index": "index.html"
"index": "index.ejs"
}
}
}
41 changes: 38 additions & 3 deletions src/app/custom/themes/istex/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,41 @@
window.__TENANT__ = '<%= lodex.tenant %>';
window.ISTEX_API_URL = '<%= lodex.istexApi %>';
</script>
<script src="<%= lodex.base.href %>/index.js"></script>
</body>
</html>
<script src="<%= lodex.base.href %>/index.js"></script>
<!-- Piwik -->
<script>
var _paq = _paq || [];
_paq.push([
function () {
var self = this;
function getOriginalVisitorCookieTimeout() {
var now = new Date(),
nowTs = Math.round(now.getTime() / 1000),
visitorInfo = self.getVisitorInfo();
var createTs = parseInt(visitorInfo[2]);
var cookieTimeout = 33696000;
var originalTimeout = createTs + cookieTimeout - nowTs;
return originalTimeout;
}
this.setVisitorCookieTimeout(getOriginalVisitorCookieTimeout());
}
]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
var u = "https://piwik2.inist.fr/";
_paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(["setSiteId", "<%= custom.matomoID %>"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.type = "text/javascript";
g.async = true;
g.defer = true;
g.src = u + "piwik.js";
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Piwik Code -->
</body>
</html>

0 comments on commit 0b9d15e

Please sign in to comment.