Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Commit

Permalink
Law sections view
Browse files Browse the repository at this point in the history
  • Loading branch information
msokk committed Dec 4, 2011
1 parent 68a2cb1 commit 1160530
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public String update(@Valid SeadusePunkt seadusePunkt, BindingResult bindingResu
@RequestMapping(value = "/{id}/{seadusId}", params = "form", method = RequestMethod.GET)
public String updateForm(@PathVariable("id") Long id, @PathVariable("seadusId") Long seadusId, Model uiModel) {
uiModel.addAttribute("seadusePunkt", SeadusePunkt.findSeadusePunkt(id));
uiModel.addAttribute("seadus", Seadus.findSeadus(seadusId));
uiModel.addAttribute("seadusId", seadusId);

addDateTimeFormatPatterns(uiModel);
return "seadusepunktid/update";
Expand All @@ -51,14 +51,15 @@ public String updateForm(@PathVariable("id") Long id, @PathVariable("seadusId")
public String createForm(@PathVariable("seadusId") Long seadusId, Model uiModel) {

uiModel.addAttribute("seadusePunkt", new SeadusePunkt());
uiModel.addAttribute("seadus", Seadus.findSeadus(seadusId));
uiModel.addAttribute("seadusId", seadusId);
addDateTimeFormatPatterns(uiModel);
return "seadusepunktid/create";
}

@RequestMapping(method = RequestMethod.POST)
public String create(@Valid SeadusePunkt seadusePunkt, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
if (bindingResult.hasErrors()) {
System.out.println(bindingResult.getAllErrors().toString());
uiModel.addAttribute("seadusePunkt", seadusePunkt);
addDateTimeFormatPatterns(uiModel);
return "seadusepunktid/create";
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/views/seadused/update.jspx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</a>
</td>
<td style="text-align: center; width: 51px;">
<a class="btn small-padding success" href="../seadusepunktid/${seadus.id}/${seadusepunkt.id}?form">
<a class="btn small-padding success" href="../seadusepunktid/${seadusepunkt.id}/${seadus.id}?form">
<spring:message code="edit"/>
</a>
</td>
Expand Down
10 changes: 7 additions & 3 deletions src/main/webapp/WEB-INF/views/seadusepunktid/create.jspx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0">
<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" xmlns:form2="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<jsp:output omit-xml-declaration="yes"/>
<form:create id="fc_ee_codeporn_borderguard_entities_SeadusePunkt" modelAttribute="seadusePunkt" path="/seadusepunktid" render="${empty dependencies}" z="user-managed">
<div class="left">
<field:input field="paragrahv" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_paragrahv" z="Q5WSMwCpJjJE7Rut7OwTGYikrW0="/>
<field:input field="pais" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_pais" z="zZLWrLiZW9IqA7vVo/6dNK/Pu9A="/>
<field:input field="tekst" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_tekst" z="bW/nhjOUoacu0VY+1e2Ww+e91Go="/>

<input id="c_ee_codeporn_borderguard_entities_SeadusePunkt_seadus" name="seadus" type="hidden" value="${seadusId}" z="user-managed"/>
<field:textarea field="kommentaar" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_kommentaar" z="user-managed"/>
<field:datetime dateTimePattern="${seadusePunkt_kehtivalates_date_format}" field="kehtivAlates" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_kehtivAlates" z="h3Pfl6L5IdLvX7E9OcWdw5stlWU="/>
<field:datetime dateTimePattern="${seadusePunkt_kehtivkuni_date_format}" field="kehtivKuni" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_kehtivKuni" z="0qAJvwXjROSZl56XA8ce2/I5eK8="/>
<field:select field="seadusePunkt" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_seadusePunkt" itemLabel="pais" itemValue="id" items="${seadusepunktid}" path="/seadusepunktid" z="user-managed"/>
<spring:message code="masterpoint" htmlEscape="false" var="masterpoint"/>
<form2:select path="seadusePunkt">
<form2:option label="" value="0"/>
<form2:options itemLabel="pais" itemValue="id" items="${seadusepunktid}"/>
</form2:select>
</div>
<div class="right" style="width: 245px;">
<spring:message code="subpoint"/>
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/WEB-INF/views/seadusepunktid/update.jspx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<field:input field="paragrahv" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_paragrahv" z="Q5WSMwCpJjJE7Rut7OwTGYikrW0="/>
<field:input field="pais" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_pais" z="zZLWrLiZW9IqA7vVo/6dNK/Pu9A="/>
<field:input field="tekst" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_tekst" z="bW/nhjOUoacu0VY+1e2Ww+e91Go="/>
<input id="c_ee_codeporn_borderguard_entities_SeadusePunkt_seadus" name="seadus" type="hidden" value="${seadusId}" z="user-managed"/>
<field:input field="kommentaar" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_kommentaar" z="FA4vhOGHLmWQbeACVhhSNEYhBto="/>
<field:select field="seadusePunkt" id="c_ee_codeporn_borderguard_entities_SeadusePunkt_seadusePunkt" itemLabel="pais" itemValue="id" items="${seadusepunktid}" path="/seadusepunktid" z="user-managed"/>
</div>
Expand Down

0 comments on commit 1160530

Please sign in to comment.