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

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

Change section views to use shared messages.

File size: 7.7 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    </head>
9    <body>
10        <div class="nav">
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>
13        </div>
14        <div class="body">
15            <h1>Edit Section</h1>
16            <g:render template="/shared/messages" />
17            <g:hasErrors bean="${sectionInstance}">
18            <div class="errors">
19                <g:renderErrors bean="${sectionInstance}" as="list" />
20            </div>
21            </g:hasErrors>
22            <g:form method="post" >
23                <input type="hidden" name="id" value="${sectionInstance?.id}" />
24                <input type="hidden" name="version" value="${sectionInstance?.version}" />
25                <div class="dialog">
26                    <table>
27                        <tbody>
28                       
29                            <tr class="prop">
30                                <td valign="top" class="name">
31                                    <label for="name">Name:</label>
32                                </td>
33                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'name','errors')}">
34                                    <input type="text" class="description" maxlength="50" id="name" name="name" value="${fieldValue(bean:sectionInstance,field:'name')}"/>
35                                </td>
36                            </tr>
37                       
38                            <tr class="prop">
39                                <td valign="top" class="name">
40                                    <label for="description">Description:</label>
41                                </td>
42                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'description','errors')}">
43                                    <input type="text" class="description" maxlength="75" id="description" name="description" value="${fieldValue(bean:sectionInstance,field:'description')}"/>
44                                </td>
45                            </tr>
46                           
47                            <tr class="prop">
48                                <td valign="top" class="name">
49                                    <label for="comment">Comment:</label>
50                                </td>
51                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'comment','errors')}">
52                                    <textarea rows="5" cols="40" name="comment">${fieldValue(bean:sectionInstance, field:'comment')}</textarea>
53                                </td>
54                            </tr>
55                       
56                            <tr class="prop">
57                                <td valign="top" class="name">
58                                    <label for="isActive">Is Active:</label>
59                                </td>
60                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'isActive','errors')}">
61                                    <g:checkBox name="isActive" value="${sectionInstance?.isActive}" ></g:checkBox>
62                                </td>
63                            </tr>
64                       
65                            <tr class="prop">
66                                <td valign="top" class="name">
67                                    <label for="assets">Assets:</label>
68                                </td>
69                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'assets','errors')}">
70                                   
71<ul>
72<g:each var="a" in="${sectionInstance?.assets?}">
73    <li><g:link controller="assetDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
74</g:each>
75</ul>
76<g:link controller="assetDetailed" params="['section.id':sectionInstance?.id]" action="create">Add Asset</g:link>
77
78                                </td>
79                            </tr>
80                       
81                            <tr class="prop">
82                                <td valign="top" class="name">
83                                    <label for="department">Department:</label>
84                                </td>
85                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'department','errors')}">
86                                    <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${sectionInstance?.department?.id}" ></g:select>
87                                    <p>
88                                        <g:link controller="departmentDetailed" action="create">Add Department</g:link>
89                                    </p>
90                                </td>
91                            </tr>
92                       
93                            <tr class="prop">
94                                <td valign="top" class="name">
95                                    <label for="maintenanceActions">Maintenance Actions:</label>
96                                </td>
97                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'maintenanceActions','errors')}">
98                                   
99<ul>
100<g:each var="m" in="${sectionInstance?.maintenanceActions?}">
101    <li><g:link controller="maintenanceActionDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
102</g:each>
103</ul>
104<g:link controller="maintenanceActionDetailed" params="['section.id':sectionInstance?.id]" action="create">Add MaintenanceAction</g:link>
105
106                                </td>
107                            </tr>
108                       
109                            <tr class="prop">
110                                <td valign="top" class="name">
111                                    <label for="sectionExtendedAttributes">Section Extended Attributes:</label>
112                                </td>
113                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'sectionExtendedAttributes','errors')}">
114                                   
115<ul>
116<g:each var="s" in="${sectionInstance?.sectionExtendedAttributes?}">
117    <li><g:link controller="sectionExtendedAttributeDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
118</g:each>
119</ul>
120<g:link controller="sectionExtendedAttributeDetailed" params="['section.id':sectionInstance?.id]" action="create">Add SectionExtendedAttribute</g:link>
121
122                                </td>
123                            </tr>
124                       
125                            <tr class="prop">
126                                <td valign="top" class="name">
127                                    <label for="site">Site:</label>
128                                </td>
129                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'site','errors')}">
130                                    <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${sectionInstance?.site?.id}" ></g:select>
131                                </td>
132                            </tr>
133                       
134                        </tbody>
135                    </table>
136                </div>
137                <div class="buttons">
138                    <span class="button"><g:actionSubmit class="save" value="Update" /></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.