mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Simplify and add tests
Makes these assumptions: - we don’t care about history before 29th November 2019 at 11am (this is when priority started to mean a proportion rather than a ranking) - the priority of the second provider will always be the inverse of the first provider Which means the code is a lot simpler/actually does what you’d expect.
This commit is contained in:
@@ -24,10 +24,10 @@
|
||||
<div class="column-two-thirds">
|
||||
<div class="history-list-percentage-without-border">
|
||||
<div class="history-list-percentage-left-label">
|
||||
MMG
|
||||
{{ primary_provider }}
|
||||
</div>
|
||||
<div class="history-list-percentage-right-label">
|
||||
Firetext
|
||||
{{ secondary_provider }}
|
||||
</div>
|
||||
{% call form_wrapper() %}
|
||||
<div class="radio-slider" data-module="radio-slider">
|
||||
@@ -71,17 +71,16 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="column-two-thirds">
|
||||
{% set percentage = (version.priority / (version.priority + version.other_provider.priority) * 100) %}
|
||||
<div class="history-list-percentage">
|
||||
<div class="history-list-percentage-left-label">
|
||||
{{ version.display_name }}<br><br>
|
||||
{{ percentage|format_thousands }}%
|
||||
{{ primary_provider }}<br><br>
|
||||
{{ version.priority|format_thousands }}%
|
||||
</div>
|
||||
<div class="history-list-percentage-right-label">
|
||||
{{ version.other_provider.display_name }}<br><br>
|
||||
{{ (100 - percentage)|format_thousands }}%
|
||||
{{ secondary_provider }}<br><br>
|
||||
{{ (100 - version.priority)|format_thousands }}%
|
||||
</div>
|
||||
<div class="history-list-percentage-marker" style="left: {{ (100 -percentage)|format_thousands }}%"></div>
|
||||
<div class="history-list-percentage-marker" style="left: {{ (100 -version.priority)|format_thousands }}%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user