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

Last change on this file since 39 was 39, checked in by gav, 15 years ago

Setup Boostrap and DataSource? so that we have demo data in prod env for deployin
g demo. Adjust the entry domain and rebuild views and controller.

File size: 5.6 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="task">Task:</label>
34                                </td>
35                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'task','errors')}">
36                                    <g:select optionKey="id" from="${Task.list()}" name="task.id" value="${entryInstance?.task?.id}" ></g:select>
37                                </td>
38                            </tr>
39                       
40                            <tr class="prop">
41                                <td valign="top" class="name">
42                                    <label for="comments">Comments:</label>
43                                </td>
44                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'comments','errors')}">
45                                    <textarea rows="5" cols="40" name="comments">${fieldValue(bean:entryInstance, field:'comments')}</textarea>
46                                </td>
47                            </tr>
48                       
49                            <tr class="prop">
50                                <td valign="top" class="name">
51                                    <label for="date">Date:</label>
52                                </td>
53                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'date','errors')}">
54                                    <g:datePicker name="date" value="${entryInstance?.date}" ></g:datePicker>
55                                </td>
56                            </tr>
57                       
58                            <tr class="prop">
59                                <td valign="top" class="name">
60                                    <label for="durationHours">Duration Hours:</label>
61                                </td>
62                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'durationHours','errors')}">
63                                    <input type="text" id="durationHours" name="durationHours" value="${fieldValue(bean:entryInstance,field:'durationHours')}" />
64                                </td>
65                            </tr>
66                       
67                            <tr class="prop">
68                                <td valign="top" class="name">
69                                    <label for="durationMinutes">Duration Minutes:</label>
70                                </td>
71                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'durationMinutes','errors')}">
72                                    <input type="text" id="durationMinutes" name="durationMinutes" value="${fieldValue(bean:entryInstance,field:'durationMinutes')}" />
73                                </td>
74                            </tr>
75                       
76                            <tr class="prop">
77                                <td valign="top" class="name">
78                                    <label for="entryType">Entry Type:</label>
79                                </td>
80                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'entryType','errors')}">
81                                    <g:select optionKey="id" from="${EntryType.list()}" name="entryType.id" value="${entryInstance?.entryType?.id}" ></g:select>
82                                </td>
83                            </tr>
84                       
85                            <tr class="prop">
86                                <td valign="top" class="name">
87                                    <label for="person">Person:</label>
88                                </td>
89                                <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'person','errors')}">
90                                    <g:select optionKey="id" from="${Person.list()}" name="person.id" value="${entryInstance?.person?.id}" ></g:select>
91                                </td>
92                            </tr>
93                       
94                        </tbody>
95                    </table>
96                </div>
97                <div class="buttons">
98                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
99                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
100                </div>
101            </g:form>
102        </div>
103    </body>
104</html>
Note: See TracBrowser for help on using the repository browser.