1 | <html> |
---|
2 | |
---|
3 | <head> |
---|
4 | <meta name="layout" content="main" /> |
---|
5 | <g:set var="entityName" value="${message(code: 'event.label', default: 'Event')}" /> |
---|
6 | <g:setProvider library="jquery"/> |
---|
7 | <script src="${createLinkTo(dir: 'js', file: 'timepicker-0.2.1.js')}" type="text/javascript"></script> |
---|
8 | </head> |
---|
9 | |
---|
10 | |
---|
11 | <body> |
---|
12 | |
---|
13 | |
---|
14 | <div class="body"> |
---|
15 | |
---|
16 | <h1><g:message code="default.create.label" args="[entityName]" /></h1> |
---|
17 | |
---|
18 | <g:if test="${flash.message}"> |
---|
19 | <div class="message">${flash.message}</div> |
---|
20 | </g:if> |
---|
21 | <g:hasErrors bean="${eventInstance}"> |
---|
22 | <div class="errors"> <g:renderErrors bean="${eventInstance}" as="list" /> </div> |
---|
23 | </g:hasErrors> |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | <g:form action="save" method="post" id="${eventInstance.id}"> |
---|
28 | |
---|
29 | <div class="dialog"> |
---|
30 | <table> |
---|
31 | <tbody> |
---|
32 | |
---|
33 | |
---|
34 | <tr class="prop"> |
---|
35 | <td valign="top" class="name"> |
---|
36 | <label for="subject"><g:message code="event.subject.label" default="Subject" /></label> |
---|
37 | </td> |
---|
38 | <td valign="top" class="value" > |
---|
39 | <g:select id="subject" name="subject.id" from="${dbnp.studycapturing.Subject.list()}" optionKey="id" optionValue="name" value="${eventInstance?.subject?.id}" /> |
---|
40 | </td> |
---|
41 | </tr> |
---|
42 | |
---|
43 | <tr class="prop"> |
---|
44 | <td valign="top" class="name"> |
---|
45 | <label for="startTime"><g:message code="event.startTime" default="Start Time" /></label> |
---|
46 | </td> |
---|
47 | <td valign="top" class="name"> |
---|
48 | <script> $(function() { $('#startTime').datepicker({ duration: '', showTime: true, constrainInput: false });}); </script> |
---|
49 | <% def displayStartTime =String.format("%tm/", sDate ) %> |
---|
50 | <% displayStartTime+=String.format("%td/", sDate ) %> |
---|
51 | <% displayStartTime+=String.format("%tY", sDate ) %> |
---|
52 | <% displayStartTime+=String.format(" %tI:", sDate ) %> |
---|
53 | <% displayStartTime+=String.format("%tM ", sDate ) %> |
---|
54 | <% displayStartTime+=String.format("%tp", sDate ) %> |
---|
55 | <g:textField name="startTime" value="${displayStartTime}" /> |
---|
56 | </td> |
---|
57 | </tr> |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | <tr class="prop"> |
---|
62 | <td valign="top" class="name"> |
---|
63 | <label for="endTime"><g:message code="event.endTime.label" default="End Time" /></label> |
---|
64 | </td> |
---|
65 | <td valign="top" class="name"> |
---|
66 | <script> $(function() { $('#endTime').datepicker({ duration: '', showTime: true, constrainInput: false });}); </script> |
---|
67 | <% def displayEndTime =String.format("%tm/", eDate ) %> |
---|
68 | <% displayEndTime+=String.format("%td/", eDate ) %> |
---|
69 | <% displayEndTime+=String.format("%tY", eDate ) %> |
---|
70 | <% displayEndTime+=String.format(" %tI:", eDate ) %> |
---|
71 | <% displayEndTime+=String.format("%tM ", eDate ) %> |
---|
72 | <% displayEndTime+=String.format("%tp", eDate ) %> |
---|
73 | <g:textField name="endTime" value="${displayEndTime}" /> |
---|
74 | </td> |
---|
75 | </tr> |
---|
76 | |
---|
77 | <g:render template="../common/eventDescriptionTableRows" model="${[description:description, event:event]}"/> |
---|
78 | |
---|
79 | |
---|
80 | <tr class="prop"> |
---|
81 | <td>This is a sampling event </td> |
---|
82 | <td valign="top" class="value ${hasErrors(bean: description, field: 'protocol', 'errors')}"> |
---|
83 | <g:select name="mySampleEvent" id="mySampleEvent" from="${['yes','no']}" value="${isSamplingEvent}" onchange="${remoteFunction(action:'showSample', controller='event', update:'samplePartial', onComplete:'Effect.Appear(samplePartial)', id:params['id'], params:'\'wantSample=\' + this.value',)}" /> |
---|
84 | </td> |
---|
85 | </tr> |
---|
86 | |
---|
87 | |
---|
88 | </tbody> |
---|
89 | |
---|
90 | |
---|
91 | |
---|
92 | <tbody id="samplePartial"> |
---|
93 | |
---|
94 | <g:if test="${(eventInstance.isSamplingEvent()) && (eventInstance.samples!=null)}" > |
---|
95 | <% def list = eventInstance.samples %> |
---|
96 | <% list.sort{ a,b -> a.name <=> b.name }%> |
---|
97 | <g:each in="${list}"> |
---|
98 | <tr class="prop"> |
---|
99 | <td valign="top" class="name" width=200 > |
---|
100 | <label><%= it.name %> </label> |
---|
101 | </td> |
---|
102 | <td valign="top" class="name"> |
---|
103 | <g:textField name="${it.name}" value="" /> |
---|
104 | </td> |
---|
105 | </tr> |
---|
106 | </g:each> |
---|
107 | </g:if> |
---|
108 | </tbody> |
---|
109 | |
---|
110 | |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | </table> |
---|
115 | </div> |
---|
116 | |
---|
117 | |
---|
118 | <div class="buttons"> |
---|
119 | <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Save')}" /></span> |
---|
120 | </div> |
---|
121 | |
---|
122 | |
---|
123 | </g:form> |
---|
124 | </div> |
---|
125 | </body> |
---|
126 | </html> |
---|