Ignore:
Timestamp:
Oct 23, 2009, 9:49:35 AM (14 years ago)
Author:
gav
Message:

Add Department-Person relationship, update demo data and views to suite.
Add department and personGroups to Person views.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/department/edit.gsp

    r162 r164  
    3232                            <tr class="prop">
    3333                                <td valign="top" class="name">
    34                                     <label for="costCode">Cost Code:</label>
     34                                    <label for="name">Name:</label>
    3535                                </td>
    36                                 <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'costCode','errors')}">
    37                                     <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:departmentInstance,field:'costCode')}"/>
     36                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'name','errors')}">
     37                                    <input type="text" id="name" name="name" value="${fieldValue(bean:departmentInstance,field:'name')}"/>
    3838                                </td>
    3939                            </tr>
     
    5050                            <tr class="prop">
    5151                                <td valign="top" class="name">
     52                                    <label for="costCode">Cost Code:</label>
     53                                </td>
     54                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'costCode','errors')}">
     55                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:departmentInstance,field:'costCode')}"/>
     56                                </td>
     57                            </tr>
     58                       
     59                            <tr class="prop">
     60                                <td valign="top" class="name">
    5261                                    <label for="isActive">Is Active:</label>
    5362                                </td>
     
    5968                            <tr class="prop">
    6069                                <td valign="top" class="name">
    61                                     <label for="name">Name:</label>
     70                                    <label for="persons">Persons:</label>
    6271                                </td>
    63                                 <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'name','errors')}">
    64                                     <input type="text" id="name" name="name" value="${fieldValue(bean:departmentInstance,field:'name')}"/>
     72                                <td valign="top" class="value ${hasErrors(bean:departmentInstance,field:'persons','errors')}">
     73                                   
     74<ul>
     75<g:each var="p" in="${departmentInstance?.persons?}">
     76    <li><g:link controller="person" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
     77</g:each>
     78</ul>
     79<g:link controller="person" params="['department.id':departmentInstance?.id]" action="create">Add Person</g:link>
     80
    6581                                </td>
    6682                            </tr>
Note: See TracChangeset for help on using the changeset viewer.