Commit 38b0aa25 authored by Matija Obreza's avatar Matija Obreza
Browse files

/itpgrfa controller

parent a9ba51d3
...@@ -63,12 +63,6 @@ public class CountryController extends BaseController { ...@@ -63,12 +63,6 @@ public class CountryController extends BaseController {
return "/country/index"; return "/country/index";
} }
@RequestMapping("/treaty")
public String viewITPGRFA(ModelMap model) {
model.addAttribute("countries", geoService.listITPGRFA(getLocale()));
return "/country/index";
}
@RequestMapping("/{country}") @RequestMapping("/{country}")
public String view(ModelMap model, @PathVariable(value = "country") String countryStr) { public String view(ModelMap model, @PathVariable(value = "country") String countryStr) {
_logger.debug("Viewing country " + countryStr); _logger.debug("Viewing country " + countryStr);
......
/**
* Copyright 2013 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.genesys2.server.servlet.controller;
import org.genesys2.server.service.ContentService;
import org.genesys2.server.service.GenesysService;
import org.genesys2.server.service.GeoService;
import org.genesys2.server.service.InstituteService;
import org.genesys2.server.service.TaxonomyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
@Scope("request")
@RequestMapping("/itpgrfa")
public class ITPGRFAController extends BaseController {
@Autowired
private InstituteService instituteService;
@Autowired
private GenesysService genesysService;
@Autowired
private TaxonomyService taxonomyService;
@Autowired
private ContentService contentService;
@Autowired
private GeoService geoService;
@RequestMapping
public String view(ModelMap model, @RequestParam(value = "page", required = false, defaultValue = "1") int page) {
model.addAttribute("blurp", contentService.getGlobalArticle("itpgrfa-about", getLocale()));
model.addAttribute("countries", geoService.listITPGRFA(getLocale()));
return "/itpgrfa/countries";
}
}
...@@ -290,3 +290,6 @@ maps.view-map=View map ...@@ -290,3 +290,6 @@ maps.view-map=View map
audit.createdBy=Created by {0} audit.createdBy=Created by {0}
audit.lastModifiedBy=Last updated by {0} audit.lastModifiedBy=Last updated by {0}
itpgrfa.page.list.title=Countries in ITPGRFA
<!DOCTYPE html>
<%@include file="/WEB-INF/jsp/init.jsp"%>
<html>
<head>
<title><spring:message code="itpgrfa.page.list.title" /></title>
</head>
<body>
<h1>
<spring:message code="itpgrfa.page.list.title" />
</h1>
<%@include file="/WEB-INF/jsp/content/include/blurp-display.jsp"%>
<div id="letter-top" class="page-header">
<c:set value="" var="hoofdleter" />
<c:forEach items="${countries}" var="country" varStatus="status">
<c:if test="${hoofdleter ne country.getName(pageContext.response.locale).substring(0, 1)}">
<c:set var="hoofdleter" value="${country.getName(pageContext.response.locale).substring(0, 1)}" />
<a class="letter-pointer" href="#letter-${hoofdleter}"><c:out value="${hoofdleter}" /></a>
</c:if>
</c:forEach>
</div>
<div class="nav-header">
<spring:message code="paged.totalElements" arguments="${countries.size()}" />
</div>
<c:set value="" var="hoofdleter" />
<ul class="funny-list">
<c:forEach items="${countries}" var="country" varStatus="status">
<c:if test="${hoofdleter ne country.getName(pageContext.response.locale).substring(0, 1)}">
<c:set var="hoofdleter" value="${country.getName(pageContext.response.locale).substring(0, 1)}" />
<li id="letter-${hoofdleter}" class="hoofdleter"><c:out value="${hoofdleter}" />
<small><a href="#letter-top"><spring:message code="jump-to-top" /></a></small>
</li>
</c:if>
<li class="${status.count % 2 == 0 ? 'even' : 'odd'}"><a class="show ${not country.current ? 'disabled' : ''}" href="<c:url value="/geo/${country.code3.toLowerCase()}" />"><c:out value="${country.getName(pageContext.response.locale)}" /></a></li>
</c:forEach>
</ul>
<c:remove var="hoofdleter" />
</body>
</html>
\ 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