Add check for dependency addition/removal counts on release page (#1703) (#1722)

This commit is contained in:
daveoconnor
2025-03-31 11:31:04 -07:00
committed by GitHub
parent b74c1c9783
commit 7e81d7eb61

View File

@@ -120,28 +120,39 @@
</section>
{% endif %}
{% if deps.added or deps.removed %}
<section id="dependencyChanges"
class="p-6 my-4 bg-white md:rounded-lg md:shadow-lg dark:text-white text-slate dark:bg-charcoal dark:bg-neutral-700">
<h2 class="text-2xl mt-0">Dependencies</h2>
<div>
There {{ deps.added|pluralize:"was,were" }}
<span class="text-red-700">
{{ deps.added }} dependenc{{ deps.added|pluralize:"y,ies"}} added
</span>
<span>
(in {{ deps.increased_dep_lib_count }} librar{{ deps.increased_dep_lib_count|pluralize:"y,ies" }})
</span>
and
<span class="text-[rgb(14,174,96)] dark:text-green">
{{ deps.removed }} dependenc{{ deps.removed|pluralize:"y,ies"}} removed
</span>
<span>
(in {{ deps.decreased_dep_lib_count }} librar{{ deps.decreased_dep_lib_count|pluralize:"y,ies" }})
</span>
this release.
</div>
</section>
{% if not version.beta %}
{% if deps.added or deps.removed %}
<section id="dependencyChanges"
class="p-6 my-4 bg-white md:rounded-lg md:shadow-lg dark:text-white text-slate dark:bg-charcoal dark:bg-neutral-700">
<h2 class="text-2xl mt-0">Dependencies</h2>
<div>
{% if deps.added %}
There {{ deps.added|pluralize:"was,were" }}
<span class="text-red-700">
{{ deps.added }} dependenc{{ deps.added|pluralize:"y,ies"}} added
</span>
<span>
(in {{ deps.increased_dep_lib_count }} librar{{ deps.increased_dep_lib_count|pluralize:"y,ies" }})
</span>
{% endif %}
{% if deps.added and deps.removed %}
and
{% endif %}
{% if deps.removed %}
{% if not deps.added %}
There {{ deps.removed|pluralize:"was,were" }}
{% endif %}
<span class="text-[rgb(14,174,96)] dark:text-green">
{{ deps.removed }} dependenc{{ deps.removed|pluralize:"y,ies"}} removed
</span>
<span>
(in {{ deps.decreased_dep_lib_count }} librar{{ deps.decreased_dep_lib_count|pluralize:"y,ies" }})
</span>
{% endif %}
this release.
</div>
</section>
{% endif %}
{% endif %}
{% if top_contributors_release %}