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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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>
Note: See TracChangeset for help on using the changeset viewer.