1 | |
---|
2 | <%@ page import="dbnp.studycapturing.Event" %> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
---|
6 | <meta name="layout" content="main" /> |
---|
7 | <g:set var="entityName" value="${message(code: 'event.label', default: 'Event')}" /> |
---|
8 | <title><g:message code="default.create.label" args="[entityName]" /></title> |
---|
9 | <g:render template="../common/jquerysetup"/> |
---|
10 | <g:render template="../common/jqueryuisetup"/> |
---|
11 | <g:render template="../common/jquerytmsetup"/> |
---|
12 | |
---|
13 | |
---|
14 | |
---|
15 | <script type="text/javascript"> |
---|
16 | function displayVals() { |
---|
17 | var singleValues = $("#single").val(); |
---|
18 | var multipleValues = $("#multiple").val() || []; |
---|
19 | var subjectValues = $("#subject").val(); |
---|
20 | alert( $("#subject").val() ); |
---|
21 | $("p").html("<b>Single:</b> " + singleValues + " <b>Multiple:</b> " + multipleValues.join(", ") + subjectValues.join(", ") ); // eventDescriptionValues.join(", ") ); |
---|
22 | $("select").change(displayVals); |
---|
23 | } |
---|
24 | </script> |
---|
25 | <style> p { color:red; margin:4px; } b { color:blue; } </style> |
---|
26 | </head> |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | <body> |
---|
31 | |
---|
32 | |
---|
33 | <div class="nav"> |
---|
34 | <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span> |
---|
35 | <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span> |
---|
36 | </div> |
---|
37 | |
---|
38 | <div class="body"> |
---|
39 | <h1><g:message code="default.create.label" args="[entityName]" /></h1> |
---|
40 | <g:if test="${flash.message}"> |
---|
41 | <div class="message">${flash.message}</div> |
---|
42 | </g:if> <g:hasErrors bean="${eventInstance}"> |
---|
43 | <div class="errors"> |
---|
44 | <g:renderErrors bean="${eventInstance}" as="list" /> |
---|
45 | </div> |
---|
46 | </g:hasErrors> |
---|
47 | |
---|
48 | <g:form action="createForEventDescription" method="post"> |
---|
49 | <div class="dialog"> |
---|
50 | <table> |
---|
51 | <tbody> |
---|
52 | |
---|
53 | <tr class="prop"> |
---|
54 | <td valign="top" class="name"> |
---|
55 | <label for="subject"><g:message code="event.subject.label" default="Subject" /></label> |
---|
56 | </td> |
---|
57 | <td valign="top" class="value" > |
---|
58 | <g:select id="subject" name="subject.id" from="${dbnp.studycapturing.Subject.list()}" optionKey="id" optionValue="name" value="${eventInstance?.subject?.id}" onchange="displayVals()" /> |
---|
59 | </td> |
---|
60 | </tr> |
---|
61 | |
---|
62 | <tr class="prop"> |
---|
63 | <td valign="top" class="name"> |
---|
64 | <label for="startTime"><g:message code="event.startTime.label" default="Start Time" /></label> |
---|
65 | </td> |
---|
66 | <td valign="top" class="name"> |
---|
67 | <script> $(function() { $('#startTime').datepicker({ duration: '', showTime: true, constrainInput: false });}); </script> |
---|
68 | <g:textField name="startTime" value="" /> |
---|
69 | </td> |
---|
70 | </tr> |
---|
71 | |
---|
72 | <tr class="prop"> |
---|
73 | <td valign="top" class="name"> |
---|
74 | <label for="endTime"><g:message code="event.endTime.label" default="End Time" /></label> |
---|
75 | </td> |
---|
76 | <td valign="top" class="name"> |
---|
77 | <script> $(function() { $('#endTime').datepicker({ duration: '', showTime: true, constrainInput: false });}); </script> |
---|
78 | <g:textField name="endTime" value="" /> |
---|
79 | </td> |
---|
80 | </tr> |
---|
81 | <tr class="prop"> |
---|
82 | <td valign="top" class="name"> |
---|
83 | <label for="eventDescription"><g:message code="event.eventDescription.label" default="Event Description" /></label> |
---|
84 | </td> |
---|
85 | <td valign="top" class="value ${hasErrors(bean: eventInstance, field: 'eventDescription', 'errors')}"> |
---|
86 | <g:select name="eventDescription.id" from="${dbnp.studycapturing.EventDescription.list()}" optionKey="id" optionValue="name" value="${eventInstance?.eventDescription?.id}" /> |
---|
87 | </td> |
---|
88 | </tr> |
---|
89 | |
---|
90 | |
---|
91 | </tbody> |
---|
92 | </table> |
---|
93 | </div> |
---|
94 | |
---|
95 | |
---|
96 | <div class="buttons"> |
---|
97 | <span class="button"><g:submitButton name="create" class="save" value="Next step" /></span> |
---|
98 | </div> |
---|
99 | |
---|
100 | </g:form> |
---|
101 | </div> |
---|
102 | </body> |
---|
103 | </html> |
---|