Commit 506749e6 authored by Matija Obreza's avatar Matija Obreza

Added jspHelper bean

parent 37b360e0
package org.genesys2.server.servlet.controller;
import org.genesys2.server.exception.UserException;
import org.genesys2.server.model.impl.User;
import org.genesys2.server.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class JspHelper {
@Autowired
private UserService userService;
public String userFullName(Long userId) {
if (userId == null) {
return null;
}
try {
User user = userService.getUserById(userId);
return user.getName();
} catch (UserException e) {
return null;
}
}
}
......@@ -63,6 +63,7 @@
<property name="exposedContextBeanNames">
<list>
<value>props</value>
<value>jspHelper</value>
</list>
</property>
</bean>
......
......@@ -260,7 +260,13 @@
</c:forEach>
</ul>
</c:if>
<div class="audit-info">
<c:if test="${accession.lastModifiedBy ne null}"><spring:message code="audit.lastModifiedBy" arguments="${jspHelper.userFullName(accession.lastModifiedBy)}" /></c:if>
<fmt:formatDate value="${accession.lastModifiedDate}" type="both" />
</div>
<script type="text/javascript">
<c:if test="${accessionGeo ne null and accessionGeo.latitude ne null}">
jQuery(document).ready(function() {
......
......@@ -16,8 +16,8 @@
</div>
</c:if>
<div class="foot">
<fmt:formatDate value="${activityPost.postDate.time}" />
<%-- <spring:message code="audit.createdBy" arguments="${activityPost.createdBy.name}" /> --%>
<c:if test="${activityPost.lastModifiedBy ne null}"><spring:message code="audit.lastModifiedBy" arguments="${activityPost.lastModifiedBy}" /></c:if>
<c:if test="${activityPost.lastModifiedBy ne null}"><spring:message code="audit.lastModifiedBy" arguments="${jspHelper.userFullName(activityPost.lastModifiedBy)}" /></c:if>
<fmt:formatDate value="${activityPost.postDate.time}" />
</div>
</div>
\ No newline at end of file
......@@ -11,9 +11,11 @@
<c:out value="${metadata.title}" />
</h1>
${metadata.createdBy} <fmt:formatDate value="${metadata.createdDate}" type="datetime" />
${metadata.lastModifiedBy} <fmt:formatDate value="${metadata.lastModifiedDate}" type="datetime" />
<div class="audit-info">
<c:if test="${metadata.lastModifiedBy ne null}"><spring:message code="audit.lastModifiedBy" arguments="${jspHelper.userFullName(metadata.lastModifiedBy)}" /></c:if>
<fmt:formatDate value="${metadata.lastModifiedDate}" type="both" />
</div>
<c:if test="${page eq 1}">
<table>
<thead>
......
......@@ -27,5 +27,9 @@
</c:forEach>
</ul>
<div class="audit-info">
<c:if test="${team.lastModifiedBy ne null}"><spring:message code="audit.lastModifiedBy" arguments="${jspHelper.userFullName(team.lastModifiedBy)}" /></c:if>
<fmt:formatDate value="${team.lastModifiedDate}" type="both" />
</div>
</body>
</html>
\ No newline at end of file
......@@ -558,3 +558,9 @@ table.accessions tr.not-available > td {
text-decoration: line-through;
opacity: .5;
}
.audit-info {
margin-top: 2em;
margin-left: 0;
font-size: 80%;
}
\ No newline at end of file
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