Commit 1aa02a6f authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_js_style: add a prerender link

This allows crawlers like wget to also fetch the rendering gadget without executing any JS
parent 51f321d8
......@@ -10,6 +10,7 @@
dialog_category python: '';
web_site python: here.getWebSiteValue();
web_section python: here.getWebSectionValue();
no_style_gadget_url python: web_site.getLayoutProperty('configuration_style_gadget_url', default='');
global_definitions_macros here/global_definitions/macros;">
<tal:block metal:use-macro="global_definitions_macros/header_definitions" />
<html>
......@@ -25,8 +26,11 @@
<script src="portal_skins/erp5_xhtml_style/renderjs.js"></script>
<script src="gadget_global.js"></script>
<script src="jsstyle.js"></script>
<tal:block tal:condition="python: no_style_gadget_url != ''">
<link rel="prerender" tal:attributes="href no_style_gadget_url">
</tal:block>
</head>
<body tal:attributes="data-nostyle-gadget-url python: web_site.getLayoutProperty('configuration_style_gadget_url', default='')">
<body tal:attributes="data-nostyle-gadget-url no_style_gadget_url">
<tal:block tal:content="structure python: web_site.WebSite_generateNavigationHTML()"></tal:block>
<main>
......
......@@ -9,6 +9,7 @@
dummy python: request.set('editable_mode', False);
web_site python: here.getWebSiteValue();
web_section python: here.getWebSectionValue();
no_style_gadget_url python: web_site.getLayoutProperty('configuration_style_gadget_url', default='');
global_definitions_macros here/global_definitions/macros;">
<tal:block metal:use-macro="global_definitions_macros/header_definitions" />
<html>
......@@ -24,8 +25,11 @@
<script src="portal_skins/erp5_xhtml_style/renderjs.js"></script>
<script src="gadget_global.js"></script>
<script src="jsstyle.js"></script>
<tal:block tal:condition="python: no_style_gadget_url != ''">
<link rel="prerender" tal:attributes="href no_style_gadget_url">
</tal:block>
</head>
<body tal:attributes="data-nostyle-gadget-url python: web_site.getLayoutProperty('configuration_style_gadget_url', default='')">
<body tal:attributes="data-nostyle-gadget-url no_style_gadget_url">
<tal:block tal:content="structure python: web_site.WebSite_generateNavigationHTML()"></tal:block>
<p tal:content="request/portal_status_message | nothing" id="portal_status_message"/>
......
......@@ -32,6 +32,12 @@
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//head/link[@rel='prerender' and @href='jsstyle_demo.html']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//header/h1[text()='JS Style Demo']</td>
......
......@@ -31,6 +31,13 @@
<td>${base_url}/web_site_module/erp5_web_js_style_test_site/</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//head/link[@rel='prerender']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//nav[@id='sitemap']/a[text()='No Style']</td>
......
......@@ -31,6 +31,11 @@
<td>${base_url}/web_site_module/erp5_web_js_style_test_site/</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//head/link[@rel='prerender' and @href='jsstyle_demo.html']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//header/h1[text()='JS Style Demo']</td>
......
......@@ -31,6 +31,11 @@
<td>${base_url}/web_site_module/erp5_web_js_style_test_site/</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//head/link[@rel='prerender']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>No Style Form</td>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment