Changeset 91


Ignore:
Timestamp:
Jan 19, 2010, 2:11:11 PM (14 years ago)
Author:
ademcan
Message:

list and show for the studies list

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/application.properties

    r86 r91  
    11#Grails Metadata file
    2 #Fri Jan 08 14:58:48 CET 2010
     2#Tue Jan 19 09:09:51 CET 2010
    33app.grails.version=1.2.0
    44app.name=gscf
     
    1111plugins.mail=0.9
    1212plugins.nimble=0.3-SNAPSHOT
     13plugins.richui=0.7
    1314plugins.shiro=1.0.1
    1415plugins.tomcat=1.2.0
  • trunk/grails-app/conf/DataSource.groovy

    r80 r91  
    1414        development {
    1515                dataSource {
     16
     17                        dbCreate = "update"
     18                        username = "gscf"
     19                        password = "dbnp"
     20
     21                        // PostgreSQL
     22                        driverClassName = "org.postgresql.Driver"
     23                        url = "jdbc:postgresql://localhost:5432/gscf"
     24                        dialect = org.hibernate.dialect.PostgreSQLDialect
     25
     26                        /**
    1627                        dbCreate = "create-drop" // one of 'create', 'create-drop','update'
    1728                        url = "jdbc:hsqldb:mem:devDB"
     29                        */
    1830                }
    1931        }
  • trunk/grails-app/controllers/StudyController.groovy

    r74 r91  
    1515class StudyController extends BaseController {
    1616    def scaffold = dbnp.studycapturing.Study
     17
     18    def see = {
     19        render params
     20    }
    1721}
  • trunk/grails-app/views/study/list.gsp

    r85 r91  
    22<%@ page import="dbnp.studycapturing.Study" %>
    33<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     </head>
    10     <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
    14         </div>
    15         <div class="body">
    16             <h1><g:message code="default.list.label" args="[entityName]" /></h1>
    17             <g:if test="${flash.message}">
    18             <div class="message">${flash.message}</div>
    19             </g:if>
    20             <div class="list">
    21                 <!--table>
    22                     <thead>
    23                         <tr>
    24                        
    25                             <g:sortableColumn property="id" title="${message(code: 'study.id.label', default: 'Id')}" />
    26 <g:sortableColumn property="id" title="TEST" />
    27                        
    28                             <th><g:message code="study.template.label" default="Template" /></th>
    29                            
    30                             <g:sortableColumn property="startDate" title="${message(code: 'study.startDate.label', default: 'Start Date')}" />
    31 <g:sortableColumn property="startDate" title="TEST" />
    32                        
    33                             <g:sortableColumn property="lastUpdated" title="${message(code: 'study.lastUpdated.label', default: 'Last Updated')}" />
    34 <g:sortableColumn property="lastUpdated" title="TEST" />
    35                        
    36                             <g:sortableColumn property="code" title="${message(code: 'study.code.label', default: 'Code')}" />
    37 <g:sortableColumn property="code" title="TEST" />
    38                        
    39                             <g:sortableColumn property="ecCode" title="${message(code: 'study.ecCode.label', default: 'Ec Code')}" />
    40 <g:sortableColumn property="ecCode" title="TEST" />
    41                        
    42                         </tr>
    43                     </thead>
    44                     <tbody-->
     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</head>
     10<body>
     11 
     12 <!--g:form url="[action:'see',controller:'study']"-->
     13  <g:form action="show.gsp">
    4514
     15  <div class="nav">
     16    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
     17    <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
     18  </div>
     19  <div class="body">
     20    <h1><g:message code="default.list.label" args="[entityName]" /></h1>
     21    <g:if test="${flash.message}">
     22      <div class="message">${flash.message}</div>
     23    </g:if>
     24    <div class="list">
     25      <g:each in="${studyInstanceList}" status="i" var="studyInstance">
     26        <br>
     27        <table>
     28          <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
     29            <td><input type="checkbox" name="${studyInstance.id}" id="${studyInstance.id}"></td>
    4630
    47                     <g:each in="${studyInstanceList}" status="i" var="studyInstance">
    48                         <br>
    49                         <table>
    50                         <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
    51                         <td><input type="checkbox"></td>
    52                        
     31            <td width=200>
     32          <g:link action="show" id="${studyInstance.id}">
     33${message(code: 'study.id.label', default: 'Id')} :
     34${fieldValue(bean: studyInstance, field: "id")}</g:link></td>
    5335
    54 
    55                             <td width=200>
    56 <g:link action="show" id="${studyInstance.id}">${message(code: 'study.id.label', default: 'Id')} : ${fieldValue(bean: studyInstance, field: "id")}</g:link></td>
    57                        
    58 
    59                             <td width=300>
     36          <td width=300>
    6037${message(code: 'study.template.label', default: 'Template')} :
    6138${fieldValue(bean: studyInstance, field: "template")}</td>
    62                        
    6339
    64                             <td width=500>
     40          <td width=500>
    6541${message(code: 'study.startDate.label', default: 'Start Date')} :
    66 <g:formatDate date="${studyInstance.startDate}" /></td>
    67                        
     42          <g:formatDate date="${studyInstance.startDate}" /></td>
    6843
    69                             <td width=500>
     44          <td width=500>
    7045${message(code: 'study.lastUpdated.label', default: 'Last Updated')} :
    71 <g:formatDate date="${studyInstance.lastUpdated}" /></td>
    72                        
     46          <g:formatDate date="${studyInstance.lastUpdated}" /></td>
    7347
    74                             <td width=300>
     48          <td width=300>
    7549${message(code: 'study.code.label', default: 'Code')} :
    7650${fieldValue(bean: studyInstance, field: "code")}</td>
    77                        
    7851
    79                             <td width=300>
     52          <td width=300>
    8053${message(code: 'study.ecCode.label', default: 'Ec Code')} :
    8154${fieldValue(bean: studyInstance, field: "ecCode")}</td>
    82                        
    83                         </tr>
    84                         </table>
    85                
    86                         <!--/tr-->
    8755
    88                     </g:each>
    89 
    90 
    91                     <!--/tbody-->
    92                 </table>
    93             </div>
    94             <div class="paginateButtons">
    95                 <g:paginate total="${studyInstanceTotal}" />
    96             </div>
    97         </div>
    98     </body>
     56          </tr>
     57        </table>
     58      </g:each>
     59      </table>
     60    </div>
     61    <div class="paginateButtons">
     62      <g:paginate total="${studyInstanceTotal}" />
     63      <br>
     64      <INPUT TYPE=submit name=submit Value="Compare selected studies">
     65    </div>
     66  </div>
     67</g:form>
     68</body>
    9969</html>
  • trunk/grails-app/views/study/show.gsp

    r85 r91  
    22<%@ page import="dbnp.studycapturing.Study" %>
    33<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.show.label" args="[entityName]" /></title>
    9     </head>
    10     <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
    14             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
    15         </div>
    16         <div class="body">
    17             <h1><g:message code="default.show.label" args="[entityName]" /></h1>
    18             <g:if test="${flash.message}">
    19             <div class="message">${flash.message}</div>
    20             </g:if>
    21             <div class="dialog">
    22                 <table>
    23                     <tbody>
    24                    
    25                         <tr class="prop">
    26                             <td valign="top" class="name"><g:message code="study.id.label" default="Id" /></td>
    27                            
    28                             <td valign="top" class="value">${fieldValue(bean: studyInstance, field: "id")}</td>
    29                            
    30                         </tr>
    31                    
    32                         <tr class="prop">
    33                             <td valign="top" class="name"><g:message code="study.template.label" default="Template" /></td>
    34                            
    35                             <td valign="top" class="value"><g:link controller="template" action="show" id="${studyInstance?.template?.id}">${studyInstance?.template?.encodeAsHTML()}</g:link></td>
    36                            
    37                         </tr>
    38                    
    39                         <tr class="prop">
    40                             <td valign="top" class="name"><g:message code="study.startDate.label" default="Start Date" /></td>
    41                            
    42                             <td valign="top" class="value"><g:formatDate date="${studyInstance?.startDate}" /></td>
    43                            
    44                         </tr>
    45                    
    46                         <tr class="prop">
    47                             <td valign="top" class="name"><g:message code="study.samplingEvents.label" default="Sampling Events" /></td>
    48                            
    49                             <td valign="top" style="text-align: left;" class="value">
    50                                 <ul>
    51                                 <g:each in="${studyInstance.samplingEvents}" var="s">
    52                                     <li><g:link controller="samplingEvent" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    53                                 </g:each>
    54                                 </ul>
    55                             </td>
    56                            
    57                         </tr>
    58                    
    59                         <tr class="prop">
    60                             <td valign="top" class="name"><g:message code="study.subjects.label" default="Subjects" /></td>
    61                            
    62                             <td valign="top" style="text-align: left;" class="value">
    63                                 <ul>
    64                                 <g:each in="${studyInstance.subjects}" var="s">
    65                                     <li><g:link controller="subject" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    66                                 </g:each>
    67                                 </ul>
    68                             </td>
    69                            
    70                         </tr>
    71                    
    72                         <tr class="prop">
    73                             <td valign="top" class="name"><g:message code="study.events.label" default="Events" /></td>
    74                            
    75                             <td valign="top" style="text-align: left;" class="value">
    76                                 <ul>
    77                                 <g:each in="${studyInstance.events}" var="e">
    78                                     <li><g:link controller="event" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li>
    79                                 </g:each>
    80                                 </ul>
    81                             </td>
    82                            
    83                         </tr>
    84                    
    85                         <tr class="prop">
    86                             <td valign="top" class="name"><g:message code="study.lastUpdated.label" default="Last Updated" /></td>
    87                            
    88                             <td valign="top" class="value"><g:formatDate date="${studyInstance?.lastUpdated}" /></td>
    89                            
    90                         </tr>
    91                    
    92                         <tr class="prop">
    93                             <td valign="top" class="name"><g:message code="study.readers.label" default="Readers" /></td>
    94                            
    95                             <td valign="top" style="text-align: left;" class="value">
    96                                 <ul>
    97                                 <g:each in="${studyInstance.readers}" var="r">
    98                                     <li><g:link controller="user" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></li>
    99                                 </g:each>
    100                                 </ul>
    101                             </td>
    102                            
    103                         </tr>
    104                    
    105                         <tr class="prop">
    106                             <td valign="top" class="name"><g:message code="study.code.label" default="Code" /></td>
    107                            
    108                             <td valign="top" class="value">${fieldValue(bean: studyInstance, field: "code")}</td>
    109                            
    110                         </tr>
    111                    
    112                         <tr class="prop">
    113                             <td valign="top" class="name"><g:message code="study.editors.label" default="Editors" /></td>
    114                            
    115                             <td valign="top" style="text-align: left;" class="value">
    116                                 <ul>
    117                                 <g:each in="${studyInstance.editors}" var="e">
    118                                     <li><g:link controller="user" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li>
    119                                 </g:each>
    120                                 </ul>
    121                             </td>
    122                            
    123                         </tr>
    124                    
    125                         <tr class="prop">
    126                             <td valign="top" class="name"><g:message code="study.ecCode.label" default="Ec Code" /></td>
    127                            
    128                             <td valign="top" class="value">${fieldValue(bean: studyInstance, field: "ecCode")}</td>
    129                            
    130                         </tr>
    131                    
    132                         <tr class="prop">
    133                             <td valign="top" class="name"><g:message code="study.researchQuestion.label" default="Research Question" /></td>
    134                            
    135                             <td valign="top" class="value">${fieldValue(bean: studyInstance, field: "researchQuestion")}</td>
    136                            
    137                         </tr>
    138                    
    139                         <tr class="prop">
    140                             <td valign="top" class="name"><g:message code="study.title.label" default="Title" /></td>
    141                            
    142                             <td valign="top" class="value">${fieldValue(bean: studyInstance, field: "title")}</td>
    143                            
    144                         </tr>
    145                    
    146                         <tr class="prop">
    147                             <td valign="top" class="name"><g:message code="study.description.label" default="Description" /></td>
    148                            
    149                             <td valign="top" class="value">${fieldValue(bean: studyInstance, field: "description")}</td>
    150                            
    151                         </tr>
    152                    
    153                         <tr class="prop">
    154                             <td valign="top" class="name"><g:message code="study.owner.label" default="Owner" /></td>
    155                            
    156                             <td valign="top" class="value"><g:link controller="user" action="show" id="${studyInstance?.owner?.id}">${studyInstance?.owner?.encodeAsHTML()}</g:link></td>
    157                            
    158                         </tr>
    159                    
    160                         <tr class="prop">
    161                             <td valign="top" class="name"><g:message code="study.dateCreated.label" default="Date Created" /></td>
    162                            
    163                             <td valign="top" class="value"><g:formatDate date="${studyInstance?.dateCreated}" /></td>
    164                            
    165                         </tr>
    166                    
    167                         <tr class="prop">
    168                             <td valign="top" class="name"><g:message code="study.groups.label" default="Groups" /></td>
    169                            
    170                             <td valign="top" style="text-align: left;" class="value">
    171                                 <ul>
    172                                 <g:each in="${studyInstance.groups}" var="g">
    173                                     <li><g:link controller="subjectGroup" action="show" id="${g.id}">${g?.encodeAsHTML()}</g:link></li>
    174                                 </g:each>
    175                                 </ul>
    176                             </td>
    177                            
    178                         </tr>
    179                    
    180                     </tbody>
    181                 </table>
    182             </div>
    183             <div class="buttons">
    184                 <g:form>
    185                     <g:hiddenField name="id" value="${studyInstance?.id}" />
    186                     <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
    187                     <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
    188                 </g:form>
    189             </div>
    190         </div>
    191     </body>
     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.show.label" args="[entityName]" /></title>
     9</head>
     10<body>
     11
     12
     13        <script type="text/javascript">
     14         render "hello"
     15      </script>
     16
     17
     18<resource:accordion skin="default" />
     19<div class="nav">
     20  <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
     21  <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
     22  <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
     23</div>
     24<div class="body">
     25  <h1><g:message code="default.show.label" args="[entityName]" /></h1>
     26  <g:if test="${flash.message}">
     27    <div class="message">${flash.message}</div>
     28  </g:if>
     29  <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>
     35          <g:each in="${studyInstance.samplingEvents}" var="s">
     36            <li><g:link controller="samplingEvent" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     37          </g:each>
     38        </ul> </richui:accordionItem>
     39      <richui:accordionItem id="1" caption="Subjects"> <ul>
     40          <g:each in="${studyInstance.subjects}" var="s">
     41            <li><g:link controller="subject" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     42          </g:each>
     43        </ul> </richui:accordionItem>
     44      <richui:accordionItem id="1" caption="Events"> <ul>
     45          <g:each in="${studyInstance.events}" var="e">
     46            <li><g:link controller="event" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li>
     47          </g:each>
     48        </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>
     52          <g:each in="${studyInstance.readers}" var="r">
     53            <li><g:link controller="user" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></li>
     54          </g:each>
     55        </ul> </richui:accordionItem>
     56
     57      <richui:accordionItem id="1" caption="Code">${fieldValue(bean: studyInstance, field: "code")} </richui:accordionItem>
     58      <richui:accordionItem id="1" caption="Editors">     <ul>
     59          <g:each in="${studyInstance.editors}" var="e">
     60            <li><g:link controller="user" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li>
     61          </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>
     70          <g:each in="${studyInstance.groups}" var="g">
     71            <li><g:link controller="subjectGroup" action="show" id="${g.id}">${g?.encodeAsHTML()}</g:link></li>
     72          </g:each>
     73        </ul> </richui:accordionItem>
     74
     75    </richui:accordion>
     76  </div>
     77  <br>
     78  <div class="buttons">
     79    <g:form>
     80      <g:hiddenField name="id" value="${studyInstance?.id}" />
     81      <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
     82      <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
     83    </g:form>
     84  </div>
     85</div>
     86</body>
    19287</html>
Note: See TracChangeset for help on using the changeset viewer.