Commit ad351f4b authored by Matija Obreza's avatar Matija Obreza

Merge branch '274-extend-recent-activity' into 'master'

Resolve "Extend Recent activity"

Closes #274

See merge request genesys-pgr/genesys-server!160
parents eae5a6ea 63751e1c
...@@ -21,6 +21,7 @@ import java.util.Locale; ...@@ -21,6 +21,7 @@ import java.util.Locale;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.genesys2.server.service.ContentService; import org.genesys2.server.service.ContentService;
import org.genesys2.server.service.GenesysService;
import org.genesys2.server.service.CropService; import org.genesys2.server.service.CropService;
import org.genesys2.server.service.OrganizationService; import org.genesys2.server.service.OrganizationService;
import org.genesys2.server.service.StatisticsService; import org.genesys2.server.service.StatisticsService;
...@@ -58,6 +59,9 @@ public class HtmlController extends BaseController { ...@@ -58,6 +59,9 @@ public class HtmlController extends BaseController {
@Autowired @Autowired
private OrganizationService organizationService; private OrganizationService organizationService;
@Autowired
private GenesysService genesysService;
@RequestMapping("/") @RequestMapping("/")
public String index(HttpServletRequest request) { public String index(HttpServletRequest request) {
...@@ -89,6 +93,7 @@ public class HtmlController extends BaseController { ...@@ -89,6 +93,7 @@ public class HtmlController extends BaseController {
model.addAttribute("numberOfActiveAccessions", statisticsService.numberOfActiveAccessions()); model.addAttribute("numberOfActiveAccessions", statisticsService.numberOfActiveAccessions());
model.addAttribute("numberOfHistoricAccessions", statisticsService.numberOfHistoricAccessions()); model.addAttribute("numberOfHistoricAccessions", statisticsService.numberOfHistoricAccessions());
model.addAttribute("numberOfPublishedDatasets", statisticsService.numberOfPublishedDatasets()); model.addAttribute("numberOfPublishedDatasets", statisticsService.numberOfPublishedDatasets());
model.addAttribute("accessionsUpdates", genesysService.getLastUpdatedStatistics());
model.addAttribute("organizations", organizationService.list(new PageRequest(0, 5))); model.addAttribute("organizations", organizationService.list(new PageRequest(0, 5)));
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<%@ include file="/WEB-INF/jsp/init.jsp" %> <%@ include file="/WEB-INF/jsp/init.jsp" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<spring:eval expression="T(java.text.DateFormatSymbols).getInstance(pageContext.response.locale).getMonths()" var="monthNames" />
<html> <html>
<head> <head>
...@@ -153,6 +154,37 @@ ...@@ -153,6 +154,37 @@
</security:authorize> </security:authorize>
<div class="all-posts"> <div class="all-posts">
<div class="post type-article">
<div class="post-head clearfix" x-href="<c:url value="/acn/updates" />">
<div class="user-icon hidden-sm hidden-xs"></div>
<div class="post-head-content" dir="ltr">
<p><spring:message code='accession.page.updates.title' /></p>
</div>
</div>
<div class="post-inner clearfix post-left-pad">
<div class="post-content" dir="ltr" style="margin-bottom: 22px;">
<p><spring:message code='accession.page.updates.intro' /></p>
<c:forEach items="${accessionsUpdates}" var="update" begin="0" end="4">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-4">
<b>
<c:if test="${update[0] ne null}">
${update[2]} ${monthNames[update[1]-1]} ${update[0]}
</c:if>
<c:if test="${update[0] eq null}">
----
</c:if>
</b>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-4"><a href="<c:url value='/wiews/${update[3].code}' />">${update[3].fullName}</a></div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-4 text-right"><b><fmt:formatNumber value="${update[4]}" /></b></div>
</div>
</c:forEach>
</div>
</div>
</div>
<c:forEach items="${lastNews}" var="activityPost" varStatus="status"> <c:forEach items="${lastNews}" var="activityPost" varStatus="status">
<cms:activitypost activityPost="${activityPost}" /> <cms:activitypost activityPost="${activityPost}" />
</c:forEach> </c:forEach>
......
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