Ignore:
Timestamp:
Jan 14, 2010, 10:51:03 PM (14 years ago)
Author:
gav
Message:

Refactor classes for asset tree refinement.
Regenerate views and controllers to suite.

Location:
trunk/grails-app/views/section
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/section/create.gsp

    r178 r268  
    55        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    66        <meta name="layout" content="main" />
    7         <title>Create SystemSection</title>
     7        <title>Create Section</title>
    88    </head>
    99    <body>
    1010        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">SystemSection List</g:link></span>
     11            <span class="menuButton"><g:link class="list" action="list">Section List</g:link></span>
    1212        </div>
    1313        <div class="body">
    14             <h1>Create SystemSection</h1>
     14            <h1>Create Section</h1>
    1515            <g:if test="${flash.message}">
    1616            <div class="message">${flash.message}</div>
    1717            </g:if>
    18             <g:hasErrors bean="${systemSectionInstance}">
     18            <g:hasErrors bean="${sectionInstance}">
    1919            <div class="errors">
    20                 <g:renderErrors bean="${systemSectionInstance}" as="list" />
     20                <g:renderErrors bean="${sectionInstance}" as="list" />
    2121            </div>
    2222            </g:hasErrors>
     
    2828                            <tr class="prop">
    2929                                <td valign="top" class="name">
    30                                     <label for="costCode">Cost Code:</label>
     30                                    <label for="name">Name:</label>
    3131                                </td>
    32                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}">
    33                                     <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/>
     32                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'name','errors')}">
     33                                    <input type="text" maxlength="50" id="name" name="name" value="${fieldValue(bean:sectionInstance,field:'name')}"/>
     34                                </td>
     35                            </tr>
     36                       
     37                            <tr class="prop">
     38                                <td valign="top" class="name">
     39                                    <label for="description">Description:</label>
     40                                </td>
     41                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'description','errors')}">
     42                                    <input type="text" maxlength="100" id="description" name="description" value="${fieldValue(bean:sectionInstance,field:'description')}"/>
     43                                </td>
     44                            </tr>
     45                       
     46                            <tr class="prop">
     47                                <td valign="top" class="name">
     48                                    <label for="isActive">Is Active:</label>
     49                                </td>
     50                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'isActive','errors')}">
     51                                    <g:checkBox name="isActive" value="${sectionInstance?.isActive}" ></g:checkBox>
    3452                                </td>
    3553                            </tr>
     
    3957                                    <label for="department">Department:</label>
    4058                                </td>
    41                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}">
    42                                     <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select>
    43                                 </td>
    44                             </tr>
    45                        
    46                             <tr class="prop">
    47                                 <td valign="top" class="name">
    48                                     <label for="description">Description:</label>
    49                                 </td>
    50                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'description','errors')}">
    51                                     <input type="text" id="description" name="description" value="${fieldValue(bean:systemSectionInstance,field:'description')}"/>
    52                                 </td>
    53                             </tr>
    54                        
    55                             <tr class="prop">
    56                                 <td valign="top" class="name">
    57                                     <label for="isActive">Is Active:</label>
    58                                 </td>
    59                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}">
    60                                     <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox>
    61                                 </td>
    62                             </tr>
    63                        
    64                             <tr class="prop">
    65                                 <td valign="top" class="name">
    66                                     <label for="name">Name:</label>
    67                                 </td>
    68                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}">
    69                                     <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/>
     59                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'department','errors')}">
     60                                    <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${sectionInstance?.department?.id}" ></g:select>
    7061                                </td>
    7162                            </tr>
     
    7566                                    <label for="site">Site:</label>
    7667                                </td>
    77                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'site','errors')}">
    78                                     <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${systemSectionInstance?.site?.id}" ></g:select>
     68                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'site','errors')}">
     69                                    <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${sectionInstance?.site?.id}" ></g:select>
    7970                                </td>
    8071                            </tr>
  • trunk/grails-app/views/section/edit.gsp

    r178 r268  
    55        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    66        <meta name="layout" content="main" />
    7         <title>Edit SystemSection</title>
     7        <title>Edit Section</title>
    88    </head>
    99    <body>
    1010        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">SystemSection List</g:link></span>
    12             <span class="menuButton"><g:link class="create" action="create">New SystemSection</g:link></span>
     11            <span class="menuButton"><g:link class="list" action="list">Section List</g:link></span>
     12            <span class="menuButton"><g:link class="create" action="create">New Section</g:link></span>
    1313        </div>
    1414        <div class="body">
    15             <h1>Edit SystemSection</h1>
     15            <h1>Edit Section</h1>
    1616            <g:if test="${flash.message}">
    1717            <div class="message">${flash.message}</div>
    1818            </g:if>
    19             <g:hasErrors bean="${systemSectionInstance}">
     19            <g:hasErrors bean="${sectionInstance}">
    2020            <div class="errors">
    21                 <g:renderErrors bean="${systemSectionInstance}" as="list" />
     21                <g:renderErrors bean="${sectionInstance}" as="list" />
    2222            </div>
    2323            </g:hasErrors>
    2424            <g:form method="post" >
    25                 <input type="hidden" name="id" value="${systemSectionInstance?.id}" />
    26                 <input type="hidden" name="version" value="${systemSectionInstance?.version}" />
     25                <input type="hidden" name="id" value="${sectionInstance?.id}" />
     26                <input type="hidden" name="version" value="${sectionInstance?.version}" />
    2727                <div class="dialog">
    2828                    <table>
     
    3131                            <tr class="prop">
    3232                                <td valign="top" class="name">
    33                                     <label for="assets">Assets:</label>
     33                                    <label for="name">Name:</label>
    3434                                </td>
    35                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'assets','errors')}">
    36                                    
    37 <ul>
    38 <g:each var="a" in="${systemSectionInstance?.assets?}">
    39     <li><g:link controller="asset" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
    40 </g:each>
    41 </ul>
    42 <g:link controller="asset" params="['systemSection.id':systemSectionInstance?.id]" action="create">Add Asset</g:link>
    43 
     35                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'name','errors')}">
     36                                    <input type="text" maxlength="50" id="name" name="name" value="${fieldValue(bean:sectionInstance,field:'name')}"/>
    4437                                </td>
    4538                            </tr>
     
    4740                            <tr class="prop">
    4841                                <td valign="top" class="name">
    49                                     <label for="costCode">Cost Code:</label>
     42                                    <label for="description">Description:</label>
    5043                                </td>
    51                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'costCode','errors')}">
    52                                     <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:systemSectionInstance,field:'costCode')}"/>
     44                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'description','errors')}">
     45                                    <input type="text" maxlength="100" id="description" name="description" value="${fieldValue(bean:sectionInstance,field:'description')}"/>
     46                                </td>
     47                            </tr>
     48                       
     49                            <tr class="prop">
     50                                <td valign="top" class="name">
     51                                    <label for="isActive">Is Active:</label>
     52                                </td>
     53                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'isActive','errors')}">
     54                                    <g:checkBox name="isActive" value="${sectionInstance?.isActive}" ></g:checkBox>
     55                                </td>
     56                            </tr>
     57                       
     58                            <tr class="prop">
     59                                <td valign="top" class="name">
     60                                    <label for="assets">Assets:</label>
     61                                </td>
     62                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'assets','errors')}">
     63                                   
     64<ul>
     65<g:each var="a" in="${sectionInstance?.assets?}">
     66    <li><g:link controller="asset" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
     67</g:each>
     68</ul>
     69<g:link controller="asset" params="['section.id':sectionInstance?.id]" action="create">Add Asset</g:link>
     70
    5371                                </td>
    5472                            </tr>
     
    5876                                    <label for="department">Department:</label>
    5977                                </td>
    60                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'department','errors')}">
    61                                     <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${systemSectionInstance?.department?.id}" ></g:select>
    62                                 </td>
    63                             </tr>
    64                        
    65                             <tr class="prop">
    66                                 <td valign="top" class="name">
    67                                     <label for="description">Description:</label>
    68                                 </td>
    69                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'description','errors')}">
    70                                     <input type="text" id="description" name="description" value="${fieldValue(bean:systemSectionInstance,field:'description')}"/>
    71                                 </td>
    72                             </tr>
    73                        
    74                             <tr class="prop">
    75                                 <td valign="top" class="name">
    76                                     <label for="isActive">Is Active:</label>
    77                                 </td>
    78                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'isActive','errors')}">
    79                                     <g:checkBox name="isActive" value="${systemSectionInstance?.isActive}" ></g:checkBox>
     78                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'department','errors')}">
     79                                    <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${sectionInstance?.department?.id}" ></g:select>
    8080                                </td>
    8181                            </tr>
     
    8585                                    <label for="maintenanceActions">Maintenance Actions:</label>
    8686                                </td>
    87                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'maintenanceActions','errors')}">
     87                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'maintenanceActions','errors')}">
    8888                                   
    8989<ul>
    90 <g:each var="m" in="${systemSectionInstance?.maintenanceActions?}">
     90<g:each var="m" in="${sectionInstance?.maintenanceActions?}">
    9191    <li><g:link controller="maintenanceAction" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
    9292</g:each>
    9393</ul>
    94 <g:link controller="maintenanceAction" params="['systemSection.id':systemSectionInstance?.id]" action="create">Add MaintenanceAction</g:link>
     94<g:link controller="maintenanceAction" params="['section.id':sectionInstance?.id]" action="create">Add MaintenanceAction</g:link>
    9595
    9696                                </td>
     
    9999                            <tr class="prop">
    100100                                <td valign="top" class="name">
    101                                     <label for="name">Name:</label>
     101                                    <label for="sectionExtendedAttributes">Section Extended Attributes:</label>
    102102                                </td>
    103                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'name','errors')}">
    104                                     <input type="text" id="name" name="name" value="${fieldValue(bean:systemSectionInstance,field:'name')}"/>
     103                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'sectionExtendedAttributes','errors')}">
     104                                   
     105<ul>
     106<g:each var="s" in="${sectionInstance?.sectionExtendedAttributes?}">
     107    <li><g:link controller="sectionExtendedAttribute" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     108</g:each>
     109</ul>
     110<g:link controller="sectionExtendedAttribute" params="['section.id':sectionInstance?.id]" action="create">Add SectionExtendedAttribute</g:link>
     111
    105112                                </td>
    106113                            </tr>
     
    110117                                    <label for="site">Site:</label>
    111118                                </td>
    112                                 <td valign="top" class="value ${hasErrors(bean:systemSectionInstance,field:'site','errors')}">
    113                                     <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${systemSectionInstance?.site?.id}" ></g:select>
     119                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'site','errors')}">
     120                                    <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${sectionInstance?.site?.id}" ></g:select>
    114121                                </td>
    115122                            </tr>
  • trunk/grails-app/views/section/list.gsp

    r178 r268  
    55        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    66        <meta name="layout" content="main" />
    7         <title>SystemSection List</title>
     7        <title>Section List</title>
    88    </head>
    99    <body>
    1010        <div class="nav">
    11             <span class="menuButton"><g:link class="create" action="create">New SystemSection</g:link></span>
     11            <span class="menuButton"><g:link class="create" action="create">New Section</g:link></span>
    1212        </div>
    1313        <div class="body">
    14             <h1>SystemSection List</h1>
     14            <h1>Section List</h1>
    1515            <g:if test="${flash.message}">
    1616            <div class="message">${flash.message}</div>
     
    2323                                <g:sortableColumn property="id" title="Id" />
    2424                       
    25                                 <g:sortableColumn property="costCode" title="Cost Code" />
     25                                <g:sortableColumn property="name" title="Name" />
    2626                       
    27                                 <th>Department</th>
    28                            
    2927                                <g:sortableColumn property="description" title="Description" />
    3028                       
    3129                                <g:sortableColumn property="isActive" title="Is Active" />
    3230                       
    33                                 <g:sortableColumn property="name" title="Name" />
    34                        
     31                                <th>Department</th>
     32                           
     33                                <th>Site</th>
     34                           
    3535                        </tr>
    3636                    </thead>
    3737                    <tbody>
    38                     <g:each in="${systemSectionInstanceList}" status="i" var="systemSectionInstance">
     38                    <g:each in="${sectionInstanceList}" status="i" var="sectionInstance">
    3939                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
    4040                       
    41                             <td><g:link action="show" id="${systemSectionInstance.id}">${fieldValue(bean:systemSectionInstance, field:'id')}</g:link></td>
     41                            <td><g:link action="show" id="${sectionInstance.id}">${fieldValue(bean:sectionInstance, field:'id')}</g:link></td>
    4242                       
    43                             <td>${fieldValue(bean:systemSectionInstance, field:'costCode')}</td>
     43                            <td>${fieldValue(bean:sectionInstance, field:'name')}</td>
    4444                       
    45                             <td>${fieldValue(bean:systemSectionInstance, field:'department')}</td>
     45                            <td>${fieldValue(bean:sectionInstance, field:'description')}</td>
    4646                       
    47                             <td>${fieldValue(bean:systemSectionInstance, field:'description')}</td>
     47                            <td>${fieldValue(bean:sectionInstance, field:'isActive')}</td>
    4848                       
    49                             <td>${fieldValue(bean:systemSectionInstance, field:'isActive')}</td>
     49                            <td>${fieldValue(bean:sectionInstance, field:'department')}</td>
    5050                       
    51                             <td>${fieldValue(bean:systemSectionInstance, field:'name')}</td>
     51                            <td>${fieldValue(bean:sectionInstance, field:'site')}</td>
    5252                       
    5353                        </tr>
     
    5757            </div>
    5858            <div class="paginateButtons">
    59                 <g:paginate total="${systemSectionInstanceTotal}" />
     59                <g:paginate total="${sectionInstanceTotal}" />
    6060            </div>
    6161        </div>
  • trunk/grails-app/views/section/show.gsp

    r178 r268  
    55        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    66        <meta name="layout" content="main" />
    7         <title>Show SystemSection</title>
     7        <title>Show Section</title>
    88    </head>
    99    <body>
    1010        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">SystemSection List</g:link></span>
    12             <span class="menuButton"><g:link class="create" action="create">New SystemSection</g:link></span>
     11            <span class="menuButton"><g:link class="list" action="list">Section List</g:link></span>
     12            <span class="menuButton"><g:link class="create" action="create">New Section</g:link></span>
    1313        </div>
    1414        <div class="body">
    15             <h1>Show SystemSection</h1>
     15            <h1>Show Section</h1>
    1616            <g:if test="${flash.message}">
    1717            <div class="message">${flash.message}</div>
     
    2525                            <td valign="top" class="name">Id:</td>
    2626                           
    27                             <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'id')}</td>
     27                            <td valign="top" class="value">${fieldValue(bean:sectionInstance, field:'id')}</td>
     28                           
     29                        </tr>
     30                   
     31                        <tr class="prop">
     32                            <td valign="top" class="name">Name:</td>
     33                           
     34                            <td valign="top" class="value">${fieldValue(bean:sectionInstance, field:'name')}</td>
     35                           
     36                        </tr>
     37                   
     38                        <tr class="prop">
     39                            <td valign="top" class="name">Description:</td>
     40                           
     41                            <td valign="top" class="value">${fieldValue(bean:sectionInstance, field:'description')}</td>
     42                           
     43                        </tr>
     44                   
     45                        <tr class="prop">
     46                            <td valign="top" class="name">Is Active:</td>
     47                           
     48                            <td valign="top" class="value">${fieldValue(bean:sectionInstance, field:'isActive')}</td>
    2849                           
    2950                        </tr>
     
    3455                            <td  valign="top" style="text-align:left;" class="value">
    3556                                <ul>
    36                                 <g:each var="a" in="${systemSectionInstance.assets}">
     57                                <g:each var="a" in="${sectionInstance.assets}">
    3758                                    <li><g:link controller="asset" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
    3859                                </g:each>
     
    4364                   
    4465                        <tr class="prop">
    45                             <td valign="top" class="name">Cost Code:</td>
    46                            
    47                             <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'costCode')}</td>
    48                            
    49                         </tr>
    50                    
    51                         <tr class="prop">
    5266                            <td valign="top" class="name">Department:</td>
    5367                           
    54                             <td valign="top" class="value"><g:link controller="department" action="show" id="${systemSectionInstance?.department?.id}">${systemSectionInstance?.department?.encodeAsHTML()}</g:link></td>
    55                            
    56                         </tr>
    57                    
    58                         <tr class="prop">
    59                             <td valign="top" class="name">Description:</td>
    60                            
    61                             <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'description')}</td>
    62                            
    63                         </tr>
    64                    
    65                         <tr class="prop">
    66                             <td valign="top" class="name">Is Active:</td>
    67                            
    68                             <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'isActive')}</td>
     68                            <td valign="top" class="value"><g:link controller="department" action="show" id="${sectionInstance?.department?.id}">${sectionInstance?.department?.encodeAsHTML()}</g:link></td>
    6969                           
    7070                        </tr>
     
    7575                            <td  valign="top" style="text-align:left;" class="value">
    7676                                <ul>
    77                                 <g:each var="m" in="${systemSectionInstance.maintenanceActions}">
     77                                <g:each var="m" in="${sectionInstance.maintenanceActions}">
    7878                                    <li><g:link controller="maintenanceAction" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
    7979                                </g:each>
     
    8484                   
    8585                        <tr class="prop">
    86                             <td valign="top" class="name">Name:</td>
     86                            <td valign="top" class="name">Section Extended Attributes:</td>
    8787                           
    88                             <td valign="top" class="value">${fieldValue(bean:systemSectionInstance, field:'name')}</td>
     88                            <td  valign="top" style="text-align:left;" class="value">
     89                                <ul>
     90                                <g:each var="s" in="${sectionInstance.sectionExtendedAttributes}">
     91                                    <li><g:link controller="sectionExtendedAttribute" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     92                                </g:each>
     93                                </ul>
     94                            </td>
    8995                           
    9096                        </tr>
     
    9399                            <td valign="top" class="name">Site:</td>
    94100                           
    95                             <td valign="top" class="value"><g:link controller="site" action="show" id="${systemSectionInstance?.site?.id}">${systemSectionInstance?.site?.encodeAsHTML()}</g:link></td>
     101                            <td valign="top" class="value"><g:link controller="site" action="show" id="${sectionInstance?.site?.id}">${sectionInstance?.site?.encodeAsHTML()}</g:link></td>
    96102                           
    97103                        </tr>
     
    102108            <div class="buttons">
    103109                <g:form>
    104                     <input type="hidden" name="id" value="${systemSectionInstance?.id}" />
     110                    <input type="hidden" name="id" value="${sectionInstance?.id}" />
    105111                    <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
    106112                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
Note: See TracChangeset for help on using the changeset viewer.