mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Add character count as you type
Text messages have a maximum length, which we tell the users. We
shouldn’t expect people to count the characters in the message
themselves.
This commit borrows [the word counter from the Digital Marketplace
frontend toolkit](9d17690de5/toolkit/javascripts/word-counter.js)
and adapts it to count characters instead.
Things I’m still not sure about with this:
- what should it say when the message goes over the length of one text
message
- what’s the interaction with placeholders, which will change the length
of the message
This commit also adds a line to the pricing page which explains that
service name counts towards the length of the message.
This commit is contained in:
@@ -18,7 +18,14 @@
|
||||
{{ textbox(form.name, width='1-1', hint='Your recipients won’t see this') }}
|
||||
</div>
|
||||
<div class="column-two-thirds">
|
||||
{{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=5) }}
|
||||
{{ textbox(
|
||||
form.template_content,
|
||||
highlight_tags=True,
|
||||
character_count=True,
|
||||
width='1-1',
|
||||
service_name=current_service.name,
|
||||
rows=5
|
||||
) }}
|
||||
{{ page_footer(
|
||||
'Save',
|
||||
delete_link=url_for('.delete_service_template', service_id=current_service.id, template_id=template_id) if template_id or None,
|
||||
|
||||
Reference in New Issue
Block a user