Merge pull request #681 from GSA/666-fix-template-bar-length

Removing the section that calculated the count bar for templates
This commit is contained in:
Steven Reilly
2023-08-04 14:33:29 -04:00
committed by GitHub
3 changed files with 13 additions and 9 deletions

View File

@@ -224,3 +224,8 @@ td.table-empty-message {
outline-offset: units(1); outline-offset: units(1);
} }
} }
.spark-bar-bar {
font-size: units(3);
background-color: transparent;
}

View File

@@ -183,16 +183,14 @@
id=None id=None
) %} ) %}
{% call field(align='right') %} {% call field(align='right') %}
{% if id %}
<style nonce="{{ csp_nonce() }}">
#{{id}} .spark-bar-bar {
width: {{ count / max_count * 100 }}%;
}
</style>
{% endif %}
<span {% if id %}id="{{ id }}"{% endif %} class="spark-bar"> <span {% if id %}id="{{ id }}"{% endif %} class="spark-bar">
<span class="spark-bar-bar"> <span class="spark-bar-bar">
{{ '{:,.0f}'.format(count) }} {{ '{:,.0f}'.format(count) }}
{% if count == 1 -%}
message sent
{% else -%}
messages sent
{% endif %}
</span> </span>
</span> </span>
{% endcall %} {% endcall %}

View File

@@ -556,7 +556,8 @@ def test_should_show_monthly_breakdown_of_template_usage(
assert ' '.join(table_rows[0].text.split()) == ( assert ' '.join(table_rows[0].text.split()) == (
'My first template ' 'My first template '
'Text message template ' 'Text message template '
'2' '2 '
'messages sent'
) )
assert len(table_rows) == len(['October']) assert len(table_rows) == len(['October'])