source: trunk/grails-app/views/sectionDetailed/edit.gsp @ 410

Last change on this file since 410 was 410, checked in by gav, 14 years ago

Add a plus(+) sign to all detailed views with an Add link.

File size: 7.6 KB
RevLine 
[118]1
2
3<html>
4    <head>
5        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6        <meta name="layout" content="main" />
[273]7        <title>Edit Section</title>
[385]8        <nav:resources override="true"/>
[118]9    </head>
10    <body>
11        <div class="nav">
[385]12            <nav:renderSubItems group="navAlt"/>
[118]13        </div>
14        <div class="body">
[355]15            <g:render template="/shared/messages" />
[273]16            <g:hasErrors bean="${sectionInstance}">
[118]17            <div class="errors">
[273]18                <g:renderErrors bean="${sectionInstance}" as="list" />
[118]19            </div>
20            </g:hasErrors>
21            <g:form method="post" >
[273]22                <input type="hidden" name="id" value="${sectionInstance?.id}" />
23                <input type="hidden" name="version" value="${sectionInstance?.version}" />
[118]24                <div class="dialog">
25                    <table>
26                        <tbody>
27                       
28                            <tr class="prop">
29                                <td valign="top" class="name">
[162]30                                    <label for="name">Name:</label>
[118]31                                </td>
[273]32                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'name','errors')}">
[331]33                                    <input type="text" class="description" maxlength="50" id="name" name="name" value="${fieldValue(bean:sectionInstance,field:'name')}"/>
[118]34                                </td>
[273]35                            </tr>
[118]36                       
37                            <tr class="prop">
38                                <td valign="top" class="name">
39                                    <label for="description">Description:</label>
40                                </td>
[273]41                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'description','errors')}">
[331]42                                    <input type="text" class="description" maxlength="75" id="description" name="description" value="${fieldValue(bean:sectionInstance,field:'description')}"/>
[118]43                                </td>
[273]44                            </tr>
[331]45                           
46                            <tr class="prop">
47                                <td valign="top" class="name">
48                                    <label for="comment">Comment:</label>
49                                </td>
50                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'comment','errors')}">
51                                    <textarea rows="5" cols="40" name="comment">${fieldValue(bean:sectionInstance, field:'comment')}</textarea>
52                                </td>
53                            </tr>
[162]54                       
55                            <tr class="prop">
56                                <td valign="top" class="name">
[273]57                                    <label for="isActive">Is Active:</label>
[162]58                                </td>
[273]59                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'isActive','errors')}">
60                                    <g:checkBox name="isActive" value="${sectionInstance?.isActive}" ></g:checkBox>
[162]61                                </td>
[273]62                            </tr>
[162]63                       
64                            <tr class="prop">
65                                <td valign="top" class="name">
[273]66                                    <label for="assets">Assets:</label>
[162]67                                </td>
[273]68                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'assets','errors')}">
69                                   
70<ul>
71<g:each var="a" in="${sectionInstance?.assets?}">
[288]72    <li><g:link controller="assetDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
[273]73</g:each>
74</ul>
[410]75<g:link controller="assetDetailed" params="['section.id':sectionInstance?.id]" action="create">+Add Asset</g:link>
[273]76
[162]77                                </td>
[118]78                            </tr>
79                       
80                            <tr class="prop">
81                                <td valign="top" class="name">
[273]82                                    <label for="department">Department:</label>
[162]83                                </td>
[273]84                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'department','errors')}">
85                                    <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${sectionInstance?.department?.id}" ></g:select>
[308]86                                    <p>
[410]87                                        <g:link controller="departmentDetailed" action="create">+Add Department</g:link>
[308]88                                    </p>
[162]89                                </td>
[273]90                            </tr>
[162]91                       
92                            <tr class="prop">
93                                <td valign="top" class="name">
[273]94                                    <label for="maintenanceActions">Maintenance Actions:</label>
[118]95                                </td>
[273]96                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'maintenanceActions','errors')}">
[162]97                                   
98<ul>
[273]99<g:each var="m" in="${sectionInstance?.maintenanceActions?}">
[288]100    <li><g:link controller="maintenanceActionDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
[162]101</g:each>
102</ul>
[410]103<g:link controller="maintenanceActionDetailed" params="['section.id':sectionInstance?.id]" action="create">+Add Maintenance Action</g:link>
[162]104
105                                </td>
[118]106                            </tr>
107                       
108                            <tr class="prop">
109                                <td valign="top" class="name">
[273]110                                    <label for="sectionExtendedAttributes">Section Extended Attributes:</label>
[118]111                                </td>
[273]112                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'sectionExtendedAttributes','errors')}">
[122]113                                   
114<ul>
[273]115<g:each var="s" in="${sectionInstance?.sectionExtendedAttributes?}">
[288]116    <li><g:link controller="sectionExtendedAttributeDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
[122]117</g:each>
118</ul>
[410]119<g:link controller="sectionExtendedAttributeDetailed" params="['section.id':sectionInstance?.id]" action="create">+Add Extended Attribute</g:link>
[118]120
121                                </td>
122                            </tr>
123                       
[273]124                            <tr class="prop">
125                                <td valign="top" class="name">
126                                    <label for="site">Site:</label>
127                                </td>
128                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'site','errors')}">
129                                    <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${sectionInstance?.site?.id}" ></g:select>
130                                </td>
131                            </tr>
132                       
[118]133                        </tbody>
134                    </table>
135                </div>
136                <div class="buttons">
137                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
[385]138                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
[118]139                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
140                </div>
141            </g:form>
142        </div>
143    </body>
144</html>
Note: See TracBrowser for help on using the repository browser.