Commit ab21b45e authored by Matija Obreza's avatar Matija Obreza

Display of latin names updated

parent 01f7cfc1
......@@ -9,6 +9,8 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
public class Taxonomy {
private String sciName;
private String sciNameHtml;
@Field(index = FieldIndex.not_analyzed, type = FieldType.String)
private String genus;
@Field(index = FieldIndex.not_analyzed, type = FieldType.String)
......@@ -29,6 +31,7 @@ public class Taxonomy {
}
Taxonomy t = new Taxonomy();
t.sciName = taxonomy.getTaxonName();
t.sciNameHtml = taxonomy.getTaxonNameHtml();
t.genus = taxonomy.getGenus();
t.species = taxonomy.getSpecies();
t.genusSpecies = taxonomy.getGenus() + " " + taxonomy.getSpecies();
......@@ -45,6 +48,14 @@ public class Taxonomy {
public void setSciName(String sciName) {
this.sciName = sciName;
}
public String getSciNameHtml() {
return sciNameHtml;
}
public void setSciNameHtml(String sciNameHtml) {
this.sciNameHtml = sciNameHtml;
}
public String getGenus() {
return genus;
......
......@@ -27,6 +27,7 @@ import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.PrePersist;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang.StringUtils;
......@@ -122,6 +123,23 @@ public class Taxonomy2 extends GlobalVersionedAuditedModel {
}
return sb.toString();
}
@Transient
public String getTaxonNameHtml() {
final StringBuilder sb = new StringBuilder();
sb.append("<i>").append(genus).append(" ").append(species).append("</i>");
if (StringUtils.isNotBlank(spAuthor)) {
sb.append(" ").append(spAuthor);
}
if (StringUtils.isNotBlank(subtaxa)) {
sb.append(" <i>").append(subtaxa).append("</i>");
}
if (StringUtils.isNotBlank(subtAuthor)) {
sb.append(" ").append(subtAuthor);
}
return sb.toString();
}
public void setTaxonName(String taxonName) {
// Ignore what they provide
......
......@@ -2567,7 +2567,6 @@ table.accessions {
font-family: $default-font-family;
font-size: 12px;
.sci-name {
font-style: italic;
direction: ltr;
}
thead tr {
......@@ -2781,7 +2780,6 @@ table.accessions {
span {
display: inline;
&.sci-name {
font-style: italic;
direction: ltr;
}
}
......
......@@ -120,7 +120,7 @@
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12" property="dwc:genus">
<p>
<a href="<c:url value="/acn/t/${accession.taxonomy.genus}" />"><span dir="ltr" class="sci-name">
<c:out value="${accession.taxonomy.genus}" />
<i><c:out value="${accession.taxonomy.genus}" /></i>
</span></a>
</p>
</div>
......@@ -134,9 +134,9 @@
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<p>
<a href="<c:url value="/acn/t/${accession.taxonomy.genus}/${accession.taxonomy.species}" />"><span class="sci-name" dir="ltr">
<c:out value="${accession.taxonomy.genus} ${accession.taxonomy.species}" />
</span></a> &mdash; <a href="<c:url value="/wiews/${accession.institute.code}/t/${accession.taxonomy.genus}/${accession.taxonomy.species}" />"><spring:message code="accession.taxonomy-at-institute"
arguments="${accession.taxonomy.genus} ${accession.taxonomy.species}|||${accession.institute.code}" argumentSeparator="|||" /></a>
<i><c:out value="${accession.taxonomy.genus} ${accession.taxonomy.species}" /></i>
</span></a> &mdash; <a href="<c:url value="/wiews/${accession.institute.code}/t/${accession.taxonomy.genus}/${accession.taxonomy.species}" />"><spring:message code="accession.taxonomy-at-institute" htmlEscape="false"
arguments="<i>${accession.taxonomy.genus} ${accession.taxonomy.species}</i>|||${accession.institute.code}" argumentSeparator="|||" /></a>
</p>
</div>
</div>
......@@ -150,7 +150,7 @@
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<p>
<span dir="ltr" class="sci-name">
<c:out value="${accession.taxonomy.taxonName}" />
<c:out escapeXml="false" value="${accession.taxonomy.taxonNameHtml}" />
</span>
</p>
</div>
......
......@@ -196,7 +196,7 @@
<c:forEach items="${selectedColumns}" var="col" varStatus="i">
<c:choose>
<c:when test="${col eq 'taxonomy.sciName'}">
<td class="<c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><c:out value="${accession.taxonomy.sciName}"/></span></p></td>
<td class="<c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><c:out escapeXml="false" value="${accession.taxonomy.sciNameHtml}"/></span></p></td>
</c:when>
<c:when test="${col eq 'orgCty'}">
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><c:out value="${jspHelper.getCountry(accession.orgCty.iso3).getName(pageContext.response.locale)}"/></p></td>
......@@ -218,13 +218,13 @@
value="${accession.institute.code}"/></a></p></td>
</c:when>
<c:when test="${col eq 'taxonomy.genus'}">
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><c:out value="${accession.taxonomy.genus}"/></span></p></td>
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><i><c:out value="${accession.taxonomy.genus}"/></i></span></p></td>
</c:when>
<c:when test="${col eq 'taxonomy.species'}">
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><c:out value="${accession.taxonomy.species}"/></span></p></td>
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><i><c:out value="${accession.taxonomy.species}"/></i></span></p></td>
</c:when>
<c:when test="${col eq 'taxonomy.subtaxa'}">
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><c:out value="${accession.taxonomy.subtaxa}"/></span></p></td>
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><i><c:out value="${accession.taxonomy.subtaxa}"/></i></span></p></td>
</c:when>
<c:when test="${col eq 'crops'}">
<c:if test="${fn:length(accession.crops) == 0}">
......@@ -762,8 +762,9 @@
$("<span/>", {
dir: 'ltr',
'class': 'sci-name',
text: pagedData.content[i].taxonomy.sciName
}).appendTo($("<p></p>").appendTo($("<td class='<c:if test="${i.count ge 2}">hidden-xs</c:if> <c:if test="${i.count gt 2}">hidden-sm</c:if>'></td>").appendTo(row)));
html: pagedData.content[i].taxonomy.sciNameHtml
}).appendTo($("<p></p>").appendTo($("<td class='<c:if test="${i.count ge 2}">hidden-xs</c:if> <c:if test="${i.count gt 2}">hidden-sm</c:if>'></td>")
.appendTo(row)));
</c:when>
<c:when test="${col eq 'orgCty'}">
$("<p/>", {
......@@ -802,31 +803,31 @@
}).appendTo(row)));
</c:when>
<c:when test="${col eq 'taxonomy.genus'}">
$("<span/>", {
$("<i/>", { text: pagedData.content[i].taxonomy.genus })
.appendTo($("<span/>", {
dir: "ltr",
'class': "sci-name",
text: pagedData.content[i].taxonomy.genus
'class': "sci-name"
}).appendTo($("<p></p>").appendTo($("<td/>", {
'class': "notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"
}).appendTo(row)));
}).appendTo(row))));
</c:when>
<c:when test="${col eq 'taxonomy.species'}">
$("<span/>", {
dir: "ltr",
'class': "sci-name",
text: pagedData.content[i].taxonomy.species
}).appendTo($("<p></p>").appendTo($("<td/>", {
$("<i/>", { text: pagedData.content[i].taxonomy.species })
.appendTo($("<span/>", {
dir: "ltr",
'class': "sci-name"
}).appendTo($("<p></p>").appendTo($("<td/>", {
'class': "notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"
}).appendTo(row)));
}).appendTo(row))));
</c:when>
<c:when test="${col eq 'taxonomy.subtaxa'}">
$("<span/>", {
dir: "ltr",
'class': "sci-name",
text: pagedData.content[i].taxonomy.subtaxa
}).appendTo($("<p></p>").appendTo($("<td/>", {
$("<i/>", { text: pagedData.content[i].taxonomy.subtaxa })
.appendTo($("<span/>", {
dir: "ltr",
'class': "sci-name"
}).appendTo($("<p></p>").appendTo($("<td/>", {
'class': "notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"
}).appendTo(row)));
}).appendTo(row))));
</c:when>
<c:when test="${col eq 'crops'}">
var cropNamesTd = $("<td/>", {
......
......@@ -483,22 +483,23 @@
}
case "genus":
{
$("<a />", {
href: "/acn/t/" + terms[i].term,
text: terms[i].term
}).appendTo(divText);
$("<i />", { text: terms[i].term })
.appendTo($("<a />", {
href: "/acn/t/" + terms[i].term
})).appendTo(divText);
break;
}
case "species":
{
span.text(terms[i].term).appendTo(divText);
$("<i />", { text: terms[i].term }).appendTo(divText);
break;
}
default:
{
if (type.startsWith('i18n')) {
var key = type.substring(5) + '.' + terms[i].term;
span.addClass("sci-name").text(messages[key]).appendTo(divText);
$("<span />", { text: messages[key] })
.appendTo(divText);
}
else {
span.text(terms[i].term).appendTo(divText);
......
......@@ -127,7 +127,7 @@
<td><a href="<c:url value="/acn/id/${accession.id}" />"><b><c:out value="${accession.accessionName}" /></b></a></td>
<%-- <td><a href="<c:url value="/geo/${accession.origin}" />"><c:out value="${accession.countryOfOrigin.getName(pageContext.response.locale)}" /></a></td>
--%>
<td><span dir="ltr" class="sci-name"><c:out value="${accession.taxonomy.taxonName}" /></span></td>
<td><span dir="ltr" class="sci-name"><c:out escapeXml="false" value="${accession.taxonomy.taxonNameHtml}" /></span></td>
<%-- <td><a href="<c:url value="/wiews/${accession.institute.code}" />"><c:out value="${accession.institute.code}" /></a></td>
<td><a href="<c:url value="/geo/${accession.institute.country.code3}" />"><c:out value="${accession.institute.country.getName(pageContext.response.locale)}" /></a></td>
--%>
......
......@@ -39,7 +39,7 @@
</c:choose>
</div>
<div class="col-sm-4">
<span dir="ltr" class="sci-name text-clip"><c:out value="${accession.taxonomy.taxonName}" /></span>
<span dir="ltr" class="sci-name text-clip"><c:out escapeXml="false" value="${accession.taxonomy.taxonNameHtml}" /></span>
</div>
<div class="col-sm-4">
<a href="https://purl.org/germplasm/id/${accession.uuid}"><c:out value="${accession.uuid}" /></a>
......
......@@ -387,7 +387,7 @@
<div class="col-lg-8 col-md-6 col-sm-6 col-xs-6 ${status.count % 2 == 0 ? 'even' : 'odd'}">
<%-- <span class="index-number">${status.count + pagedData.size * pagedData.number}</span> --%>
<a title="<spring:message code="faoInstitute.link-species-data" arguments="${faoInstitute.fullName}|${faoInstitute.acronym}|${stat[0]}" argumentSeparator="|" />" href="<c:url value="/wiews/${faoInstitute.code}/t/${stat[0]}" />">
<span dir="ltr" class="sci-name"><c:out value="${stat[0]}" /></span>
<span dir="ltr" class="sci-name"><i><c:out value="${stat[0]}" /></i></span>
</a>
</div>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-6 ${status.count % 2 == 0 ? 'even' : 'odd'}">
......@@ -416,7 +416,7 @@
<%-- <span class="index-number">${status.count + pagedData.size * pagedData.number}</span> --%>
<a title="<spring:message code="faoInstitute.link-species-data" arguments="${faoInstitute.fullName}|${faoInstitute.acronym}|${stat[0].genus} ${stat[0].species}" argumentSeparator="|" />" href="<c:url value="/wiews/${faoInstitute.code}/t/${stat[0].genus}/${stat[0].species}" />">
<span dir="ltr" class="sci-name">
<c:out value="${stat[0].taxonName}" />
<c:out escapeXml="false" value="${stat[0].taxonNameHtml}" />
</span>
</a>
</div>
......
......@@ -39,13 +39,13 @@
<spring:message code="boolean.false" />
</c:when>
<c:when test="${type ne null && type.startsWith('i18n')}">
<span class="sci-name"><spring:message code="${type.substring(5).concat('.').concat(term.term)}" /></span>
<span><spring:message code="${type.substring(5).concat('.').concat(term.term)}" /></span>
</c:when>
<c:when test="${type=='genus'}">
<a href="<c:url value="/acn/t/${term.term}" />"><span dir="ltr" class="sci-name" ><c:out value="${term.term}" /></span></a>
<a href="<c:url value="/acn/t/${term.term}" />"><span dir="ltr" class="sci-name" ><i><c:out value="${term.term}" /></i></span></a>
</c:when>
<c:when test="${type=='species'}">
<span dir="ltr" class="sci-name" ><c:out value="${term.term}" /></span>
<span dir="ltr" class="sci-name" ><i><c:out value="${term.term}" /></i></span>
</c:when>
<c:otherwise><c:out value="${term.term}" /></c:otherwise>
</c:choose>
......
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