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="comments">Comments:</label> |
---|
34 | </td> |
---|
35 | <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'comments','errors')}"> |
---|
36 | <textarea rows="5" cols="40" name="comments">${fieldValue(bean:entryInstance, field:'comments')}</textarea> |
---|
37 | </td> |
---|
38 | </tr> |
---|
39 | |
---|
40 | <tr class="prop"> |
---|
41 | <td valign="top" class="name"> |
---|
42 | <label for="date">Date:</label> |
---|
43 | </td> |
---|
44 | <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'date','errors')}"> |
---|
45 | <g:datePicker name="date" value="${entryInstance?.date}" ></g:datePicker> |
---|
46 | </td> |
---|
47 | </tr> |
---|
48 | |
---|
49 | <tr class="prop"> |
---|
50 | <td valign="top" class="name"> |
---|
51 | <label for="duration">Duration:</label> |
---|
52 | </td> |
---|
53 | <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'duration','errors')}"> |
---|
54 | <input type="text" id="duration" name="duration" value="${fieldValue(bean:entryInstance,field:'duration')}" /> |
---|
55 | </td> |
---|
56 | </tr> |
---|
57 | |
---|
58 | <tr class="prop"> |
---|
59 | <td valign="top" class="name"> |
---|
60 | <label for="entryType">Entry Type:</label> |
---|
61 | </td> |
---|
62 | <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'entryType','errors')}"> |
---|
63 | <g:select optionKey="id" from="${EntryType.list()}" name="entryType.id" value="${entryInstance?.entryType?.id}" ></g:select> |
---|
64 | </td> |
---|
65 | </tr> |
---|
66 | |
---|
67 | <tr class="prop"> |
---|
68 | <td valign="top" class="name"> |
---|
69 | <label for="person">Person:</label> |
---|
70 | </td> |
---|
71 | <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'person','errors')}"> |
---|
72 | <g:select optionKey="id" from="${Person.list()}" name="person.id" value="${entryInstance?.person?.id}" ></g:select> |
---|
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 | <tr class="prop"> |
---|
93 | <td valign="top" class="name"> |
---|
94 | <label for="task">Task:</label> |
---|
95 | </td> |
---|
96 | <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'task','errors')}"> |
---|
97 | <g:select optionKey="id" from="${Task.list()}" name="task.id" value="${entryInstance?.task?.id}" ></g:select> |
---|
98 | </td> |
---|
99 | </tr> |
---|
100 | |
---|
101 | </tbody> |
---|
102 | </table> |
---|
103 | </div> |
---|
104 | <div class="buttons"> |
---|
105 | <span class="button"><g:actionSubmit class="save" value="Update" /></span> |
---|
106 | <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> |
---|
107 | </div> |
---|
108 | </g:form> |
---|
109 | </div> |
---|
110 | </body> |
---|
111 | </html> |
---|