This commit is contained in:
zandercymatics 2024-06-20 11:50:30 -06:00
parent 39629a3e10
commit 0e42309f6c
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 46 additions and 29 deletions

View file

@ -787,36 +787,50 @@ div.dja__model-description{
color: var(--link-fg);
}
// If the dja textarea is set as readonly, display this on hover
textarea.vLargeTextField[readonly]:hover {
cursor: not-allowed;
.dja-textarea-container {
textarea {
width: 100%;
resize: none;
&::-webkit-scrollbar {
background-color: transparent;
border: none;
width: 12px;
}
.textarea-container textarea {
width: 100%; /* Full width to fit the container */
height: 150px; /* Fixed height or as needed */
padding-right: 10px; /* Enough padding to nest the scrollbar inside */
box-sizing: border-box; /* Include padding in width and height calculations */
overflow-y: auto; /* Only show vertical scrollbar when necessary */
scrollbar-width: thin; /* Makes the scrollbar thinner */
scrollbar-color: #888 #000; /* Optional: styling the scrollbar with a thumb and track color */
&::-webkit-scrollbar-thumb {
background-color: var(--hairline-color);
border-radius: 99px;
background-clip: content-box;
border: 3px solid transparent;
}
/* For WebKit browsers like Chrome, Safari */
.textarea-container textarea::-webkit-scrollbar {
width: 8px; /* Width of the scrollbar */
&::-webkit-scrollbar-thumb:hover {
cursor: pointer;
}
.textarea-container textarea::-webkit-scrollbar-track {
background: #000; /* Track color */
&::-webkit-scrollbar-button {
display: none;
}
.textarea-container textarea::-webkit-scrollbar-thumb {
background-color: #888; /* Color of the scrollbar thumb */
border-radius: 10px; /* Rounded corners for the scrollbar thumb */
border: 2px solid #000; /* Optional: Adds a border around the thumb */
::-webkit-scrollbar-corner {
display: none;
}
}
}
.max-full {
width: 100% !important;
}
.thin-border {
border: 1px solid var(--border-color);
border-radius: 4px;
}
.no-border {
border: none
}

View file

@ -550,7 +550,6 @@ class DomainRequest(TimeStampedModel):
def get_action_needed_reason_default_email_text(self, action_needed_reason: str):
"""Returns the default email associated with the given action needed reason"""
logger.info(f"reason? {action_needed_reason}")
if action_needed_reason is None or action_needed_reason == self.ActionNeededReasons.OTHER:
return {
"subject_text": None,
@ -567,9 +566,13 @@ class DomainRequest(TimeStampedModel):
# Return the content of the rendered views
context = {"domain_request": self}
# autoescape off adds a newline to the beginning of the email.
# This is fine when the email is rendered, but we don't need this for display.
email_body_text = template.render(context=context).lstrip().lstrip("\n")
return {
"subject_text": subject_template.render(context=context),
"email_body_text": template.render(context=context)
"email_body_text": email_body_text
}

View file

@ -107,11 +107,11 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
</table>
{% if original_object.action_needed_reason_email %}
<div class="dja-textarea-container padding-1 margin-top-2 display-none">
<div class="dja-textarea-container padding-1 margin-top-2 thin-border display-none">
<label class="max-full" for="action_needed_reason_email_view_more">
<strong>Action needed reason email</strong>
<strong>Auto-generated email (will be sent to submitter)</strong>
</label>
<textarea id="action_needed_reason_email_view_more" cols="40" rows="20" class="vLargeTextField {% if original_object.status != "action needed" %} display-none {% endif %}" readonly>
<textarea id="action_needed_reason_email_view_more" cols="40" rows="20" class="no-border" readonly>
{{ original_object.action_needed_reason_email }}
</textarea>
</div>