source: trunk/src/grails-app/views/entry/edit.gsp @ 21

Last change on this file since 21 was 21, checked in by gavin, 15 years ago

Remove TypeOfClass? and change to ClassType?. Update ERD to match.
Create and add openMimLogo/Icon.
Generate-all *.
Configure BootStrap? and add entries, some not saving yet.
Update DatabaseDesign?.tex and index.gsp

File size: 5.2 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 Entry</title>
8    </head>
9    <body>
10        <div class="nav">
11            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
12            <span class="menuButton"><g:link class="list" action="list">Entry List</g:link></span>
13            <span class="menuButton"><g:link class="create" action="create">New Entry</g:link></span>
14        </div>
15        <div class="body">
16            <h1>Edit Entry</h1>
17            <g:if test="${flash.message}">
18            <div class="message">${flash.message}</div>
19            </g:if>
20            <g:hasErrors bean="${entryInstance}">
21            <div class="errors">
22                <g:renderErrors bean="${entryInstance}" as="list" />
23            </div>
24            </g:hasErrors>
25            <g:form method="post" >
26                <input type="hidden" name="id" value="${entryInstance?.id}" />
27                <div class="dialog">
28                    <table>
29                        <tbody>
30                       
31                            <tr class="prop">
32                                <td valign="top" class="name">
33                                    <label for="person">Person:</label>
34                                </td>
35                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'person','errors')}">
36                                    <g:select optionKey="id" from="${Person.list()}" name="person.id" value="${entryInstance?.person?.id}" ></g:select>
37                                </td>
38                            </tr>
39                       
40                            <tr class="prop">
41                                <td valign="top" class="name">
42                                    <label for="task">Task:</label>
43                                </td>
44                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'task','errors')}">
45                                    <g:select optionKey="id" from="${Task.list()}" name="task.id" value="${entryInstance?.task?.id}" ></g:select>
46                                </td>
47                            </tr>
48                       
49                            <tr class="prop">
50                                <td valign="top" class="name">
51                                    <label for="dateTime">Date Time:</label>
52                                </td>
53                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'dateTime','errors')}">
54                                    <g:datePicker name="dateTime" value="${entryInstance?.dateTime}" noSelection="['':'']"></g:datePicker>
55                                </td>
56                            </tr>
57                       
58                            <tr class="prop">
59                                <td valign="top" class="name">
60                                    <label for="duration">Duration:</label>
61                                </td>
62                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'duration','errors')}">
63                                    <input type="text" id="duration" name="duration" value="${fieldValue(bean:entryInstance,field:'duration')}" />
64                                </td>
65                            </tr>
66                       
67                            <tr class="prop">
68                                <td valign="top" class="name">
69                                    <label for="comments">Comments:</label>
70                                </td>
71                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'comments','errors')}">
72                                    <input type="text" id="comments" name="comments" value="${fieldValue(bean:entryInstance,field:'comments')}"/>
73                                </td>
74                            </tr>
75                       
76                            <tr class="prop">
77                                <td valign="top" class="name">
78                                    <label for="persons">Persons:</label>
79                                </td>
80                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'persons','errors')}">
81                                   
82<ul>
83<g:each var="p" in="${entryInstance?.persons?}">
84    <li><g:link controller="person" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
85</g:each>
86</ul>
87<g:link controller="person" params="['entry.id':entryInstance?.id]" action="create">Add Person</g:link>
88
89                                </td>
90                            </tr>
91                       
92                        </tbody>
93                    </table>
94                </div>
95                <div class="buttons">
96                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
97                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
98                </div>
99            </g:form>
100        </div>
101    </body>
102</html>
Note: See TracBrowser for help on using the repository browser.