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
Line 
1
2
3<html>
4    <head>
5        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6        <meta name="layout" content="main" />
7        <title>Edit Section</title>
8        <nav:resources override="true"/>
9    </head>
10    <body>
11        <div class="nav">
12            <nav:renderSubItems group="navAlt"/>
13        </div>
14        <div class="body">
15            <g:render template="/shared/messages" />
16            <g:hasErrors bean="${sectionInstance}">
17            <div class="errors">
18                <g:renderErrors bean="${sectionInstance}" as="list" />
19            </div>
20            </g:hasErrors>
21            <g:form method="post" >
22                <input type="hidden" name="id" value="${sectionInstance?.id}" />
23                <input type="hidden" name="version" value="${sectionInstance?.version}" />
24                <div class="dialog">
25                    <table>
26                        <tbody>
27                       
28                            <tr class="prop">
29                                <td valign="top" class="name">
30                                    <label for="name">Name:</label>
31                                </td>
32                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'name','errors')}">
33                                    <input type="text" class="description" 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" class="description" maxlength="75" 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="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>
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:sectionInstance,field:'isActive','errors')}">
60                                    <g:checkBox name="isActive" value="${sectionInstance?.isActive}" ></g:checkBox>
61                                </td>
62                            </tr>
63                       
64                            <tr class="prop">
65                                <td valign="top" class="name">
66                                    <label for="assets">Assets:</label>
67                                </td>
68                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'assets','errors')}">
69                                   
70<ul>
71<g:each var="a" in="${sectionInstance?.assets?}">
72    <li><g:link controller="assetDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
73</g:each>
74</ul>
75<g:link controller="assetDetailed" params="['section.id':sectionInstance?.id]" action="create">+Add Asset</g:link>
76
77                                </td>
78                            </tr>
79                       
80                            <tr class="prop">
81                                <td valign="top" class="name">
82                                    <label for="department">Department:</label>
83                                </td>
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>
86                                    <p>
87                                        <g:link controller="departmentDetailed" action="create">+Add Department</g:link>
88                                    </p>
89                                </td>
90                            </tr>
91                       
92                            <tr class="prop">
93                                <td valign="top" class="name">
94                                    <label for="maintenanceActions">Maintenance Actions:</label>
95                                </td>
96                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'maintenanceActions','errors')}">
97                                   
98<ul>
99<g:each var="m" in="${sectionInstance?.maintenanceActions?}">
100    <li><g:link controller="maintenanceActionDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
101</g:each>
102</ul>
103<g:link controller="maintenanceActionDetailed" params="['section.id':sectionInstance?.id]" action="create">+Add Maintenance Action</g:link>
104
105                                </td>
106                            </tr>
107                       
108                            <tr class="prop">
109                                <td valign="top" class="name">
110                                    <label for="sectionExtendedAttributes">Section Extended Attributes:</label>
111                                </td>
112                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'sectionExtendedAttributes','errors')}">
113                                   
114<ul>
115<g:each var="s" in="${sectionInstance?.sectionExtendedAttributes?}">
116    <li><g:link controller="sectionExtendedAttributeDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
117</g:each>
118</ul>
119<g:link controller="sectionExtendedAttributeDetailed" params="['section.id':sectionInstance?.id]" action="create">+Add Extended Attribute</g:link>
120
121                                </td>
122                            </tr>
123                       
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                       
133                        </tbody>
134                    </table>
135                </div>
136                <div class="buttons">
137                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
138                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
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.