Changeset 95


Ignore:
Timestamp:
Jan 19, 2010, 3:39:33 PM (8 years ago)
Author:
ademcan
Message:

list and show for the studies list

Location:
trunk/grails-app
Files:
3 edited

Legend:

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

    r92 r95  
    1616class BootStrap {
    1717        def init = {servletContext ->
     18
     19            new Study(title:"test",code:"code",researchQuestion:"Rquestion",description:"description",ecCode:"ecCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save()
     20
    1821                if (GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) {
    1922                        printf("development bootstrapping....\n\n");
  • trunk/grails-app/domain/dbnp/studycapturing/Study.groovy

    r92 r95  
    2121
    2222        static constraints = {
    23                 //template(nullable:true,blank:true)
     23                owner(nullable:true,blank:true)
     24                template(nullable:true,blank:true)
    2425        }
    2526
  • trunk/grails-app/views/study/show.gsp

    r91 r95  
    77  <g:set var="entityName" value="${message(code: 'study.label', default: 'Study')}" />
    88  <title><g:message code="default.show.label" args="[entityName]" /></title>
     9
     10        <my:jqueryui/>
     11      <script type="text/javascript">
     12        $(function() {
     13                $("#accordion").accordion();
     14        });
     15      </script>
     16
    917</head>
    1018<body>
    11 
    12 
    13         <script type="text/javascript">
    14          render "hello"
    15       </script>
    16 
    17 
    18 <resource:accordion skin="default" />
    1919<div class="nav">
    2020  <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
     
    2222  <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
    2323</div>
     24
    2425<div class="body">
    2526  <h1><g:message code="default.show.label" args="[entityName]" /></h1>
     
    2829  </g:if>
    2930  <div class="dialog">
    30     <richui:accordion>
    31       <richui:accordionItem id="1" caption="Id"> ${fieldValue(bean: studyInstance, field: "id")} </richui:accordionItem>
    32       <richui:accordionItem id="1" caption="Template"> <g:link controller="template" action="show" id="${studyInstance?.template?.id}">${studyInstance?.template?.encodeAsHTML()}</g:link> </richui:accordionItem>
    33       <richui:accordionItem id="1" caption="Start Date"> <g:formatDate date="${studyInstance?.startDate}" /> </richui:accordionItem>
    34       <richui:accordionItem id="1" caption="Sampling Events">  <ul>
     31
     32    <div id="accordion">
     33      <a href="#"> Id </a> <div> ${fieldValue(bean: studyInstance, field: "id")} </div>
     34      <a href="#"> Template </a> <div> <g:link controller="template" action="show" id="${studyInstance?.template?.id}">${studyInstance?.template?.encodeAsHTML()}</g:link> </div>
     35      <a href="#"> Start Date </a> <div> <g:formatDate date="${studyInstance?.startDate}" /> </div>
     36      <a href="#"> Sampling Events </a> <div>  <ul>
    3537          <g:each in="${studyInstance.samplingEvents}" var="s">
    3638            <li><g:link controller="samplingEvent" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    3739          </g:each>
    38         </ul> </richui:accordionItem>
    39       <richui:accordionItem id="1" caption="Subjects"> <ul>
     40        </ul> </div>
     41      <a href="#"> Subjects </a><div> <ul>
    4042          <g:each in="${studyInstance.subjects}" var="s">
    4143            <li><g:link controller="subject" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    4244          </g:each>
    43         </ul> </richui:accordionItem>
    44       <richui:accordionItem id="1" caption="Events"> <ul>
     45        </ul> </div>
     46      <a href="#"> Events </a><div> <ul>
    4547          <g:each in="${studyInstance.events}" var="e">
    4648            <li><g:link controller="event" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li>
    4749          </g:each>
    4850        </ul>
    49       </richui:accordionItem>
    50       <richui:accordionItem id="1" caption="Last Updated"> <g:formatDate date="${studyInstance?.lastUpdated}" /> </richui:accordionItem>
    51       <richui:accordionItem id="1" caption="Readers">  <ul>
     51      </div>
     52      <a href="#"> Last Updated </a><div> <g:formatDate date="${studyInstance?.lastUpdated}" /> </div>
     53      <a href="#"> Readers </a> <div>  <ul>
    5254          <g:each in="${studyInstance.readers}" var="r">
    5355            <li><g:link controller="user" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></li>
    5456          </g:each>
    55         </ul> </richui:accordionItem>
     57        </ul> </div>
    5658
    57       <richui:accordionItem id="1" caption="Code">${fieldValue(bean: studyInstance, field: "code")} </richui:accordionItem>
    58       <richui:accordionItem id="1" caption="Editors">    <ul>
     59      <a href="#"> Code </a><div> ${fieldValue(bean: studyInstance, field: "code")} </div>
     60      <a href="#"> Editors </a> <div> <ul>
    5961          <g:each in="${studyInstance.editors}" var="e">
    6062            <li><g:link controller="user" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li>
    6163          </g:each>
    62         </ul> </richui:accordionItem>
    63       <richui:accordionItem id="1" caption="EC Code">${fieldValue(bean: studyInstance, field: "ecCode")} </richui:accordionItem>
    64       <richui:accordionItem id="1" caption="Research Question">${fieldValue(bean: studyInstance, field: "researchQuestion")} </richui:accordionItem>
    65       <richui:accordionItem id="1" caption="Title">${fieldValue(bean: studyInstance, field: "title")} </richui:accordionItem>
    66       <richui:accordionItem id="1" caption="Description">${fieldValue(bean: studyInstance, field: "description")} </richui:accordionItem>
    67       <richui:accordionItem id="1" caption="Owner"> <g:link controller="user" action="show" id="${studyInstance?.owner?.id}">${studyInstance?.owner?.encodeAsHTML()}</g:link> </richui:accordionItem>
    68       <richui:accordionItem id="1" caption="Date Created"> <g:formatDate date="${studyInstance?.dateCreated}" /> </richui:accordionItem>
    69       <richui:accordionItem id="1" caption="Groups"><ul>
     64        </ul> </div>
     65     <a href="#"> EC Code </a> <div>${fieldValue(bean: studyInstance, field: "ecCode")} </div>
     66     <a href="#"> Research Question </a> <div>${fieldValue(bean: studyInstance, field: "researchQuestion")} </div>
     67     <a href="#"> Title </a><div> ${fieldValue(bean: studyInstance, field: "title")} </div>
     68      <a href="#"> Description </a> <div> ${fieldValue(bean: studyInstance, field: "description")} </div>
     69      <a href="#"> Owner </a><div> <g:link controller="user" action="show" id="${studyInstance?.owner?.id}">${studyInstance?.owner?.encodeAsHTML()}</g:link> </div>
     70      <a href="#"> Date Created </a><div> <g:formatDate date="${studyInstance?.dateCreated}" /> </div>
     71      <a href="#"> Groups </a> <div><ul>
    7072          <g:each in="${studyInstance.groups}" var="g">
    7173            <li><g:link controller="subjectGroup" action="show" id="${g.id}">${g?.encodeAsHTML()}</g:link></li>
    7274          </g:each>
    73         </ul> </richui:accordionItem>
    74 
    75     </richui:accordion>
     75        </ul> </div>
    7676  </div>
     77    </div>
    7778  <br>
    7879  <div class="buttons">
     
    8485  </div>
    8586</div>
     87</div>
    8688</body>
    8789</html>
Note: See TracChangeset for help on using the changeset viewer.