Files
wekan/client/components/forms/datepicker.jade
T

29 lines
1.6 KiB
Plaintext

//- The date-and-time form every "edit a date" popup is made of: the card's
//- Received, Start, Due and End dates, a vote's and a planning poker's end
//- date, and a date custom field. Eight popups drew this same form, letter for
//- letter, in three different files.
//-
//- It takes what it shows as ARGUMENTS rather than reading helpers: a helper
//- inside a template is looked up on that template, not on the one including
//- it, and all eight popups keep their own state and handlers
//- (client/lib/datepicker.js, which they already shared - it was only the
//- markup that was copied). So this template has no code of its own at all;
//- it renders the popup's datePicker state and the buttons. Its events live on
//- this template too: Blaze events do not cross a child-template boundary.
template(name="editDateForm")
.datepicker-container
form.edit-date(class="{{#if customFieldControls}}custom-field-date-editor{{/if}}")
.fields
.left
+calendarDateInput(inputId="date" inputName="date" fieldClass="js-date-field" value=showDate inline=true)
.right
label {{_ 'time'}}
+calendarTimeInput(inputId="time" inputName="time" fieldClass="js-time-field" value=showTime defaultTime=datePicker.defaultTime)
if customFieldControls
.custom-field-date-copy
+customFieldCopyButton(value=customFieldCopyValue)
if error.get
.warning {{_ error.get}}
button.primary.wide.left.js-submit-date(type="submit") {{_ 'save'}}
button.js-delete-date.negate.wide.right.js-delete-date {{_ 'delete'}}