Commit cb418418 authored by Matija Obreza's avatar Matija Obreza
Browse files

Styling

parent 589831b8
......@@ -121,9 +121,10 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
}
for (Method method : methods) {
// FIXME We're loading all entries for metadata, should limit only to the accessions in the list!
LOG.debug("MethodID=" + method.getId());
// FIXME We're loading all entries for metadata, should limit only
// to the accessions in the list!
final List<Map<String, Object>> rows = this.jdbcTemplate.queryForList("select `ALIS_Id` as accessionId, `" + method.getFieldName()
+ "` as traitvalue from `" + method.getId() + "` where `Meta_Id`=?", new Object[] { metadata.getId() });
......@@ -133,12 +134,12 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
}
for (final Map<String, Object> row : rows) {
long accessionId = (Integer) row.get("accessionId");
long accessionId = (Long) row.get("accessionId");
Object value = row.get("traitvalue");
if (value!=null) {
if (value != null) {
Map<Long, Object> accessionValues = accessionMetadataValues.get(accessionId);
if (accessionValues!=null)
if (accessionValues != null)
accessionValues.put(method.getId(), value);
}
}
......
......@@ -130,6 +130,12 @@ paged.totalElements={0} entries
accessions.number={0} accessions
accession.metadatas=C&E Data
accession.methods=Characterization & Evaluation data
unit-of-measure=Unit of Measure
ce.trait=Trait
ce.methods=Methods
ce.method=Method
method.fieldName=DB Field
accession.accessionName=Accession
accession.origin=Country of origin
......@@ -186,3 +192,7 @@ admin.page.title=Genesys 2 Administration
metadata.page.title=Datasets
metadata.page.view.title=Dataset details
page.login=Login
traits.page.title=Descriptors
trait-list=Descriptors
......@@ -28,5 +28,5 @@ log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=info, stdout
log4j.category.org.crophub=info
log4j.category.org.crophub=debug
log4j.category.org.hibernate.search=debug
......@@ -67,8 +67,8 @@
<!--Handle common exceptions-->
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="defaultErrorView" value="/500"/>
<property name="exceptionMappings">
<!-- <property name="defaultErrorView" value="/500"/>
--><property name="exceptionMappings">
<value>
javax.servlet.UnavailableException=/404
</value>
......
......@@ -34,7 +34,8 @@
<script type="text/javascript" src="/html/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/html/js/crophub.js"></script>
<!--
--><!-- <script type="text/javascript" src="/html/js/main.js"></script>
-->
<!-- <script type="text/javascript" src="/html/js/main.js"></script>
-->
<sitemesh:write property="head" />
</head>
......@@ -46,48 +47,14 @@
<div id="header">
<div class="clearfix">
<div class="pull-left">
<a href="<c:url value="/" />"><img style="" src="<c:url value="/html/images/logo2.png" />" /></a>
</div>
<!-- <h4 class="pull-left"><spring:message code="sample.message.welcome"/></h4> -->
<div class="navbar pull-right">
<div class="nav-collapse">
<ul class="nav">
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown"> <spring:message code="sample.message.locale.${pageContext.response.locale}" /> <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="?lang=en"><spring:message code="sample.message.locale.en" /></a></li>
<li><a href="?lang=sl"><spring:message code="sample.message.locale.sl" /></a></li>
</ul></li>
</ul>
</div>
</div>
<div class="navbar pull-right">
<sec:authorize access="isAnonymous()">
<div style="line-height: 20px; padding: 10px 15px;">
<a href="<c:url value="/login" />">Login</a><%-- or <a href="<c:url value="/registration" />"><spring:message code="user.create-new-account" /></a> --%>
</div>
</sec:authorize>
<sec:authorize access="isAuthenticated()">
<ul class="nav">
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" title="<spring:message code="sample.message.change.locale"/>"> You are <b>${user.username}</b> <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<sec:authorize access="hasRole('ADMINISTRATOR')">
<li><a href="<c:url value="/admin/" />">Administation</a></li>
</sec:authorize>
<li><a href="<c:url value="/profile" />"><spring:message code="user.pulldown.profile" /></a></li>
<li><a href="<c:url value="/logout" />"><spring:message code="user.pulldown.logout" /></a></li>
</ul></li>
</ul>
</sec:authorize>
<a href="<c:url value="/" />"><img style="height: 30px" src="<c:url value="/html/images/logo2.png" />" /></a>
</div>
<div class="pull-right searcher" style="padding: 10px 15px 0 0;">
<div class="pull-right" id="header-searcher">
<form class="search form-horizontal" method="get" action="<c:url value="/search" />">
<input type="text" name="q" class="" /> <button type="submit"class="">Search</button>
</form>
<input type="text" name="q" class="" placeholder="Search" />
<button type="submit" class="">Search</button>
</form>
</div>
</div>
</div>
......@@ -100,7 +67,8 @@
<li><a href="<c:url value="/descriptors/" />"><spring:message code="menu.descriptors" /></a></li>
<li><a href="<c:url value="/geo/" />"><spring:message code="menu.countries" /></a></li>
<li><a href="<c:url value="/wiews/active" />"><spring:message code="menu.institutes" /></a></li>
<li><a href="<c:url value="/sel/" />"><spring:message code="menu.my-list" /><div id="selcounter">${selection.size() gt 0 ? selection.size() : ''}</div></a></li>
<li><a href="<c:url value="/sel/" />"><spring:message code="menu.my-list" />
<div id="selcounter">${selection.size() gt 0 ? selection.size() : ''}</div></a></li>
</ul>
</div>
......
......@@ -8,8 +8,11 @@
<title><spring:message code="admin.page.title" /></title>
</head>
<body>
<h1>
<spring:message code="admin.page.title" />
</h1>
<sec:authorize access="hasRole('ADMINISTRATOR')">
<sec:authorize access="hasRole('ADMINISTRATOR')">
<form method="post" action="<c:url value="/admin/refreshWiews" />">
<input type="submit" value="Refresh WIEWS data" />
</form>
......@@ -19,7 +22,7 @@
<form method="post" action="<c:url value="/admin/reindexEverything" />">
<input type="submit" value="Reindex search indexes" />
</form>
</sec:authorize>
</sec:authorize>
</body>
</html>
\ No newline at end of file
......@@ -7,15 +7,12 @@
<title>${title}</title>
</head>
<body>
<c:if test="${title ne ''}">
<h1>
<c:out value="${title}" />
</h1>
</c:if>
<div class="">
<c:out value="${article.body}" escapeXml="false" />
</div>
......
......@@ -7,18 +7,31 @@
<title><spring:message code="metadata.page.title" /></title>
</head>
<body>
<h1><c:out value="${trait.title}" /></h1>
<div><a href="<c:url value="/c/${trait.crop.shortName}" />/descriptors">${trait.crop.name}</a> trait</div>
<h4>Methods</h4>
<h1>
<c:out value="${trait.title}" />
<small>${trait.crop.name}</small>
</h1>
<div>
<spring:message code="filter.crop" />: <b><a href="<c:url value="/c/${trait.crop.shortName}" />">${trait.crop.name}</a></b>
</div>
<h4>
<spring:message code="ce.methods" />
</h4>
<table>
<thead>
<tr>
<td><spring:message code="ce.trait" /></td>
<td><spring:message code="ce.method" /></td>
<td><spring:message code="unit-of-measure" /></td>
<td><spring:message code="method.fieldName" /></td>
</thead>
<tbody>
<c:forEach items="${traitMethods}" var="method">
<tr>
<td><c:out value="${method.parameter.title}" /></td>
<td><a href="<c:url value="/descriptors/${trait.id}/${method.id}" />"><c:out value="${method.method}" /></a></td>
<td><c:out value="${method.fieldName}" /></td>
<td><c:out value="${method.unit}" /></td>
<td><c:out value="${method.fieldName}" /></td>
</tr>
</c:forEach>
</tbody>
......
......@@ -4,14 +4,18 @@
<html>
<head>
<title><spring:message code="metadata.page.title" /></title>
<title><spring:message code="traits.page.title" /></title>
</head>
<body>
<c:if test="${crop ne null}">
<div>
<spring:message code="filter.crop" />: <b><a href="<c:url value="/c/${crop.shortName}" />">${crop.name}</a></b>
</div>
</c:if>
<h1>
<spring:message code="trait-list" />
</h1>
<c:if test="${crop ne null}">
<div>
<spring:message code="filter.crop" />: <b><a href="<c:url value="/c/${crop.shortName}" />">${crop.name}</a></b>
</div>
</c:if>
<div class="nav-header">
<spring:message code="paged.totalElements" arguments="${traits.totalElements}" />
<br />
......
......@@ -9,9 +9,9 @@
</head>
<body>
<div class="pull-left" style="width: 20%; margin-right: 5%;">
<div id="crops-menu" class="content-block">
<c:if test="${cropList ne null and cropList.size() gt 0}">
<h3><spring:message code="crop.croplist"/></h3>
<h1><spring:message code="crop.croplist"/></h1>
<ul class="funny-list">
<c:forEach items="${cropList}" var="crop" varStatus="status">
<li><a href="/c/${crop.shortName}/data"><c:out value="${crop.name}" /></a></li>
......@@ -26,8 +26,8 @@
</div>
<c:if test="${lastNews ne null}">
<div class="pull-left" style="width: 65%; margin-left: 5%">
<h3><spring:message code="activity.recent-activity"/></h3>
<div class="content-block">
<h1><spring:message code="activity.recent-activity"/></h1>
<c:forEach items="${lastNews}" var="activityPost" varStatus="status">
<div class="activity-post">
<div class="heading">
......@@ -45,6 +45,6 @@
</c:forEach>
</div>
</c:if>
</body>
</html>
\ No newline at end of file
......@@ -7,13 +7,15 @@
<title><spring:message code="metadata.page.title" /></title>
</head>
<body>
<h1>
<spring:message code="metadata.page.title" />
</h1>
<div class="nav-header">
<spring:message code="paged.totalElements" arguments="${metadatas.totalElements}" />
<br />
<spring:message code="paged.pageOfPages" arguments="${metadatas.number+1},${metadatas.totalPages}" />
<a href="?page=${metadatas.number}">⇇ Previous</a>
<a href="?page=${metadatas.number + 2}">Next ⇉</a>
<a href="?page=${metadatas.number}">⇇ Previous</a> <a href="?page=${metadatas.number + 2}">Next ⇉</a>
</div>
<ul class="funny-list">
<c:forEach items="${metadatas.content}" var="metadata" varStatus="status">
......
......@@ -7,50 +7,56 @@
<title><spring:message code="metadata.page.view.title" /></title>
</head>
<body>
<h3>
<h1>
<c:out value="${metadata.title}" />
</h3>
</h1>
<c:if test="${page eq 1}">
<table>
<tbody>
<c:forEach items="${methods}" var="method">
<c:if test="${page eq 1}">
<table>
<thead>
<tr>
<td><a href="<c:url value="/descriptors/${method.parameter.id}" />"><c:out value="${method.parameter.title}" /></a></td>
<td><a href="<c:url value="/descriptors/${method.parameter.id}/${method.id}" />"><c:out value="${method.method}" /></a></td>
<td><c:out value="${method.fieldName}" /></td>
<td><c:out value="${method.unit}" /></td>
</tr>
</c:forEach>
</tbody>
</table>
<p>
<c:out value="${metadata.description}" />
</p>
<p>
<c:out value="${metadata.location}" />
</p>
<p>
<c:out value="${metadata.citation}" />
</p>
<p>
<c:out value="${metadata.SDate}" />
<c:out value="${metadata.EDate}" />
</p>
<div>
<c:out value="${metadata.description}" escapeXml="false" />
</div>
<td><spring:message code="ce.trait" /></td>
<td><spring:message code="ce.method" /></td>
<td><spring:message code="unit-of-measure" /></td>
<td><spring:message code="method.fieldName" /></td>
</thead>
<tbody>
<c:forEach items="${methods}" var="method">
<tr>
<td><a href="<c:url value="/descriptors/${method.parameter.id}" />"><c:out value="${method.parameter.title}" /></a></td>
<td><a href="<c:url value="/descriptors/${method.parameter.id}/${method.id}" />"><c:out value="${method.method}" /></a></td>
<td><c:out value="${method.unit}" /></td>
<td><c:out value="${method.fieldName}" /></td>
</tr>
</c:forEach>
</tbody>
</table>
<p>
<c:out value="${metadata.description}" />
</p>
<p>
<c:out value="${metadata.location}" />
</p>
<p>
<c:out value="${metadata.citation}" />
</p>
<p>
<c:out value="${metadata.SDate}" />
<c:out value="${metadata.EDate}" />
</p>
<div>
<c:out value="${metadata.description}" escapeXml="false" />
</div>
<h3>Observations</h3>
</c:if>
<h3>Observations</h3>
</c:if>
<div class="nav-header">
<spring:message code="paged.totalElements" arguments="${accessions.totalElements}" />
<br />
<spring:message code="paged.pageOfPages" arguments="${accessions.number+1},${accessions.totalPages}" />
<a href="?page=${accessions.number}">⇇ Previous</a>
<a href="?page=${accessions.number + 2}">Next ⇉</a>
<a href="?page=${accessions.number}">⇇ Previous</a> <a href="?page=${accessions.number + 2}">Next ⇉</a>
</div>
......@@ -59,46 +65,43 @@
<tr>
<td class="idx-col"></td>
<c:if test="${selection ne null}">
<td />
<td />
</c:if>
<td><spring:message code="accession.accessionName" /></td>
<%-- <td><spring:message code="accession.origin" /></td>
--%> <td><spring:message code="accession.taxonomy" /></td>
<%-- <td><spring:message code="accession.holdingInstitute" /></td>
<%-- <td><spring:message code="accession.origin" /></td>
--%>
<td><spring:message code="accession.taxonomy" /></td>
<%-- <td><spring:message code="accession.holdingInstitute" /></td>
<td><spring:message code="accession.holdingCountry" /></td>
--%>
<c:forEach items="${methods}" var="method">
<td>
<c:out value="${method.fieldName}" />
<c:if test="${method.unit ne ''}">[<c:out value="${method.unit}" />]</c:if>
</td>
</c:forEach>
</tr>
--%>
<c:forEach items="${methods}" var="method">
<td><c:out value="${method.fieldName}" /> <c:if test="${method.unit ne ''}">[<c:out value="${method.unit}" />]</c:if></td>
</c:forEach>
</tr>
</thead>
<tbody>
<c:forEach items="${accessions.content}" var="accession" varStatus="status">
<tr class="acn ${status.count % 2 == 0 ? 'even' : 'odd'}">
<td class="idx-col">${status.count + accessions.size * accessions.number}</td>
<c:if test="${selection ne null}">
<td class="sel ${selection.containsId(accession.id) ? 'picked' : ''}" x-aid="${accession.id}"></td>
<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="/geo/${accession.origin.toLowerCase()}" />"><c:out value="${accession.countryOfOrigin.name}" /></a></td>
--%> <td><c:out value="${accession.taxonomy.taxonName}" /></td>
<%-- <td><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.origin.toLowerCase()}" />"><c:out value="${accession.countryOfOrigin.name}" /></a></td>
--%>
<td><c:out value="${accession.taxonomy.taxonName}" /></td>
<%-- <td><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>
--%>
<c:set value="${accessionMethods[accession.id]}" var="methodValues" />
<c:forEach items="${methods}" var="method">
<td>
<c:out value="${method.decode(methodValues[method.id])}" />
</td>
</c:forEach>
</tr>
<c:set value="${accessionMethods[accession.id]}" var="methodValues" />
<c:forEach items="${methods}" var="method">
<td><c:out value="${method.decode(methodValues[method.id])}" /></td>
</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
......
<?xml version="1.0" encoding="UTF-8"?>
<sitemesh>
<mapping path="/welcome" decorator="/WEB-INF/decorator/entry.jsp" />
<mapping path="/*" decorator="/WEB-INF/decorator/main.jsp" />
<mapping path="/html/*" exclude="true" />
</sitemesh>
\ No newline at end of file
@media (min-width: 500px) {
#crops-menu {
float: left;
min-width: 15%; max-width: 25%; margin-right: 10px;
}
.content-block {
overflow: auto;
}
#header {
padding: 10px;
background-color: #4d4c47;
color: White;
}
#header-searcher {
margin-top: 5px;
}
}
@media (max-width: 500px) {
#crops-menu {
margin-bottom: 10px;
}
.content-block {
}
#header {
padding: 5px;
background-color: #4d4c47;
color: White;
}
#header-searcher {
margin-top: 7px;
}
#header-searcher button {
display: none;
}
}
#header form {
margin-bottom: 0;
}
.genesys-bg {
background-color: #88ba41;
}
......@@ -41,7 +91,7 @@ table {
table thead td {
font-size: 15px;
font-size: 16px;
font-weight: normal;
padding: 0.5em 0.2em;
}
......@@ -55,16 +105,18 @@ h1 {
td {
vertical-align: top;
padding: 0.2em 0.5em;
padding: 0.5em 0.5em;
}
.idx-col {
font-size: 80%;
width: 4em;
width: 3em;
/* background-color: #eaeaea; */
/* text-align: right; */
vertical-align: middle;
/* vertical-align: middle; */
padding-top: 5px;
}
span.idx-col {
display: inline-block;
}
......@@ -151,17 +203,26 @@ body {
padding-top: 0;
}
#header {
padding: 1em 1em 0.5em 1em;
background-color: #4d4c47;
.content-block > h1:FIRST-CHILD {
line-height: 30px;
font-size: 20px;
background-color: #88ba41;
color: White;
margin: -20px;
margin-bottom: 10px;
padding: 5px 20px;
}
.content-block > h1:FIRST-CHILD small {
font-size: 14px;
color: #dddddd;
}
#nav-main {
padding-bottom: 1em 2em 1em 2em;
background-color: #2a2924;
margin: 0 0 1em 0;
margin: 0 0 10px 0;
font-size: 12px;
}
......@@ -172,7 +233,7 @@ body {
#nav-main ul {
margin: 0;
border-bottom: solid 3px White;
/* border-bottom: solid 3px White; */
}
#nav-main ul li {
......@@ -188,7 +249,7 @@ body {
#footer {
padding: 1em 1em 0.5em 1em;
border-top: solid 2px #909090;