added small text. Added top margin. Use textarea to allow wrap text on digest

This commit is contained in:
CocoByte 2025-03-13 00:46:34 -06:00
parent 51e833acd0
commit f02f95d132
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
6 changed files with 30 additions and 22 deletions

View file

@ -299,3 +299,4 @@ Fit-content itself does not work.
.minh-143px {
min-height: 143px;
}

View file

@ -166,3 +166,10 @@ th {
overflow-y: visible;
}
}
.usa-textarea--digest {
max-height: 4rem;
min-width: 13rem;
resize: none;
overflow: hidden;
}

View file

@ -661,9 +661,8 @@ class DomainDsdataForm(forms.Form):
},
widget=forms.Textarea(
attrs={
"class": "text-wrap",
"rows": "2",
"style": "height: fit-content; resize: none; overflow:hidden;"
"maxlength": "40",
"class": "text-wrap usa-textarea--digest",
}
)
)

View file

@ -123,7 +123,7 @@
{% endif %}
{% endfor %}
<div tabindex="0" id="domains__table-wrapper">
<div class="margin-top-4" tabindex="0" id="domains__table-wrapper">
<table class="usa-table usa-table--borderless usa-table--stacked dotgov-table dotgov-table--stacked" id="dsdata-table">
<thead>
<tr>
@ -214,24 +214,24 @@
<tr class="edit-row display-none">
<td class="text-bottom">
{% with sublabel_text="Numbers (0-9) only." %}
{% with attr_required=True add_initial_value_attr=True add_group_class="usa-form-group--unstyled-error" %}
{% with attr_required=True add_initial_value_attr=True add_group_class="usa-form-group--unstyled-error" use_small_sublabel_text=True %}
{% input_with_errors form.key_tag %}
{% endwith %}
{% endwith %}
</td>
<td class="text-bottom">
{% with attr_required=True add_initial_value_attr=True add_group_class="usa-form-group--unstyled-error" %}
{% with attr_required=True add_initial_value_attr=True add_group_class="usa-form-group--unstyled-error" use_small_sublabel_text=True %}
{% input_with_errors form.algorithm %}
{% endwith %}
</td>
<td class="text-bottom">
{% with attr_required=True add_initial_value_attr=True add_group_class="usa-form-group--unstyled-error" %}
{% with attr_required=True add_initial_value_attr=True add_group_class="usa-form-group--unstyled-error" use_small_sublabel_text=True %}
{% input_with_errors form.digest_type %}
{% endwith %}
</td>
<td class="text-bottom">
{% with sublabel_text="Numbers (0-9) and letters (a-f) only. SHA-1: 40 chars, SHA-256: 64 chars." %}
{% with attr_required=True add_initial_value_attr=True add_group_class="usa-form-group--unstyled-error" %}
{% with attr_required=True add_initial_value_attr=True add_group_class="usa-form-group--unstyled-error" use_small_sublabel_text=True %}
{% input_with_errors form.digest %}
{% endwith %}
{% endwith %}

View file

@ -62,7 +62,7 @@
{% with link_href=login_help_url %}
{% with sublabel_text="We recommend using a Login.gov account that's only connected to your work email address. If you need to change your email, you'll need to make a change to your Login.gov account. Get help with updating your email address." %}
{% with link_text="Get help with updating your email address" target_blank=True do_not_show_max_chars=True %}
{% with link_text="Get help with updating your email address" target_blank=True %}
{% input_with_errors form.email %}
{% endwith %}
{% endwith %}

View file

@ -7,7 +7,7 @@ error messages, if necessary.
{% load widget_tweaks %}
{% if widget.attrs.maxlength %}
{% if widget.attrs.maxlength or field.widget_type == 'textarea' %}
<div class="usa-character-count">
{% endif %}
@ -35,7 +35,7 @@ error messages, if necessary.
{% endif %}
{% if sublabel_text %}
<p id="{{ widget.attrs.id }}__sublabel" class="text-base margin-top-2px margin-bottom-1">
<p id="{{ widget.attrs.id }}__sublabel" class="{% if use_small_sublabel_text %}font-body-xs {% endif %}text-base margin-top-2px margin-bottom-1">
{# If the link_text appears more than once, the first instance will be a link and the other instances will be ignored #}
{% if link_text and link_text in sublabel_text %}
{% with link_index=sublabel_text|find_index:link_text %}
@ -92,7 +92,8 @@ error messages, if necessary.
</div>
{% endif %}
{% if widget.attrs.maxlength and not do_not_show_max_chars %}
{% if field.widget_type == 'textarea' or widget.attrs.maxlength %}
{% if not do_not_show_max_chars %}
<span
id="{{ widget.attrs.id }}__message"
class="usa-character-count__message"
@ -100,6 +101,6 @@ error messages, if necessary.
>
You can enter up to {{ widget.attrs.maxlength }} characters
</span>
{% endif %}
</div>
{% endif %}