Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
506749e6
Commit
506749e6
authored
Jan 09, 2014
by
Matija Obreza
Browse files
Added jspHelper bean
parent
37b360e0
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/controller/JspHelper.java
0 → 100644
View file @
506749e6
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
;
}
}
}
src/main/resources/spring/servlet.xml
View file @
506749e6
...
...
@@ -63,6 +63,7 @@
<property
name=
"exposedContextBeanNames"
>
<list>
<value>
props
</value>
<value>
jspHelper
</value>
</list>
</property>
</bean>
...
...
src/main/webapp/WEB-INF/jsp/accession/details.jsp
View file @
506749e6
...
...
@@ -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
()
{
...
...
src/main/webapp/WEB-INF/jsp/content/include/activitypost.jsp
View file @
506749e6
...
...
@@ -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
src/main/webapp/WEB-INF/jsp/metadata/view.jsp
View file @
506749e6
...
...
@@ -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>
...
...
src/main/webapp/WEB-INF/jsp/team/details.jsp
View file @
506749e6
...
...
@@ -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
src/main/webapp/html/css/custom.css
View file @
506749e6
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment