Show date and time at top of new reminders

main
Bob Mottram 2021-11-03 12:53:49 +00:00
parent b677b01859
commit 38544a8afd
1 changed files with 27 additions and 14 deletions

View File

@ -200,6 +200,24 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
""" """
replyStr = '' replyStr = ''
isNewReminder = False
if path.endswith('/newreminder'):
isNewReminder = True
# the date and time
dateAndTimeStr = \
'<p><img loading="lazy" alt="" title="" ' + \
'class="emojicalendar" src="/' + \
'icons/calendar.png"/>\n'
# select a date and time for this post
dateAndTimeStr += '<label class="labels">' + \
translate['Date'] + ': </label>\n'
dateAndTimeStr += '<input type="date" name="eventDate">\n'
dateAndTimeStr += '<label class="labelsright">' + \
translate['Time'] + ':'
dateAndTimeStr += \
'<input type="time" name="eventTime"></label></p>\n'
showPublicOnDropdown = True showPublicOnDropdown = True
messageBoxHeight = 400 messageBoxHeight = 400
@ -209,7 +227,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
if not path.endswith('/newshare') and not path.endswith('/newwanted'): if not path.endswith('/newshare') and not path.endswith('/newwanted'):
if not path.endswith('/newreport'): if not path.endswith('/newreport'):
if not inReplyTo or path.endswith('/newreminder'): if not inReplyTo or isNewReminder:
newPostText = '<h1>' + \ newPostText = '<h1>' + \
translate['Write your post text below.'] + '</h1>\n' translate['Write your post text below.'] + '</h1>\n'
else: else:
@ -351,7 +369,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
scopeIcon = 'scope_dm.png' scopeIcon = 'scope_dm.png'
scopeDescription = translate['DM'] scopeDescription = translate['DM']
endpoint = 'newdm' endpoint = 'newdm'
elif path.endswith('/newreminder'): elif isNewReminder:
scopeIcon = 'scope_reminder.png' scopeIcon = 'scope_reminder.png'
scopeDescription = translate['Reminder'] scopeDescription = translate['Reminder']
endpoint = 'newreminder' endpoint = 'newreminder'
@ -563,18 +581,8 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
'name="schedulePost"><label class="labels"> ' + \ 'name="schedulePost"><label class="labels"> ' + \
translate['This is a scheduled post.'] + '</label></p>\n' translate['This is a scheduled post.'] + '</label></p>\n'
dateAndLocation += \ if not isNewReminder:
'<p><img loading="lazy" alt="" title="" ' + \ dateAndLocation += dateAndTimeStr
'class="emojicalendar" src="/' + \
'icons/calendar.png"/>\n'
# select a date and time for this post
dateAndLocation += '<label class="labels">' + \
translate['Date'] + ': </label>\n'
dateAndLocation += '<input type="date" name="eventDate">\n'
dateAndLocation += '<label class="labelsright">' + \
translate['Time'] + ':'
dateAndLocation += \
'<input type="time" name="eventTime"></label></p>\n'
dateAndLocation += '</div>\n' dateAndLocation += '</div>\n'
dateAndLocation += '<div class="container">\n' dateAndLocation += '<div class="container">\n'
@ -730,6 +738,11 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
if not shareDescription: if not shareDescription:
shareDescription = '' shareDescription = ''
# for reminders show the date and time at the top
if path.endswith('/newreminder'):
newPostForm += dateAndTimeStr
newPostForm += \ newPostForm += \
editTextField(placeholderSubject, 'subject', shareDescription) editTextField(placeholderSubject, 'subject', shareDescription)
newPostForm += '' newPostForm += ''