Commit bda9ec81 authored by Exbrayat Cédric's avatar Exbrayat Cédric
Browse files

chore: format backend templates with prettier

parent ec989ddd
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<!--
<body>
<!--
Reusable fragment displaying the content of an institute popover.
Its unique argument (institute) is an InstituteVO
-->
<th:block th:fragment="institute(institute)">
<div class="text-center py-2" th:if="${institute.logo}">
<img class="img-fluid" th:src="${institute.logo}" th:alt="${institute.instituteName}"/>
</div>
<div th:replace="fragments/row::text-row(label='Code', text=${institute.instituteCode})"></div>
<div th:replace="fragments/row::text-row(label='Acronym', text=${institute.acronym})"></div>
<div th:replace="fragments/row::text-row(label='Organization', text=${institute.organisation})"></div>
<div th:replace="fragments/row::text-row(label='Type', text=${institute.instituteType})"></div>
<div th:replace="fragments/row::text-row(label='Address', text=${institute.address})"></div>
<th:block th:if="${institute.webSite}">
<div th:replace="fragments/row::row(label='Website', content=~{::.institute-website})">
<a class="institute-website"
target="_blank"
th:href="${institute.webSite}"
th:text="${#strings.abbreviate(institute.webSite, 25)}"></a>
</div>
</th:block>
</th:block>
</body>
<th:block th:fragment="institute(institute)">
<div class="text-center py-2" th:if="${institute.logo}">
<img
class="img-fluid"
th:src="${institute.logo}"
th:alt="${institute.instituteName}"
/>
</div>
<div
th:replace="fragments/row::text-row(label='Code', text=${institute.instituteCode})"
></div>
<div
th:replace="fragments/row::text-row(label='Acronym', text=${institute.acronym})"
></div>
<div
th:replace="fragments/row::text-row(label='Organization', text=${institute.organisation})"
></div>
<div
th:replace="fragments/row::text-row(label='Type', text=${institute.instituteType})"
></div>
<div
th:replace="fragments/row::text-row(label='Address', text=${institute.address})"
></div>
<th:block th:if="${institute.webSite}">
<div
th:replace="fragments/row::row(label='Website', content=~{::.institute-website})"
>
<a
class="institute-website"
target="_blank"
th:href="${institute.webSite}"
th:text="${#strings.abbreviate(institute.webSite, 25)}"
></a>
</div>
</th:block>
</th:block>
</body>
</html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<!--
<body>
<!--
Reusable fragment displaying a link with a label if the provided url is not
empty, or a span with the label if the provided url is empty.
Both arguments are strings.
-->
<th:block th:fragment="link(label, url)">
<a th:unless="${#strings.isEmpty(url)}"
th:href="${url}"
th:text="${label}"></a>
<span th:if="${#strings.isEmpty(url)}" th:text="${label}"></span>
</th:block>
</body>
<th:block th:fragment="link(label, url)">
<a
th:unless="${#strings.isEmpty(url)}"
th:href="${url}"
th:text="${label}"
></a>
<span th:if="${#strings.isEmpty(url)}" th:text="${label}"></span>
</th:block>
</body>
</html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<!--
<body>
<!--
Reusable fragment displaying a map and its legend.
The map is initially hidden. The JavaScript displays it if there are locations
to display
-->
<div th:fragment="map" id="map-container" class="d-none">
<div id="map" class="border rounded"></div>
<div class="map-legend mt-1 small">
<img th:src="@{/assets/images/marker-icon-red.png}" id="red"/>
<label for="red" class="me-2">Origin site</label>
<img th:src="@{/assets/images/marker-icon-blue.png}" id="blue"/>
<label for="blue" class="me-2">Collecting site</label>
<img th:src="@{/assets/images/marker-icon-green.png}" id="green"/>
<label for="green" class="me-2">Evaluation site</label>
<img th:src="@{/assets/images/marker-icon-purple.png}" id="purple"/>
<label for="purple">Multi-purpose site</label>
</div>
</div>
<div th:fragment="map" id="map-container" class="d-none">
<div id="map" class="border rounded"></div>
<div class="map-legend mt-1 small">
<img th:src="@{/assets/images/marker-icon-red.png}" id="red" />
<label for="red" class="me-2">Origin site</label>
<img th:src="@{/assets/images/marker-icon-blue.png}" id="blue" />
<label for="blue" class="me-2">Collecting site</label>
<img th:src="@{/assets/images/marker-icon-green.png}" id="green" />
<label for="green" class="me-2">Evaluation site</label>
<img th:src="@{/assets/images/marker-icon-purple.png}" id="purple" />
<label for="purple">Multi-purpose site</label>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<!--
<body>
<!--
Reusable fragment displaying a responsive row containing a label and a content.
The label argument is a string.
The content argument is a fragment which is displayed at the right of the label.
......@@ -19,14 +17,14 @@ into a block with the condition:
</th:block>
-->
<div th:fragment="row(label, content)" class="row f-row">
<div class="col-md-4 label pb-1 pb-md-0" th:text="${label}"></div>
<div class="col">
<th:block th:replace="${content}" />
</div>
</div>
<div th:fragment="row(label, content)" class="row f-row">
<div class="col-md-4 label pb-1 pb-md-0" th:text="${label}"></div>
<div class="col">
<th:block th:replace="${content}" />
</div>
</div>
<!--
<!--
Reusable fragment displaying a responsive row containing a label and a textual content.
The label argument is a string.
The text argument is a string which is displayed at the right of the label.
......@@ -40,11 +38,13 @@ into a block with the condition:
<div th:replace="fragments/row::text-row(label='Some label', text=${someTextExpression})"></div>
</th:block>
-->
<div th:fragment="text-row(label, text)" th:unless="${#strings.isEmpty(text)}" class="row f-row">
<div class="col-md-4 label pb-1 pb-md-0" th:text="${label}"></div>
<div class="col" th:text="${text}"></div>
</div>
</body>
<div
th:fragment="text-row(label, text)"
th:unless="${#strings.isEmpty(text)}"
class="row f-row"
>
<div class="col-md-4 label pb-1 pb-md-0" th:text="${label}"></div>
<div class="col" th:text="${text}"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<!--
<body>
<!--
Reusable fragment displaying the source and the data links of an entity (site, study or germplasm).
The source argument is a DataSource.
The url argument is a string, which is the URL of the entity.
......@@ -12,24 +10,32 @@ The entityType argument is a string, which is used in the message
"Link to this <entityType>".
-->
<th:block th:fragment="source(source, url, entityType)">
<th:block th:if="${source != null}">
<div th:replace="fragments/row::row(label='Source', content=~{::.source})">
<a class="source" target="_blank" th:href="${source.url}">
<img class="img-fluid" style="max-height: 60px;" th:src="${source.image}" th:alt="${source.name} + ' logo'" />
</a>
</div>
</th:block>
<th:block th:if="${url != null && source != null}">
<div th:replace="fragments/row::row(label='Data link', content=~{::.source-url})">
<a class="source-url" target="_blank" th:href="${url}">
Link to this <span th:text="${entityType}"></span> on <th:block th:text="${source.name}" />
</a>
</div>
</th:block>
</th:block>
</body>
<th:block th:fragment="source(source, url, entityType)">
<th:block th:if="${source != null}">
<div
th:replace="fragments/row::row(label='Source', content=~{::.source})"
>
<a class="source" target="_blank" th:href="${source.url}">
<img
class="img-fluid"
style="max-height: 60px"
th:src="${source.image}"
th:alt="${source.name} + ' logo'"
/>
</a>
</div>
</th:block>
<th:block th:if="${url != null && source != null}">
<div
th:replace="fragments/row::row(label='Data link', content=~{::.source-url})"
>
<a class="source-url" target="_blank" th:href="${url}">
Link to this <span th:text="${entityType}"></span> on
<th:block th:text="${source.name}" />
</a>
</div>
</th:block>
</th:block>
</body>
</html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<!--
<body>
<!--
Reusable fragment displaying a cross references section, with its title.
The unique argument (crossReferences) is a List<XRefDocumentVO>
-->
<div class="f-card" th:fragment="xrefs(crossReferences)" th:if="${!#lists.isEmpty(crossReferences)}">
<h2>Cross references</h2>
<div class="f-card-body">
<div class="scroll-table-container scroll-table-container-big">
<table class="table table-sm table-striped table-sticky table-responsive-sm">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Source</th>
<th scope="col">Type</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr th:each="crossRef : ${crossReferences}">
<td><a th:href="${crossRef.url}" target="_blank" th:text="${crossRef.name}"></a></td>
<td th:text="${crossRef.databaseName}"></td>
<td th:text="${crossRef.entryType}"></td>
<td style="min-width: 30rem;" th:text="${#strings.abbreviate(crossRef.description, 120)}"></td>
</tr>
</tbody>
</table>
<div
class="f-card"
th:fragment="xrefs(crossReferences)"
th:if="${!#lists.isEmpty(crossReferences)}"
>
<h2>Cross references</h2>
<div class="f-card-body">
<div class="scroll-table-container scroll-table-container-big">
<table
class="
table table-sm table-striped table-sticky table-responsive-sm
"
>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Source</th>
<th scope="col">Type</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr th:each="crossRef : ${crossReferences}">
<td>
<a
th:href="${crossRef.url}"
target="_blank"
th:text="${crossRef.name}"
></a>
</td>
<td th:text="${crossRef.databaseName}"></td>
<td th:text="${crossRef.entryType}"></td>
<td
style="min-width: 30rem"
th:text="${#strings.abbreviate(crossRef.description, 120)}"
></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</body>
</html>
......@@ -4,14 +4,14 @@
xmlns:th="http://www.thymeleaf.org"
th:replace="~{layout/main :: layout(title=~{::title}, content=~{::main})}"
>
<head>
<title>Faidare</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<head>
<title>Faidare</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<main>
<h1>Welcome to Faidare</h1>
</main>
</body>
<body>
<main>
<h1>Welcome to Faidare</h1>
</main>
</body>
</html>
<!DOCTYPE html>
<html lang="fr" th:fragment="layout (title, content, script)" xmlns:th="http://www.thymeleaf.org">
<html
lang="fr"
th:fragment="layout (title, content, script)"
xmlns:th="http://www.thymeleaf.org"
>
<head>
<title th:replace="${title}">Layout Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<link th:href="@{/assets/style.css}" rel="stylesheet">
<link th:href="@{/assets/style.css}" rel="stylesheet" />
<link rel="shortcut icon" th:href="@{/static/assets/images/favicon.ico}" type="image/x-icon" />
<link
rel="shortcut icon"
th:href="@{/static/assets/images/favicon.ico}"
type="image/x-icon"
/>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<span class="navbar-brand py-0">
<img th:src="@{/assets/images/logo.png}" style="height: 40px"/>
<img th:src="@{/assets/images/logo.png}" style="height: 40px" />
</span>
</div>
</nav>
......
......@@ -4,75 +4,130 @@
xmlns:th="http://www.thymeleaf.org"
th:replace="~{layout/main :: layout(title=~{::title}, content=~{::main}, script=~{::script})}"
>
<head>
<title>Site <th:block th:text="${model.site.locationName}" /></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<head>
<title>Site <th:block th:text="${model.site.locationName}" /></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<main>
<h1>Site <th:block th:text="${model.site.locationName}" /></h1>
<body>
<main>
<h1>Site <th:block th:text="${model.site.locationName}" /></h1>
<div th:replace="fragments/map::map"></div>
<div th:replace="fragments/map::map"></div>
<div class="f-card mt-4">
<h2>Details</h2>
<div class="f-card-body">
<th:block th:if="${model.site.uri != null && !model.site.uri.startsWith('urn:')}">
<div th:replace="fragments/row::text-row(label='Permanent unique identifier', text=${model.site.uri})"></div>
</th:block>
<div class="f-card mt-4">
<h2>Details</h2>
<div class="f-card-body">
<th:block
th:if="${model.site.uri != null && !model.site.uri.startsWith('urn:')}"
>
<div
th:replace="fragments/row::text-row(label='Permanent unique identifier', text=${model.site.uri})"
></div>
</th:block>
<div th:replace="fragments/source::source(source=${model.source}, url=${model.site.url}, entityType='site')"></div>
<div
th:replace="fragments/source::source(source=${model.source}, url=${model.site.url}, entityType='site')"
></div>
<div th:replace="fragments/row::text-row(label='Abbreviation', text=${model.site.abbreviation})"></div>
<div th:replace="fragments/row::text-row(label='Type', text=${model.site.locationType})"></div>
<div th:replace="fragments/row::text-row(label='Status', text=${model.siteStatus})"></div>
<div th:replace="fragments/row::text-row(label='Institution/Landowner', text=${model.site.instituteName})"></div>
<div th:replace="fragments/row::text-row(label='Institution address', text=${model.site.instituteAddress})"></div>
<div th:replace="fragments/row::text-row(label='Coordinates precision', text=${model.coordinatesPrecision})"></div>
<th:block th:if="${model.site.latitude}">
<div th:replace="fragments/row::text-row(label='Latitude', text=${#coordinates.formatLatitude(model.site.latitude)})"></div>
</th:block>
<th:block th:if="${model.site.longitude}">
<div th:replace="fragments/row::text-row(label='Longitude', text=${#coordinates.formatLongitude(model.site.longitude)})"></div>
</th:block>
<div th:replace="fragments/row::text-row(label='Geographical location', text=${model.geographicalLocation})"></div>
<th:block th:if="${model.site.countryName != null && model.geographicalLocation == null}">
<div th:replace="fragments/row::text-row(label='Country name', text=${model.site.countryName})"></div>
</th:block>
<div
th:replace="fragments/row::text-row(label='Abbreviation', text=${model.site.abbreviation})"
></div>
<div
th:replace="fragments/row::text-row(label='Type', text=${model.site.locationType})"
></div>
<div
th:replace="fragments/row::text-row(label='Status', text=${model.siteStatus})"
></div>
<div
th:replace="fragments/row::text-row(label='Institution/Landowner', text=${model.site.instituteName})"
></div>
<div
th:replace="fragments/row::text-row(label='Institution address', text=${model.site.instituteAddress})"
></div>
<div
th:replace="fragments/row::text-row(label='Coordinates precision', text=${model.coordinatesPrecision})"
></div>
<th:block th:if="${model.site.latitude}">
<div
th:replace="fragments/row::text-row(label='Latitude', text=${#coordinates.formatLatitude(model.site.latitude)})"
></div>
</th:block>
<th:block th:if="${model.site.longitude}">
<div
th:replace="fragments/row::text-row(label='Longitude', text=${#coordinates.formatLongitude(model.site.longitude)})"
></div>
</th:block>
<div
th:replace="fragments/row::text-row(label='Geographical location', text=${model.geographicalLocation})"
></div>
<th:block
th:if="${model.site.countryName != null && model.geographicalLocation == null}"
>
<div
th:replace="fragments/row::text-row(label='Country name', text=${model.site.countryName})"
></div>
</th:block>
<th:block th:if="${model.site.countryCode != null && model.geographicalLocation == null}">
<div th:replace="fragments/row::text-row(label='Country code', text=${model.site.countryName})"></div>
</th:block>
<th:block
th:if="${model.site.countryCode != null && model.geographicalLocation == null}"
>
<div
th:replace="fragments/row::text-row(label='Country code', text=${model.site.countryName})"
></div>
</th:block>
<div th:replace="fragments/row::text-row(label='Altitude', text=${model.site.altitude})"></div>
<div th:replace="fragments/row::text-row(label='Slope', text=${model.slope})"></div>
<div th:replace="fragments/row::text-row(label='Exposure', text=${model.exposure})"></div>
<div th:replace="fragments/row::text-row(label='Topography', text=${model.topography})"></div>
<div th:replace="fragments/row::text-row(label='Environment type', text=${model.environmentType})"></div>
<div th:replace="fragments/row::text-row(label='Distance to city', text=${model.distanceToCity})"></div>
<div th:replace="fragments/row::text-row(label='Direction from city', text=${model.directionFromCity})"></div>
<div th:replace="fragments/row::text-row(label='Comment', text=${model.comment})"></div>
</div>
</div>
<div
th:replace="fragments/row::text-row(label='Altitude', text=${model.site.altitude})"
></div>
<div
th:replace="fragments/row::text-row(label='Slope', text=${model.slope})"
></div>
<div
th:replace="fragments/row::text-row(label='Exposure', text=${model.exposure})"
></div>
<div
th:replace="fragments/row::text-row(label='Topography', text=${model.topography})"
></div>
<div
th:replace="fragments/row::text-row(label='Environment type', text=${model.environmentType})"
></div>
<div
th:replace="fragments/row::text-row(label='Distance to city', text=${model.distanceToCity})"
></div>
<div
th:replace="fragments/row::text-row(label='Direction from city', text=${model.directionFromCity})"
></div>
<div
th:replace="fragments/row::text-row(label='Comment', text=${model.comment})"
></div>
</div>
</div>
<div class="f-card" th:unless="${#lists.isEmpty(model.additionalInfoProperties)}">
<h2>Additional info</h2>
<div class="f-card-body">
<th:block th:each="prop : ${model.additionalInfoProperties}">
<div th:replace="fragments/row::text-row(label=${prop.key}, text=${prop.value})"></div>
</th:block>
</div>
</div>
<div
class="f-card"
th:unless="${#lists.isEmpty(model.additionalInfoProperties)}"
>
<h2>Additional info</h2>
<div class="f-card-body">
<th:block th:each="prop : ${model.additionalInfoProperties}">
<div
th:replace="fragments/row::text-row(label=${prop.key}, text=${prop.value})"
></div>
</th:block>
</div>
</div>
<div th:replace="fragments/xrefs::xrefs(crossReferences=${model.crossReferences})"></div>
</main>
<div
th:replace="fragments/xrefs::xrefs(crossReferences=${model.crossReferences})"
></div>
</main>
<script th:inline="javascript">
faidare.initializeMap({
contextPath: [[${#request.getContextPath()}]],
locations: /* TODO [[${model.mapLocations}]]*/ []
});
</script>
</body>
<script th:inline="javascript">
faidare.initializeMap({
contextPath: [[${#request.getContextPath()}]],
locations: /* TODO [[${model.mapLocations}]]*/ []
});
</script>
</body>
</html>