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

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

Add comment attribute to Section and limit description to 75 char.
Update detailed views to suite.

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