Changeset 148
- Timestamp:
- Jan 29, 2010, 12:51:25 PM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r146 r148 140 140 } 141 141 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() 145 176 } 146 177 } -
trunk/grails-app/views/study/list.gsp
r135 r148 10 10 <body> 11 11 12 <!--g:form url="[action:'list_extended',controller:'study']"-->13 12 <g:form action="list_extended.gsp"> 14 13 -
trunk/grails-app/views/study/list_extended.gsp
r137 r148 44 44 <% }} %> 45 45 46 <% if (selectedStudies.size()>0) {%> 46 47 47 48 <div id="tabs"> … … 51 52 </g:each> 52 53 </ul> 53 54 54 <g:each in="${selectedStudies}" status="i" var="studyIns"> 55 56 57 55 <div id="${studyIns}"> 58 56 <g:each in="${att_list}" status="s" var="attribute"> 59 57 ${message(code: 'study.id.'+attribute , default: attribute)} : 60 ${fieldValue(bean: studyIns, field: attribute)} 61 <br> 58 ${fieldValue(bean: studyIns, field: attribute)}<br> 62 59 </g:each> 63 60 </div> 64 65 61 </g:each> 66 62 </div> 63 64 <% } %> 65 66 <% if (selectedStudies.size()==0) {%> 67 Please select studies to compare. 68 <% } %> 67 69 68 70 </div> -
trunk/grails-app/views/study/show.gsp
r142 r148 28 28 </g:if> 29 29 <div class="dialog"> 30 31 <% protocolList = dbnp.studycapturing.Protocol.list() %> 30 32 31 33 <div id="accordion"> … … 64 66 <tr> 65 67 <td><b>Id </b></td> 66 <td><b>Template Integer Fields</b></td>67 68 <td><b>Species</b></td> 68 <td><b>Template Term Fields</b></td>69 69 <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> 72 76 </tr> 77 73 78 <g:each in="${studyInstance.subjects}" var="s"> 74 79 <tr> 75 80 <td><g:link controller="subject" action="show" id="${s.id}">${s.id}</g:link></td> 76 <td>${s.templateIntegerFields}</td>77 81 <td>${s.species}</td> 78 <td>${s.templateTermFields}</td>79 82 <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> 82 95 </tr> 83 96 </g:each> … … 99 112 <td><b>Reference</b></td> 100 113 </tr> 101 <g:each in="${ studyInstance.events.eventDescription.protocol}" var="s">114 <g:each in="${protocolList}" var="s"> 102 115 <tr> 103 116 <td><g:link controller="protocol" action="show" id="${s.id}">${s.id}</g:link></td> 104 117 <td>${s.name}</td> 105 118 <td> 106 <g:each in="${s.parameters}" var="p"> 119 <g:each in="${s.parameters}" var="p"><ul><li> 107 120 <g:link controller="protocolParameter" action="show" id="${p.id}">${p.name}</g:link> 121 </li></ul> 108 122 </g:each> 109 123 </td>
Note: See TracChangeset
for help on using the changeset viewer.