Skip to content

Commit

Permalink
SubStep css
Browse files Browse the repository at this point in the history
  • Loading branch information
tifoha committed Feb 4, 2016
1 parent f66035a commit 04b269f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public String getToken(HttpServletResponse response) throws IOException {

@RequestMapping(value = "/{id}", params = {"status"}, method = RequestMethod.GET)
public void updateStatus(HttpServletRequest request,
HttpServletResponse response,
@PathVariable("id") Application application, @RequestParam("status") Decision.Status status) throws IOException {
HttpServletResponse response,
@PathVariable("id") Application application, @RequestParam("status") Decision.Status status) throws IOException {
// IvisFacade ivis = IvisFacade.instance(new IvisFacade.Configuration.Builder()
// .endPointUrl(serverAddress)
// .responseType("json")
Expand Down Expand Up @@ -144,10 +144,10 @@ public void updateStatus(HttpServletRequest request,
@Deprecated
@RequestMapping(value = "/xml", method = RequestMethod.POST)
public void importApplication(HttpServletRequest request,
HttpServletResponse response,
HttpServletResponse response,
@RequestParam(value = "file", required = false) MultipartFile file,
// @RequestParam("body") String body,
Model model) throws IOException, URISyntaxException {
Model model) throws IOException, URISyntaxException {

// InputStream inputStream = file.getInputStream();
// Application application = pharseXml(inputStream);
Expand Down Expand Up @@ -200,8 +200,8 @@ public String showImportApplicationForm() {
// @ResponseBody
public void updatePupil(@ModelAttribute("pupil") Pupil pupil,
// @PathVariable("pupilId") Pupil persistedPupil,
HttpServletRequest request,
HttpServletResponse response) throws IOException {
HttpServletRequest request,
HttpServletResponse response) throws IOException {
PupilService pupilService = ivisServiceFactory.getService(PupilService.class);
PersonService personService = ivisServiceFactory.getService(PersonService.class);
GuardianService guardianService = ivisServiceFactory.getService(GuardianService.class);
Expand All @@ -215,7 +215,7 @@ public void updatePupil(@ModelAttribute("pupil") Pupil pupil,
}

if (pupil.getGuardians() != null) {
for (Guardian guardian :pupil.getGuardians()) {
for (Guardian guardian : pupil.getGuardians()) {
if (guardian != null) {
// if (guardian.getPerson() != null) {
// personService.save(guardian.getPerson());
Expand All @@ -232,11 +232,12 @@ public void updatePupil(@ModelAttribute("pupil") Pupil pupil,

// return "OK";
}

@RequestMapping(value = "/applications", method = RequestMethod.POST)
// @ResponseBody
public void updateApplication(@ModelAttribute("app") Application application,
HttpServletRequest request,
HttpServletResponse response) throws IOException {
HttpServletRequest request,
HttpServletResponse response) throws IOException {

// PupilService pupilService = ivisServiceFactory.getService(PupilService.class);
// PersonService personService = ivisServiceFactory.getService(PersonService.class);
Expand Down Expand Up @@ -295,7 +296,7 @@ private static Application pharseXml(InputStream inputStream) {
return null;
}

// private static class StatmentHandler extends DefaultHandler {
// private static class StatmentHandler extends DefaultHandler {
// private Application application;
// private LinkedList<String> nodes = new LinkedList<>();
// private String fullElementName;
Expand Down Expand Up @@ -339,5 +340,42 @@ private static Application pharseXml(InputStream inputStream) {
// public Application getApplication() {
// return application;
// }
// }
public static void main(String[] args) {

foo(false, null);
foo(new Object[]{false});
}

public static void foo(String var) {
System.out.println("IvisController.foo(String)");
}

// public static void foo(Object var) {
// System.out.println("IvisController.foo(Object)");
// }

public static void foo(Number var) {
System.out.println("IvisController.foo(Number)");
}

// public static void foo(Integer var) {
// System.out.println("IvisController.foo(Integer)");
// }

public static void foo(Long var) {
System.out.println("IvisController.foo(Long)");
}

public static void foo(boolean var, Object... vararg) {
System.out.println("IvisController.foo(boolean, vararg)");
}

public static void foo(Object... vararg) {
System.out.println("IvisController.foo(vararg)");
}

// public static void foo(int var) {
// System.out.println("IvisController.foo(Integer)");
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,22 @@
response.sendRedirect(Imcms.getServerProperties().getProperty("ClientAddress") + "/servlet/StartDoc?meta_id=" + viewing.getTextDocument().getId());
return;
}
Map<Step, Set<ApplicationFormQuestion>> steps = new TreeMap<Step, Set<ApplicationFormQuestion>>();
Map<Step, Map<String, Set<ApplicationFormQuestion>>> steps = new TreeMap<Step, Map<String, Set<ApplicationFormQuestion>>>();
for (ApplicationFormQuestion formQuestion : app.getApplicationForm().getQuestions()) {
Step step = new Step(formQuestion.getStepName(), formQuestion.getStepSortOrder());
Set<ApplicationFormQuestion> questions = steps.get(step);
Map<String, Set<ApplicationFormQuestion>> subSteps = steps.get(step);
if (subSteps == null) {
subSteps = new TreeMap<>();
steps.put(step, subSteps);
}
String subStepName = formQuestion.getSubStepName() == null ? "" : formQuestion.getSubStepName();
Set<ApplicationFormQuestion> questions = subSteps.get(subStepName);
if (questions == null) {
questions = new TreeSet<ApplicationFormQuestion>();
steps.put(step, questions);
questions = new TreeSet<>();
subSteps.put(subStepName, questions);
}
questions.add(formQuestion);
Expand Down Expand Up @@ -79,12 +86,26 @@
<div class="step">
<div class="name">${entry.key.name}</div>
<div class="questions">
<c:forEach items="${entry.value}" var="question" varStatus="fileOptionStatus">

<c:forEach items="${entry.value.entrySet()}" var="subStep" varStatus="fileOptionStatus">
<%--<c:choose>--%>
<%--<c:when test="${not empty subStep.key}">--%>
<%--<div class="subStep">${subStep.key}</div> --%>
<%--</c:when>--%>
<%--<c:otherwise>--%>
<%----%>
<%--</c:otherwise>--%>
<%--</c:choose>--%>
<c:if test="${not empty subStep.key}">
<div class="sub-step">${subStep.key}</div>
</c:if>
<c:forEach items="${subStep.value}" var="question" varStatus="fileOptionStatus">
<div class="question">
<div class="name">${question.text}</div>
<div class="answer">${question.value}</div>
</div>
</c:forEach>
</c:forEach>
</div>
</div>
</c:forEach>
Expand Down
7 changes: 6 additions & 1 deletion ivis-client/src/main/webapp/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ dl dd {
padding: 20px 0 20px 20px;
}

.step .questions .sub-step {
background: #f0f0ff;
padding: 5px 20px;
}

.step .questions .question {
overflow: hidden;
}
Expand All @@ -212,7 +217,7 @@ dl dd {
width: 50%;
}

.step .questions .question .answer {
.step .questions .question .ansqer {
box-sizing: border-box;
float: left;
padding: 5px 20px;
Expand Down

0 comments on commit 04b269f

Please sign in to comment.