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

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

Add a create site link to asset tree taglib if there are no sites yet.
Add a create department link to section create and edit views.

File size: 7.1 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" 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" 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="assetDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
67</g:each>
68</ul>
69<g:link controller="assetDetailed" params="['section.id':sectionInstance?.id]" action="create">Add Asset</g:link>
70
71                                </td>
72                            </tr>
73                       
74                            <tr class="prop">
75                                <td valign="top" class="name">
76                                    <label for="department">Department:</label>
77                                </td>
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>
80                                    <p>
81                                        <g:link controller="departmentDetailed" action="create">Add Department</g:link>
82                                    </p>
83                                </td>
84                            </tr>
85                       
86                            <tr class="prop">
87                                <td valign="top" class="name">
88                                    <label for="maintenanceActions">Maintenance Actions:</label>
89                                </td>
90                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'maintenanceActions','errors')}">
91                                   
92<ul>
93<g:each var="m" in="${sectionInstance?.maintenanceActions?}">
94    <li><g:link controller="maintenanceActionDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
95</g:each>
96</ul>
97<g:link controller="maintenanceActionDetailed" params="['section.id':sectionInstance?.id]" action="create">Add MaintenanceAction</g:link>
98
99                                </td>
100                            </tr>
101                       
102                            <tr class="prop">
103                                <td valign="top" class="name">
104                                    <label for="sectionExtendedAttributes">Section Extended Attributes:</label>
105                                </td>
106                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'sectionExtendedAttributes','errors')}">
107                                   
108<ul>
109<g:each var="s" in="${sectionInstance?.sectionExtendedAttributes?}">
110    <li><g:link controller="sectionExtendedAttributeDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
111</g:each>
112</ul>
113<g:link controller="sectionExtendedAttributeDetailed" params="['section.id':sectionInstance?.id]" action="create">Add SectionExtendedAttribute</g:link>
114
115                                </td>
116                            </tr>
117                       
118                            <tr class="prop">
119                                <td valign="top" class="name">
120                                    <label for="site">Site:</label>
121                                </td>
122                                <td valign="top" class="value ${hasErrors(bean:sectionInstance,field:'site','errors')}">
123                                    <g:select optionKey="id" from="${Site.list()}" name="site.id" value="${sectionInstance?.site?.id}" ></g:select>
124                                </td>
125                            </tr>
126                       
127                        </tbody>
128                    </table>
129                </div>
130                <div class="buttons">
131                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
132                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
133                </div>
134            </g:form>
135        </div>
136    </body>
137</html>
Note: See TracBrowser for help on using the repository browser.