Commit 42d0186b authored by Matija Obreza's avatar Matija Obreza

Display accession's crop in details, removed hyperlinks in lists

parent b12242b0
......@@ -32,7 +32,7 @@ public interface CropTaxonomyRepository extends JpaRepository<CropTaxonomy, Long
@Query("select distinct t from CropTaxonomy ct inner join ct.taxonomy t where ct.crop = ?1")
List<Taxonomy> findTaxonomiesByCrop(Crop crop);
@Query("select ct from CropTaxonomy ct where ct.taxonomy= ?1 and ct.crop.language = ?2")
@Query("select ct.crop from CropTaxonomy ct where ct.taxonomy= ?1 and ct.crop.language = ?2")
Crop findByTaxonomyAndLanguage(Taxonomy taxonomy, String language);
@Modifying
......
......@@ -23,6 +23,7 @@ import java.util.List;
import org.crophub.rest.common.model.genesys.Accession;
import org.crophub.rest.common.model.genesys.Taxonomy;
import org.crophub.rest.common.model.impl.FaoInstitute;
import org.crophub.rest.common.service.CropService;
import org.crophub.rest.common.service.GenesysService;
import org.crophub.rest.common.service.InstituteService;
import org.crophub.rest.common.service.TaxonomyService;
......@@ -55,6 +56,9 @@ public class AccessionController extends BaseController {
@Autowired
private TaxonomyService taxonomyService;
@Autowired
private CropService cropService;
@RequestMapping("/id/{accessionId}")
public String view(ModelMap model, @PathVariable(value = "accessionId") long accessionId) {
_logger.debug("Viewing ACN " + accessionId);
......@@ -72,6 +76,8 @@ public class AccessionController extends BaseController {
model.addAttribute("metadatas", genesysService.listMetadata(accession));
model.addAttribute("methods", genesysService.listMethods(accession));
model.addAttribute("methodValues", genesysService.getAccessionTraitValues(accession));
model.addAttribute("crop", cropService.getCrop(getLocale(), accession.getTaxonomy()));
model.addAttribute("selection", selectionBean);
......
......@@ -142,6 +142,7 @@ accession.origin=Country of origin
accession.holdingInstitute=Holding institute
accession.holdingCountry=Location
accession.taxonomy=Taxonomy
accession.crop=Crop
accession.otherNames=Also known as
accession.inTrust=In Trust
accession.mlsStatus=MLS Status
......
......@@ -77,8 +77,10 @@
<td class="sel ${selection.containsId(accession.id) ? 'picked' : ''}" x-aid="${accession.id}"></td>
</c:if>
<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="/acn/t/${accession.taxonomy.genus}/${accession.taxonomy.species}" />"><c:out value="${accession.taxonomy.taxonName}" /></a></td>
<td class="notimportant"><a href="<c:url value="/geo/${accession.origin.toLowerCase()}" />"><c:out value="${accession.countryOfOrigin.name}" /></a></td>
<%-- <td><a href="<c:url value="/acn/t/${accession.taxonomy.genus}/${accession.taxonomy.species}" />"><c:out value="${accession.taxonomy.taxonName}" /></a></td> --%>
<td><c:out value="${accession.taxonomy.taxonName}" /></td>
<%-- <td class="notimportant"><a href="<c:url value="/geo/${accession.origin.toLowerCase()}" />"><c:out value="${accession.countryOfOrigin.name}" /></a></td> --%>
<td class="notimportant"><c:out value="${accession.countryOfOrigin.name}" /></td>
<td class="notimportant"><a href="<c:url value="/wiews/${accession.institute.code.toLowerCase()}" />"><c:out value="${accession.institute.code}" /></a></td>
<%-- <td><a href="<c:url value="/geo/${accession.institute.country.code3.toLowerCase()}" />"><c:out value="${accession.institute.country.name}" /></a></td>
--%>
......
......@@ -55,6 +55,12 @@
<td><c:out value="${accession.accessionName}" /></td>
</tr>
<c:if test="${crop ne null}">
<tr>
<td><spring:message code="accession.crop" /></td>
<td><a href="<c:url value="/c/${crop.shortName}" />"><c:out value="${crop.name}" /></a></td>
</tr>
</c:if>
<c:if test="${accession.countryOfOrigin ne null}">
<tr>
......
......@@ -34,10 +34,10 @@
<td />
</c:if>
<td><spring:message code="accession.accessionName" /></td>
<td class="notimportant"><spring:message code="accession.origin" /></td>
<td><spring:message code="accession.taxonomy" /></td>
<td class="notimportant"><spring:message code="accession.origin" /></td>
<td class="notimportant"><spring:message code="accession.holdingInstitute" /></td>
<td class="notimportant"><spring:message code="accession.holdingCountry" /></td>
<%-- <td class="notimportant"><spring:message code="accession.holdingCountry" /></td> --%>
</tr>
</thead>
<tbody>
......@@ -48,10 +48,10 @@
<td class="sel ${selection.containsId(accession.id) ? 'picked' : ''}" x-aid="${accession.id}"></td>
</c:if>
<td><a href="<c:url value="/acn/id/${accession.id}" />"><b><c:out value="${accession.accessionName}" /></b></a></td>
<td class="notimportant"><c:out value="${accession.countryOfOrigin.name}" /></td>
<td><c:out value="${accession.taxonomy.taxonName}" /></td>
<td class="notimportant"><c:out value="${accession.countryOfOrigin.name}" /></td>
<td class="notimportant"><a href="<c:url value="/wiews/${accession.institute.code.toLowerCase()}" />"><c:out value="${accession.institute.code}" /></a></td>
<td class="notimportant"><a href="<c:url value="/geo/${accession.institute.country.code3.toLowerCase()}" />"><c:out value="${accession.institute.country.name}" /></a></td>
<%-- <td class="notimportant"><a href="<c:url value="/geo/${accession.institute.country.code3.toLowerCase()}" />"><c:out value="${accession.institute.country.name}" /></a></td> --%>
</tr>
</c:forEach>
</tbody>
......
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