Changeset 148


Ignore:
Timestamp:
Jan 29, 2010, 12:51:25 PM (13 years ago)
Author:
ademcan
Message:

reorganization of the study views : template and protocol views in the accordion menu

Location:
trunk/grails-app
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r146 r148  
    140140                        }
    141141
    142                         new Study(title:"example",code:"Excode",researchQuestion:"ExRquestion",description:"Exdescription",ecCode:"ExecCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save()
    143                         new Study(title:"testAgain",code:"testcode",researchQuestion:"testRquestion",description:"testdescription",ecCode:"testCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save()
    144                         new Study(title:"Exampletest",code:"Examplecode",researchQuestion:"ExampleRquestion",description:"Exampledescription",ecCode:"ExampleecCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save()
     142
     143                        def secondStudy = new Study(
     144                                title:"NuGO PPS1 mouse study leptin module",
     145                                code:"PPS1",
     146                                researchQuestion:"etc.",
     147                                description:"C57Bl/6 mice were fed a high fat (45 en%) or low fat (10 en%) diet after a four week run-in on low fat diet. After 1 week 10 mice that received a low fat diet were given an IP leptin challenge and 10 mice of the low-fat group received placebo injections. The same procedure was performed with mice that were fed the high-fat diet. After 4 weeks the procedure was repeated. In total 80 mice were culled.",
     148                                ecCode:"2007.c",
     149                                startDate: Date.parse('yyyy-MM-dd','2007-12-11'),
     150                                template: mouseTemplate
     151                        ).with { if (!validate()) { errors.each { println it} } else save()}
     152
     153                        def y=1
     154                        5.times {
     155                                def currentSubject = new Subject(
     156                                        name: "A" + y++,
     157                                        species: mouseTerm,
     158                                        template: mouseTemplate,
     159                                        templateStringFields: ["Genotype" : "C57/Bl6j", "Gender" : "Male"],
     160                                        templateIntegerFields: ["Age" : 17, "Cage" : (int)(y/2)]
     161                                ).with { if (!validate()) { errors.each { println it} } else save()}
     162
     163                                secondStudy.addToSubjects(currentSubject)
     164                                .addToEvents(new Event(
     165                                        subject: currentSubject,
     166                                        startTime: Date.parse('yyyy-MM-dd','2008-01-07'),
     167                                        endTime: Date.parse('yyyy-MM-dd','2008-01-14'),
     168                                        eventDescription: eventTreatment,
     169                                        parameterStringValues: ['Diet':'10% fat (palm oil)','Compound':'Vehicle','Administration':'intraperitoneal injection'])
     170                                ).with { if (!validate()) { errors.each { println it} } else save()}
     171                        }
     172
     173//                        new Study(title:"example",code:"Excode",researchQuestion:"ExRquestion",description:"Exdescription",ecCode:"ExecCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save()
     174//                        new Study(title:"testAgain",code:"testcode",researchQuestion:"testRquestion",description:"testdescription",ecCode:"testCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save()
     175//                        new Study(title:"Exampletest",code:"Examplecode",researchQuestion:"ExampleRquestion",description:"Exampledescription",ecCode:"ExampleecCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save()
    145176                }
    146177        }
  • trunk/grails-app/views/study/list.gsp

    r135 r148  
    1010<body>
    1111
    12  <!--g:form url="[action:'list_extended',controller:'study']"-->
    1312  <g:form action="list_extended.gsp">
    1413
  • trunk/grails-app/views/study/list_extended.gsp

    r137 r148  
    4444     <% }} %>
    4545
     46    <% if (selectedStudies.size()>0) {%>
    4647
    4748    <div id="tabs">
     
    5152      </g:each>
    5253      </ul>
    53 
    5454      <g:each in="${selectedStudies}" status="i" var="studyIns">
    55 
    56        
    5755      <div id="${studyIns}">
    5856        <g:each in="${att_list}" status="s" var="attribute">
    5957              ${message(code: 'study.id.'+attribute , default: attribute)} :
    60               ${fieldValue(bean: studyIns, field: attribute)}
    61                             <br>
     58              ${fieldValue(bean: studyIns, field: attribute)}<br>
    6259        </g:each>
    6360      </div>
    64 
    6561        </g:each>
    6662    </div>
     63
     64    <% } %>
     65   
     66     <% if (selectedStudies.size()==0) {%>
     67    Please select studies to compare.
     68    <% } %>
    6769
    6870    </div>
  • trunk/grails-app/views/study/show.gsp

    r142 r148  
    2828  </g:if>
    2929  <div class="dialog">
     30
     31    <% protocolList = dbnp.studycapturing.Protocol.list() %>
    3032
    3133    <div id="accordion">
     
    6466          <tr>
    6567            <td><b>Id </b></td>
    66             <td><b>Template Integer Fields</b></td>
    6768            <td><b>Species</b></td>
    68             <td><b>Template Term Fields</b></td>
    6969            <td><b>Name</b></td>
    70             <td><b>Template Float Fields</b></td>
    71             <td><b>Template String Fields</b></td>
     70          <g:each in="${studyInstance.template.subjectFields}" var="g">
     71            <td><b>
     72              <g:link controller="templateSubjectField" action="show" id="${g.id}">
     73              ${g}</b></td>
     74            </g:link>
     75          </g:each>
    7276          </tr>
     77
    7378          <g:each in="${studyInstance.subjects}" var="s">
    7479            <tr>
    7580              <td><g:link controller="subject" action="show" id="${s.id}">${s.id}</g:link></td>
    76               <td>${s.templateIntegerFields}</td>
    7781              <td>${s.species}</td>
    78               <td>${s.templateTermFields}</td>
    7982              <td>${s.name}</td>
    80               <td>${s.templateFloatFields}</td>
    81               <td>${s.templateStringFields}</td>
     83
     84                <g:each in="${studyInstance.template.subjectFields}" var="g">
     85               <td>
     86              <% if (g.type==dbnp.studycapturing.TemplateFieldType.INTEGER){ %>
     87                  <% print s.templateIntegerFields.get(g.toString())  %>
     88              <% } %>
     89               <% if (g.type==dbnp.studycapturing.TemplateFieldType.STRINGLIST){ %>
     90                <% print s.templateStringFields.get(g.toString())  %>
     91              <% } %>
     92
     93            </td>
     94          </g:each>
    8295          </tr>
    8396          </g:each>
     
    99112            <td><b>Reference</b></td>
    100113          </tr>
    101           <g:each in="${studyInstance.events.eventDescription.protocol}" var="s">
     114          <g:each in="${protocolList}" var="s">
    102115            <tr>
    103116              <td><g:link controller="protocol" action="show" id="${s.id}">${s.id}</g:link></td>
    104117          <td>${s.name}</td>
    105118          <td>
    106           <g:each in="${s.parameters}" var="p">
     119          <g:each in="${s.parameters}" var="p"><ul><li>
    107120            <g:link controller="protocolParameter" action="show" id="${p.id}">${p.name}</g:link>
     121            </li></ul>
    108122          </g:each>
    109123          </td>
Note: See TracChangeset for help on using the changeset viewer.