root/trunk/grails-app/views/study/list_extended.gsp @ 135

Revision 135, 1.8 KB (checked in by ademcan, 4 years ago)

"compare selected studies" option, with some examples studies, accordion view TODO

Line 
1
2<%@ page import="dbnp.studycapturing.Study" %>
3<html>
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <meta name="layout" content="main" />
7  <g:set var="entityName" value="${message(code: 'study.label', default: 'Study')}" />
8  <title><g:message code="default.list.label" args="[entityName]" /></title>
9
10  <my:jqueryui/>
11  <script type="text/javascript">
12    $(function() {
13            $("#accordion").accordion();
14    });
15  </script>
16
17</head>
18<body>
19
20  <% studyList = dbnp.studycapturing.Study.list() %>
21  <% def att_list = ['id','template','startDate','code','title'] %>
22  <% def selectedStudies = [] %>
23  <% def tmpList = [] %>
24
25  <div class="nav">
26    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
27    <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
28  </div>
29
30  <div class="body">
31    <h1><g:message code="default.list.label" args="[entityName]" /></h1>
32    <g:if test="${flash.message}">
33      <div class="message">${flash.message}</div>
34    </g:if>
35
36    <% params.each{key,values-> %>
37    <% if (values=="on"){ %>
38      <% tmpList.add(key) %>
39    <%  } }%>
40
41    <% for (i in studyList) {%>
42    <% if (tmpList.contains(i.getTitle())) { %>
43      <% selectedStudies.add(i) %>
44     <% }} %>
45
46    <table border="2">
47      <g:each in="${att_list}" status="s" var="attribute">
48        <tr>
49        <g:each in="${selectedStudies}" status="i" var="studyInstance">
50          <div id="accordion">
51            <td>
52              <a href="#">  ${message(code: 'study.id.'+attribute , default: attribute)} </a>:
53              <div>${fieldValue(bean: studyInstance, field: attribute)} </div>
54            </td>
55          </div>
56        </g:each>
57        </tr>
58      </g:each>
59    </table>
60  </div>
61
62</body>
63</html>
Note: See TracBrowser for help on using the browser.