Commit a1a1b70c authored by Jean-Baptiste Nizet's avatar Jean-Baptiste Nizet Committed by Exbrayat Cédric
Browse files

feat: implement styling

parent 8bbe24fb
......@@ -11,7 +11,7 @@ Its unique argument (institute) is an InstituteVO
<th:block th:fragment="institute(institute)">
<div class="text-center py-2" th:if="${institute.logo}">
<img th:src="${institute.logo}" th:alt="${institute.instituteName}"/>
<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>
......
......@@ -10,7 +10,7 @@ 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">
<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"/>
......
......@@ -19,7 +19,7 @@ into a block with the condition:
</th:block>
-->
<div th:fragment="row(label, content)" class="row py-2">
<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}" />
......@@ -40,7 +40,7 @@ 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 py-2">
<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>
......
......@@ -16,7 +16,7 @@ The entityType argument is a string, which is used in the message
<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 style="max-height: 60px;" th:src="${source.image}" th:alt="${source.name} + ' logo'" />
<img class="img-fluid" style="max-height: 60px;" th:src="${source.image}" th:alt="${source.name} + ' logo'" />
</a>
</div>
</th:block>
......
......@@ -9,12 +9,11 @@ Reusable fragment displaying a cross references section, with its title.
The unique argument (crossReferences) is a List<XRefDocumentVO>
-->
<div th:fragment="xrefs(crossReferences)" th:if="${!#lists.isEmpty(crossReferences)}">
<div class="f-card" th:fragment="xrefs(crossReferences)" th:if="${!#lists.isEmpty(crossReferences)}">
<h2>Cross references</h2>
<div class="table-responsive scroll-big-table table-card-body">
<div class="card">
<table class="table table-sm table-striped">
<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>
......@@ -28,13 +27,12 @@ The unique argument (crossReferences) is a List<XRefDocumentVO>
<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 th:text="${#strings.abbreviate(crossRef.description, 120)}"></td>
<td style="min-width: 30rem;" th:text="${#strings.abbreviate(crossRef.description, 120)}"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
......
......@@ -20,7 +20,7 @@
<div th:replace="fragments/map::map"></div>
<div class="row align-items-center justify-content-center">
<div class="row align-items-center justify-content-center mt-4">
<div class="col-auto field" th:if="${model.germplasm.photo != null && model.germplasm.photo.thumbnailFile != null}">
<template id="photo-popover">
<div class="card">
......@@ -34,8 +34,10 @@
</div>
</template>
<button class="btn btn-link p-0"
<a role="button"
class="d-flex flex-column align-items-center"
data-bs-toggle="popover"
tabindex="0"
th:data-bs-title="${model.germplasm.photo.photoName}"
data-bs-element="#photo-popover"
data-bs-container="body"
......@@ -45,13 +47,14 @@
<figcaption class="figure-caption">
© <span th:text="${model.germplasm.photo.copyright}"></span>
</figcaption>
</button>
</a>
</div>
<div class="col-12 col-lg">
<div class="f-card">
<h2>Identification</h2>
<div class="f-card-body">
<div th:replace="fragments/row::text-row(label='Germplasm name', text=${model.germplasm.germplasmName})"></div>
<div th:replace="fragments/row::text-row(label='Accession number', text=${model.germplasm.accessionNumber})"></div>
......@@ -119,7 +122,8 @@
</div>
</th:block>
</template>
<button class="btn btn-link p-0"
<a role="button"
tabindex="0"
data-bs-toggle="popover"
th:data-bs-title="${model.taxon}"
data-bs-element="#taxon-popover"
......@@ -127,7 +131,7 @@
data-bs-trigger="focus">
<em th:text="${model.taxon}"></em>
<th:block th:unless="${#strings.isEmpty(model.taxonAuthor)}">(<span th:text="${model.taxonAuthor}"></span>)</th:block>
</button>
</a>
</div>
</div>
</th:block>
......@@ -145,21 +149,25 @@
</th:block>
</div>
</div>
</div>
</div>
<th:block th:if="${model.germplasm.holdingInstitute}">
<div class="f-card" th:if="${model.germplasm.holdingInstitute}">
<h2>Depositary</h2>
<div class="f-card-body">
<template id="holding-institute-popover">
<div th:replace="fragments/institute::institute(institute=${model.germplasm.holdingInstitute})"></div>
</template>
<div th:replace="fragments/row::row(label='Institution', content=~{::#institution})">
<button id="institution"
<a id="institution"
role="button"
tabindex="0"
data-bs-toggle="popover"
th:data-bs-title="${model.germplasm.holdingInstitute.instituteName}"
data-bs-element="#holding-institute-popover"
data-bs-container="body"
data-bs-trigger="focus"
class="btn btn-link p-0"
th:text="${model.germplasm.holdingInstitute.instituteName}"></button>
th:text="${model.germplasm.holdingInstitute.instituteName}"></a>
</div>
<th:block th:if="${model.germplasm.holdingGenbank != null && !#strings.isEmpty(model.germplasm.holdingGenbank.instituteName) && !#strings.isEmpty(model.germplasm.holdingGenbank.webSite)}">
......@@ -172,10 +180,12 @@
</th:block>
<div th:replace="fragments/row::text-row(label='Presence status', text=${model.germplasm.presenceStatus})"></div>
</th:block>
</div>
</div>
<th:block th:if="${model.collecting}">
<div class="f-card" th:if="${model.collecting}">
<h2>Collector</h2>
<div class="f-card-body">
<th:block th:if="${model.germplasm.collectingSite != null && !#strings.isEmpty(model.germplasm.collectingSite.siteName)}">
<div th:replace="fragments/row::row(label='Collecting site', content=~{::#collecting-site})">
<a id="collecting-site"
......@@ -197,35 +207,39 @@
<div th:replace="fragments/institute::institute(institute=${model.germplasm.collector.institute})"></div>
</template>
<div th:replace="fragments/row::row(label='Institution', content=~{::#collecting-institution})">
<button id="collecting-institution"
<a id="collecting-institution"
role="button"
tabindex="0"
data-bs-toggle="popover"
th:data-bs-title="${model.germplasm.collector.institute.instituteName}"
data-bs-element="#collector-institute-popover"
data-bs-container="body"
data-bs-trigger="focus"
class="btn btn-link p-0"
th:text="${model.germplasm.collector.institute.instituteName}"></button>
th:text="${model.germplasm.collector.institute.instituteName}"></a>
</div>
</th:block>
<div th:replace="fragments/row::text-row(label='Accession number', text=${model.germplasm.collector.accessionNumber})"></div>
</th:block>
</div>
</div>
<th:block th:if="${model.breeding}">
<div class="f-card" th:if="${model.breeding}">
<h2>Breeder</h2>
<div class="f-card-body">
<th:block th:if="${model.germplasm.breeder.institute != null && !#strings.isEmpty(model.germplasm.breeder.institute.instituteName)}">
<template id="breeder-institute-popover">
<div th:replace="fragments/institute::institute(institute=${model.germplasm.breeder.institute})"></div>
</template>
<div th:replace="fragments/row::row(label='Institute', content=~{::#breeding-institution})">
<button id="breeding-institution"
<a id="breeding-institution"
role="button"
tabindex="0"
data-bs-toggle="popover"
th:data-bs-title="${model.germplasm.breeder.institute.instituteName}"
data-bs-element="#breeder-institute-popover"
data-bs-container="body"
data-bs-trigger="focus"
class="btn btn-link p-0"
th:text="${model.germplasm.breeder.institute.instituteName}"></button>
th:text="${model.germplasm.breeder.institute.instituteName}"></a>
</div>
</th:block>
......@@ -233,13 +247,14 @@
<div th:replace="fragments/row::text-row(label='Accession number', text=${model.germplasm.breeder.accessionNumber})"></div>
<div th:replace="fragments/row::text-row(label='Catalog registration year', text=${model.germplasm.breeder.registrationYear})"></div>
<div th:replace="fragments/row::text-row(label='Catalog deregistration year', text=${model.germplasm.breeder.deregistrationYear})"></div>
</th:block>
</div>
</div>
<th:block th:unless="${#lists.isEmpty(model.germplasm.donors)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.germplasm.donors)}">
<h2>Donors</h2>
<div class="table-responsive scroll-table table-card-body">
<div class="card">
<table class="table table-sm table-striped">
<div class="f-card-body">
<div class="scroll-table-container">
<table class="table table-sm table-striped table-sticky table-responsive-sm">
<thead>
<tr>
<th scope="col">Institute name</th>
......@@ -255,13 +270,14 @@
<template th:id="${'donor-institute-popover-' + donorIterStat.index}">
<div th:replace="fragments/institute::institute(institute=${row.donorInstitute})"></div>
</template>
<button data-bs-toggle="popover"
<a role="button"
tabindex="0"
data-bs-toggle="popover"
th:data-bs-title="${row.donorInstitute.instituteName}"
th:data-bs-element="${'#donor-institute-popover-' + donorIterStat.index}"
data-bs-container="body"
data-bs-trigger="focus"
class="btn btn-link p-0"
th:text="${row.donorInstitute.instituteName}"></button>
th:text="${row.donorInstitute.instituteName}"></a>
</td>
<td th:text="${row.donorInstituteCode}"></td>
<td th:text="${row.donationDate}"></td>
......@@ -272,13 +288,13 @@
</table>
</div>
</div>
</th:block>
</div>
<th:block th:unless="${#lists.isEmpty(model.germplasm.distributors)}">
<h2>Donors</h2>
<div class="table-responsive scroll-table table-card-body">
<div class="card">
<table class="table table-sm table-striped">
<div class="f-card" th:unless="${#lists.isEmpty(model.germplasm.distributors)}">
<h2>Distributors</h2>
<div class="f-card-body">
<div class="scroll-table-container">
<table class="table table-sm table-striped table-sticky table-responsive-sm">
<thead>
<tr>
<th scope="col">Institute</th>
......@@ -292,13 +308,13 @@
<template th:id="${'distributor-institute-popover-' + distributorIterStat.index}">
<div th:replace="fragments/institute::institute(institute=${row.institute})"></div>
</template>
<button data-bs-toggle="popover"
<a role="button"
tabindex="0"
th:data-bs-title="${row.institute.instituteName}"
th:data-bs-element="${'#distributor-institute-popover-' + distributorIterStat.index}"
data-bs-container="body"
data-bs-trigger="focus"
class="btn btn-link p-0"
th:text="${row.institute.instituteName}"></button>
th:text="${row.institute.instituteName}"></a>
</td>
<td th:text="${row.accessionNumber}"></td>
<td th:text="${row.distributionStatus}"></td>
......@@ -307,18 +323,20 @@
</table>
</div>
</div>
</th:block>
</div>
<th:block th:unless="${#lists.isEmpty(model.attributes)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.attributes)}">
<h2>Evaluation Data</h2>
<div class="f-card-body">
<th:block th:each="descriptor : ${model.attributes}">
<div th:replace="fragments/row::text-row(label=${descriptor.attributeName}, text=${descriptor.value})"></div>
</th:block>
</th:block>
</div>
</div>
<th:block th:if="${model.genealogyPresent}">
<div class="f-card" th:if="${model.genealogyPresent}">
<h2>Genealogy</h2>
<div class="f-card-body">
<th:block th:if="${model.pedigree != null}">
<div th:replace="fragments/row::text-row(label='Crossing plan', text=${model.pedigree.crossingPlan})"></div>
<div th:replace="fragments/row::text-row(label='Crossing year', text=${model.pedigree.crossingYear})"></div>
......@@ -354,7 +372,7 @@
<th:block th:unless="${#lists.isEmpty(model.germplasm.children)}">
<div th:replace="fragments/row::row(label='Descendants', content=~{::#descendants})">
<div id="descendants" class="content-overflow-big">
<div id="descendants" class="content-overflow content-overflow-big">
<th:block th:each="child : ${model.germplasm.children}">
<div th:replace="fragments/row::row(label=${#strings.isEmpty(child.secondParentName) ? ('children of ' + child.firstParentName) : ('children of ' + child.firstParentName + ' x ' + child.secondParentName) }, content=~{::.descendant-child})">
<div class="descendant-child">
......@@ -368,11 +386,12 @@
</div>
</div>
</th:block>
</div>
</div>
</th:block>
<th:block th:unless="${#lists.isEmpty(model.germplasm.population)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.germplasm.population)}">
<h2>Population</h2>
<div class="f-card-body">
<th:block th:each="population : ${model.germplasm.population}">
<th:block th:if="${population.germplasmRef != null}">
......@@ -396,23 +415,28 @@
<!-- TODO there was a link pointing at a search here -->
</th:block>
</th:block>
</th:block>
</div>
</div>
<th:block th:unless="${#lists.isEmpty(model.germplasm.collection)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.germplasm.collection)}">
<h2>Collection</h2>
<div class="f-card-body">
<th:block th:each="collection : ${model.germplasm.collection}">
<div th:replace="fragments/row::text-row(label=${#faidare.collPopTitle(collection)}, text=${collection.germplasmCount + ' accession(s)'})"></div>
<!-- TODO there was a link pointing at a search here -->
</th:block>
</th:block>
</div>
</div>
<th:block th:unless="${#lists.isEmpty(model.germplasm.panel)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.germplasm.panel)}">
<h2>Panel</h2>
<div class="f-card-body">
<th:block th:each="panel : ${model.germplasm.panel}">
<div th:replace="fragments/row::text-row(label=${#faidare.collPopTitleWithoutUnderscores(panel)}, text=${panel.germplasmCount + ' accession(s)'})"></div>
<!-- TODO there was a link pointing at a search here -->
</th:block>
</th:block>
</div>
</div>
<div th:replace="fragments/xrefs::xrefs(crossReferences=${model.crossReferences})"></div>
</main>
......
......@@ -12,18 +12,17 @@
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<header>
Common header
</header>
<span class="navbar-brand py-0">
<img th:src="@{/assets/images/logo.png}" style="height: 40px"/>
</span>
</div>
</nav>
<div class="container mt-3">
<div th:replace="${content}">
<p>Layout content</p>
</div>
<footer>
common footer
</footer>
</div>
<script type="text/javascript" th:src="@{/assets/script.js}"></script>
<script type="text/javascript" th:replace="${script}"></script>
......
......@@ -15,6 +15,9 @@
<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>
......@@ -50,13 +53,17 @@
<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>
<th:block th:unless="${#lists.isEmpty(model.additionalInfoProperties)}">
<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>
</th:block>
</div>
</div>
<div th:replace="fragments/xrefs::xrefs(crossReferences=${model.crossReferences})"></div>
</main>
......
......@@ -15,8 +15,9 @@
<div th:replace="fragments/map::map"></div>
<div class="f-card mt-4">
<h2>Identification</h2>
<div class="f-card-body">
<div th:replace="fragments/row::text-row(label='Name', text=${model.study.studyName})"></div>
<div th:replace="fragments/row::text-row(label='Identifier', text=${model.study.studyDbId})"></div>
......@@ -53,13 +54,14 @@
</ul>
</div>
</th:block>
</div>
</div>
<th:block th:unles="${#lists.isEmpty(model.germplasms)}">
<div class="f-card" th:unles="${#lists.isEmpty(model.germplasms)}">
<h2>Genotype</h2>
<div class="table-responsive scroll-table table-card-body">
<div class="card">
<table class="table table-sm table-striped">
<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">Accession number</th>
......@@ -79,13 +81,13 @@
</table>
</div>
</div>
</th:block>
</div>
<th:block th:unless="${#lists.isEmpty(model.variables)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.variables)}">
<h2>Variables</h2>
<div class="table-responsive scroll-table table-card-body">
<div class="card">
<table class="table table-sm table-striped">
<div class="f-card-body">
<div class="scroll-table-container">
<table class="table table-sm table-striped table-sticky table-responsive-sm">
<thead>
<tr>
<th scope="col">Variable ID</th>
......@@ -110,13 +112,13 @@
</table>
</div>
</div>
</th:block>
</div>
<th:block th:unless="${#lists.isEmpty(model.trials)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.trials)}">
<h2>Data Set</h2>
<div class="table-responsive scroll-big-table table-card-body">
<div class="card">
<table class="table table-sm table-striped">
<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>
......@@ -144,13 +146,13 @@
</table>
</div>
</div>
</th:block>
</div>
<th:block th:unless="${#lists.isEmpty(model.study.contacts)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.study.contacts)}">
<h2>Contact</h2>
<div class="table-responsive scroll-table table-card-body">
<div class="card">
<table class="table table-sm table-striped">
<div class="f-card-body">
<div class="scroll-table-container">
<table class="table table-sm table-striped table-sticky table-responsive-sm">
<thead>
<tr>
<th scope="col">Role</th>
......@@ -170,23 +172,23 @@
</table>
</div>
</div>
</th:block>
</div>
<th:block th:unless="${#lists.isEmpty(model.additionalInfoProperties)}">
<div class="f-card" th:unless="${#lists.isEmpty(model.additionalInfoProperties)}">
<h2>Additional information</h2>
<div class="table-responsive scroll-table table-card-body">
<div class="card">
<table class="table table-sm table-striped">
<div class="f-card-body">
<div class="scroll-table-container">
<table class="table table-sm">
<tbody>
<tr th:each="row : ${model.additionalInfoProperties}">
<td style="width: 50%;" th:text="${row.key}"></td>
<th class="label" style="width: 33.33%" th:text="${row.key}" scope="row"></th>
<td th:text="${row.value}"></td>
</tr>
</tbody>
</table>
</div>
</div>
</th:block>
</div>
<div th:replace="fragments/xrefs::xrefs(crossReferences=${model.crossReferences})"></div>
</main>
......
$headings-color: #0f6191;
$border-color: #0f6e9f;
$link-color: #0f6fa1;
$link-decoration: none;
$link-hover-decoration: underline;
$enable-shadows: true;
$table-border-color: #dee2e6;
$table-group-separator-color: $table-border-color;
@import 'custom-bootstrap';
@import '~leaflet/dist/leaflet.css';
@import '~leaflet.markercluster/dist/MarkerCluster.css';
@import '~leaflet.markercluster/dist/MarkerCluster.Default.css';
.label {
font-weight: 500;
a[role=button] {
color: $link-color !important;
}
.f-row {
border-top: 1px solid $gray-300;
padding: 0.5rem 0;
.label {
font-weight: 700;
}
}
.f-card {
border: 1px solid $border-color;
border-radius: 0.25rem;
margin: 0.5rem 0;
h2 {
font-size: $h4-font-size;
padding: 0.5rem 1rem;
background-image: repeating-linear-gradient(#0f96cd, #0f6191, #0f76a5);
color: $white;
}
.f-card-body {
padding: 0.25rem 1rem;
.f-row:first-of-type {
border-top: 0;
}
}
}
.popover {
max-width: min(80vw, 600px);
max-width: min(80vw, 500px);