Changeset 223


Ignore:
Timestamp:
Mar 2, 2010, 1:37:40 PM (13 years ago)
Author:
ademcan
Message:

Study List and Study Comparaison

Location:
trunk/grails-app/views/study
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/study/list_extended.gsp

    r212 r223  
    1111  <script type="text/javascript">
    1212    $(function() {
    13             $("#accordions").accordion();
     13            $("#tabs").tabs();
    1414    });
    1515  </script>
     
    1919
    2020  <% studyList = dbnp.studycapturing.Study.list() %>
    21   <% def att_list = ['template','startDate','samplingEvents','lastUpdated','readers','code','editors','ecCode','researchQuestion','title','description','owner','dateCreated'] %>
     21  <% def att_list = ['template','startDate','events','samplingEvents','lastUpdated','readers','code','editors','ecCode','researchQuestion','title','description','owner','dateCreated'] %>
    2222  <% def selectedStudies = [] %>
    2323  <% def tmpList = [] %>
     
    4747    <% if (selectedStudies.size()>0) {%>
    4848
    49     <div id="accordions">
    50 
    51     <a href="#"> Study Information </a>
    52     <div>
     49
     50        <div id="tabs">
     51      <ul>
     52        <li><a href="#study">Study Information</a></li>
     53        <li><a href="#subjects">Subjects</a></li>
     54        <li><a href="#groups">Groups</a></li>
     55        <li><a href="#protocols">Protocols</a></li>
     56        <li><a href="#events">Events</a></li>
     57        <li><a href="#event-description">Event Description</a></li>
     58        <li><a href="#event-group">Event Groups</a></li>
     59        <li><a href="#assays">Assays</a></li>
     60      </ul>
     61
     62
     63    <div id="study">
    5364      <br>
    5465      <table>
     
    5667        <td></td>
    5768        <g:each in="${selectedStudies}" status="j" var="studyIns">
    58         <td><b>${studyIns.title}</b></td>
     69          <td width="50%"><b>${studyIns.title}</b></td>
    5970        </g:each>
    6071      </tr>
     
    7182        <td><b>${att[0].toUpperCase()+att.substring(1)}</b></td>
    7283        <g:each in="${selectedStudies}" status="k" var="studyIns">
     84
     85   <g:if test="${att == 'events'}">
     86     <td>
     87  <% def eventList = [] %>
     88             <g:each in="${studyIns.events}" var="s">
     89              <%  eventList.add(s.eventDescription) %>
     90             </g:each>
     91  <g:if test="${eventList.size()==0}">
     92          -
     93         </g:if>
     94        <g:else>
     95           <% def sampEvent = eventList.get(0).name %>
     96           ${sampEvent}
     97         <g:each in="${eventList}" var="event">
     98           <g:if test="${(event.name!=sampEvent)}">
     99            ${event.name}
     100         </g:if>
     101          </g:each>
     102         </g:else>
     103          </td>
     104        </g:if>
     105
     106<g:elseif test="${att == 'samplingEvents'}">
     107     <td>
     108  <% def SampeventList = [] %>
     109             <g:each in="${studyIns.samplingEvents}" var="s">
     110              <%  SampeventList.add(s.eventDescription) %>
     111             </g:each>
     112  <g:if test="${SampeventList.size()==0}">
     113          -
     114         </g:if>
     115        <g:else>
     116           <% def samplEvent = SampeventList.get(0).name %>
     117           ${samplEvent}
     118         <g:each in="${SampeventList}" var="samplingEvent">
     119           <g:if test="${(samplingEvent.name!=samplEvent)}">
     120            ${samplingEvent.name}
     121         </g:if>
     122          </g:each>
     123         </g:else>
     124          </td>
     125</g:elseif>
     126
     127          <g:else>
    73128<td>${fieldValue(bean: studyIns, field: att)}</td>
     129          </g:else>
    74130        </g:each>
    75131      </tr>
     
    79135    </div>
    80136
    81      <a href="#"> Subjects </a><div>
     137          <div id="subjects">
    82138       
    83139       <table border="2">
     
    127183      </div>
    128184
    129  <a href="#"> Groups </a> <div>
    130 
     185          <div id="groups">
     186<table border="2">
     187  <tr>
     188         <g:each in="${selectedStudies}" var="study">
     189           <td width="50%"><center><b>${study.title}</b></center></td>
     190         </g:each>
     191       </tr>
     192         <tr>
     193         <g:each in="${selectedStudies}" var="study">
     194           <td>
     195  <g:if test="${study.groups.size()==0}"> No groups in this study </g:if>
     196  <g:else><center><b>${study.groups}</b></center></g:else>
     197         </td>
     198         </g:each>
     199       </tr>
     200</table>
    131201        </div>
    132202
    133        <a href="#"> Protocols </a><div>
     203          <div id="protocols">
    134204         <table border="2">
    135205         <tr>
    136206         <g:each in="${selectedStudies}" var="study">
    137            <td><center><b>${study.title}</b></center></td>
     207           <td width="50%"><center><b>${study.title}</b></center></td>
    138208         </g:each>
    139209       </tr>
     
    152222          <% def protocol_list = [] %>
    153223          <% def tmp_protocol = stud.events.eventDescription.protocol.get(0) %>
     224          <% def tmpBis_protocol = stud.samplingEvents.eventDescription.protocol.get(0) %>
    154225          <% protocol_list.add(tmp_protocol) %>
     226          <% protocol_list.add(tmpBis_protocol) %>
     227
    155228          <g:each in="${stud.events.eventDescription.protocol}" var="s">
    156 
    157229          <% if (tmp_protocol!=s) { %>
    158230            <% protocol_list.add(s) %>
     
    160232          </g:each>
    161233
    162             <g:each in="${protocol_list}" var="protocol">
     234 <g:each in="${stud.samplingEvents.eventDescription.protocol}" var="s">
     235          <% if (tmpBis_protocol!=s) { %>
     236            <% protocol_list.add(s) %>
     237            <%}%>
     238          </g:each>
     239
     240          <g:each in="${protocol_list}" var="protocol">
    163241            <tr>
    164242              <td><g:link controller="protocol" action="show" id="${protocol.id}">${protocol.id}</g:link></td>
     
    181259       </div>
    182260
    183       <a href="#"> Events </a><div>
     261          <div id="events">
    184262          <table border="2">
    185263         <tr>
     
    198276            <td><b>Subject</b></td>
    199277            <td><b>Start Time</b></td>
    200             <td><b>End Time</b></td>
    201278            <td><b>Duration</b></td>
    202           </tr>
     279            <td><b>Sampling Event</b></td>
     280            <td><b>Parameters</b></td>
     281          </tr>
     282
    203283          <g:each in="${stud.events}" var="e">
    204284            <tr>
    205285              <td><g:link controller="event" action="show" id="${e.id}">  ${e.eventDescription.name}</g:link></td>
    206286          <td>${e.subject.id}</td>
    207           <td>${e.startTime}</td>
    208           <td>${e.endTime}</td>
    209           <td>${e.getDurationString()}</td>
    210           </tr>
    211           </g:each>
    212           </table>
     287          <td>${e.getPrettyDuration(stud.startDate,e.startTime)}</td>
     288          <td>${e.getPrettyDuration()}</td>
     289           <td><g:checkBox name="event" disabled="${true}" value="${false}"/></td>
     290          <g:each in="${e.eventDescription.protocol.parameters}" var="param">
     291          <td>
     292            ${param.name} : ${param.listEntries}
     293          </td>
     294            </g:each>
     295            </tr>
     296          </g:each>
     297
     298          <g:each in="${stud.samplingEvents}" var="e">
     299          <tr>
     300          <td><g:link controller="event" action="show" id="${e.id}">${e.eventDescription.name}</g:link></td>
     301          <td>${e.subject.id}</td>
     302          <td>${e.getPrettyDuration(stud.startDate,e.startTime)}</td>
     303          <td>${e.getPrettyDuration()}</td>
     304            <td><g:checkBox name="samplingEvent" disabled="${true}" value="${true}"/></td>
     305
     306            <g:each in="${e.eventDescription.protocol.parameters}" var="param">
     307          <td>
     308            ${param.name} : ${param.listEntries}
     309          </td>
     310            </g:each>
     311          </tr>
     312          </g:each>
     313
     314
     315        </table>
    213316        </td>
    214317           </g:each>
     
    217320
    218321      </div>
    219 
    220       <a href="#"> Assays </a><div>
     322         
     323          <div id="event-description">
     324  <table border="2">
     325  <tr>
     326         <g:each in="${selectedStudies}" var="study">
     327          <td><center><b>${study.title}</b></center></td>
     328         </g:each>
     329  </tr>
     330   <tr>
     331         <g:each in="${selectedStudies}" var="stud">
     332           <td>
     333           <table>
     334          <tr>
     335
     336            <td><b>Event Name</b></td>
     337            <td><b>Parameters </b></td>
     338          </tr>
     339          <tr>
     340            <td><b></b></td>
     341            <td><b>Name</b></td>
     342            <td><b>Description</b></td>
     343            <td><b>Unit</b></td>
     344            <td><b>Reference</b></td>
     345            <td><b>Options</b></td>
     346            <td><b>Type</b></td>
     347          </tr>
     348          <g:each in="${dbnp.studycapturing.EventDescription.list()}" var="e">
     349          <g:if test="${(stud.events.eventDescription.contains(e))}" >
     350            <tr>
     351              <td>${e.name} </td></tr><tr>
     352            <g:each in="${e.protocol.parameters}" var="p">
     353              <td></td>
     354          <td>${p.name}</td>
     355          <td>${p.description}</td>
     356          <td>${p.unit}</td>
     357          <td>${p.reference}</td>
     358          <g:if test="${(p.listEntries.size()==0)}" >
     359          <td>-</td>
     360            </g:if>
     361          <g:else>
     362          <td>${p.listEntries}</td>
     363          </g:else>
     364          <td>${p.type}</td>
     365            </tr>
     366            </g:each>
     367            </g:if>
     368            </g:each>
     369
     370           <g:each in="${dbnp.studycapturing.EventDescription.list()}" var="e">
     371          <g:if test="${(stud.samplingEvents.eventDescription.contains(e))}" >
     372            <tr>
     373              <td>${e.name} </td></tr><tr>
     374            <g:each in="${e.protocol.parameters}" var="p">
     375              <td></td>
     376          <td>${p.name}</td>
     377          <td>${p.description}</td>
     378          <td>${p.unit}</td>
     379          <td>${p.reference}</td>
     380          <g:if test="${(p.listEntries.size()==0)}" >
     381          <td>-</td>
     382            </g:if>
     383          <g:else>
     384          <td>${p.listEntries}</td>
     385          </g:else>
     386          <td>${p.type}</td>
     387            </tr>
     388            </g:each>
     389            </g:if>
     390            </g:each>
     391
     392  </table>
     393        </td>
     394           </g:each>
     395         </tr>
     396       </table>
     397
     398          </div>
     399
     400          <div id="event-group">
     401          </div>
     402
     403          <div id="assays">
     404   <table border="2">
     405  <tr>
     406         <g:each in="${selectedStudies}" var="study">
     407          <td><center><b>${study.title}</b></center></td>
     408         </g:each>
     409  </tr>
     410   <tr>
     411         <g:each in="${selectedStudies}" var="stud">
     412           <td>
     413           <table>
     414             <tr><td>
     415  <g:if test="${stud.assays.size()==0}">
     416          No assays in this study
     417        </g:if>
     418        <g:else>
     419          <table>
     420            <tr>
     421
     422              <td width="100"><b>Assay Name</b></td>
     423              <td width="100"><b>Module</b></td>
     424              <td><b>Type</b></td>
     425              <td width="150"><b>Platform</b></td>
     426              <td><b>Url</b></td>
     427              <td><b>Samples</b></td>
     428            </tr>
     429          <g:each in="${stud.assays}" var="assay">
     430            <tr>
     431            <td>${assay.name}</td>
     432            <td>${assay.module.name}</td>
     433            <td>${assay.module.type}</td>
     434            <td>${assay.module.platform}</td>
     435            <td>${assay.module.url}</td>
     436            <td>
     437              <g:each in="${assay.samples}" var="assaySample">
     438                ${assaySample.name}<br>
     439              </g:each>
     440            </td>
     441          </tr>
     442          </g:each>
     443          </table>
     444        </g:else>
     445
     446
     447  </table>
     448        </td>
     449           </g:each>
     450         </tr>
     451       </table>
     452
    221453      </div>
    222454
  • trunk/grails-app/views/study/show.gsp

    r212 r223  
    99      <script type="text/javascript">
    1010        $(function() {
    11                 $("#accordion").accordion();
     11                $("#tabs").tabs();
    1212        });
    1313      </script>
     
    3131    <% protocolList = dbnp.studycapturing.Protocol.list() %>
    3232
    33     <div id="accordion">
    34       <a href="#"> Study Information </a>
     33
     34
     35      <div id="tabs">
     36      <ul>
     37        <li><a href="#study">Study Information</a></li>
     38        <li><a href="#subjects">Subjects</a></li>
     39        <li><a href="#groups">Groups</a></li>
     40        <li><a href="#protocols">Protocols</a></li>
     41        <li><a href="#events">Events</a></li>
     42        <li><a href="#event-description">Event Description</a></li>
     43        <li><a href="#event-group">Event Groups</a></li>
     44        <li><a href="#assays">Assays</a></li>
     45      </ul>
     46
     47    <div id="study">
    3548       
    36        <div><b> Id </b>: ${fieldValue(bean: studyInstance, field: "id")} <br>
     49         <b> Id </b>: ${fieldValue(bean: studyInstance, field: "id")} <br>
    3750         <b>Template </b>:<g:link controller="template" action="show" id="${studyInstance?.template?.id}">${studyInstance?.template?.encodeAsHTML()}</g:link><br>
    3851         <b> Start </b>:<g:formatDate date="${studyInstance?.startDate}" /> <br>
     
    116129       </div>
    117130
    118       <a href="#"> Subjects </a><div>
     131        <div id="subjects">
    119132        <table>
    120133          <tr>
     
    146159      </div>
    147160
    148        <a href="#"> Groups </a> <div>
     161        <div id="groups">
    149162         <g:if test="${studyInstance.groups.size()==0}">
    150163           No groups in this study
     
    157170         </div>
    158171
    159        <a href="#"> Protocols </a><div>
     172        <div id="protocols">
    160173             <table>
    161174          <tr>
     
    165178            <td><b>Reference</b></td>
    166179          </tr>
    167           <g:each in="${dbnp.studycapturing .Protocol.list()}" var="s">
    168            
    169             <% if  ((studyInstance.events.eventDescription.protocol.contains(s))||
    170               (studyInstance.samplingEvents.eventDescription.protocol.contains(s))) { %>
    171            
    172             <tr>
    173               <td><g:link controller="protocol" action="show" id="${s.id}">${s.id}</g:link></td>
    174           <td>${s.name}</td>
     180
     181             <% def protocol_list = [] %>
     182          <% def tmp_protocol = studyInstance.events.eventDescription.protocol.get(0) %>
     183          <% def tmpBis_protocol = studyInstance.samplingEvents.eventDescription.protocol.get(0) %>
     184          <% protocol_list.add(tmp_protocol) %>
     185          <% protocol_list.add(tmpBis_protocol) %>
     186
     187            <g:each in="${studyInstance.events.eventDescription.protocol}" var="s">
     188
     189          <% if (tmp_protocol!=s) { %>
     190            <% protocol_list.add(s) %>
     191            <%}%>
     192          </g:each>
     193
     194          <g:each in="${studyInstance.samplingEvents.eventDescription.protocol}" var="s">
     195
     196          <% if (tmpBis_protocol!=s) { %>
     197            <% protocol_list.add(s) %>
     198            <%}%>
     199          </g:each>
     200
     201
     202            <g:each in="${protocol_list}" var="protocol">
     203            <tr>
     204              <td><g:link controller="protocol" action="show" id="${protocol.id}">${protocol.id}</g:link></td>
     205          <td>${protocol.name}</td>
    175206          <td>
    176           <g:each in="${s.parameters}" var="p"><ul><li>
     207          <g:each in="${protocol.parameters}" var="p"><ul><li>
    177208            <g:link controller="protocolParameter" action="show" id="${p.id}">${p.name}</g:link>
    178209            </li></ul>
    179210          </g:each>
    180211          </td>
    181           <td>${s.reference}</td>
    182           </tr>
    183  <%  } %>
     212          <td>${protocol.reference}</td>
     213          </tr>
    184214
    185215          </g:each>
     
    187217       </div>
    188218
    189       <a href="#"> Events </a><div>
     219        <div id="events">
    190220          <table>
    191221          <tr>
     
    205235           <td><g:link controller="event" action="show" id="${e.id}">  ${e.eventDescription.name}</g:link></td>
    206236            <td><g:checkBox name="event" disabled="${true}" value="${false}"/></td>
    207           <td>${e.eventDescription.protocol.parameters.name}</td>
    208           </tr>
     237
     238            <g:each in="${e.eventDescription.protocol.parameters}" var="param">
     239          <td>
     240            ${param.name} : ${param.listEntries}
     241          </td>
     242            </g:each>
     243            </tr>
    209244          </g:each>
    210245
     
    215250          <td>${e.getPrettyDuration()}</td>
    216251           <td><g:link controller="event" action="show" id="${e.id}">  ${e.eventDescription.name}</g:link></td>
    217             <td><g:checkBox name="samplingEvent" disabled="${true}" value="${true}"/>
    218             </td>
    219           <td>${e.eventDescription.protocol.parameters.name}</td>
     252            <td><g:checkBox name="samplingEvent" disabled="${true}" value="${true}"/></td>
     253
     254            <g:each in="${e.eventDescription.protocol.parameters}" var="param">
     255          <td>
     256            ${param.name} : ${param.listEntries}
     257          </td>
     258            </g:each>
    220259          </tr>
    221260          </g:each>
     
    224263      </div>
    225264
    226       <a href="#"> Event Description </a><div>
     265        <div id="event-description">
    227266          <table>
    228267          <tr>
     
    292331      </div>
    293332
    294       <a href="#"> Assays </a><div>
     333        <div id="event-group">
     334        </div>
     335
     336        <div id="assays">
    295337        <g:if test="${studyInstance.assays.size()==0}">
    296338          No assays in this study
Note: See TracChangeset for help on using the changeset viewer.