]> git.ipfire.org Git - pbs.git/commitdiff
build groups: Fix rendering macro
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Jan 2025 11:29:04 +0000 (11:29 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Jan 2025 11:29:04 +0000 (11:29 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/builds/groups/macros.html

index 97e49a3a90127339bfd4f49eab2accdecd81a70d..0b16fbec2e96b17abef9d80fa9bbb3c918086fcc 100644 (file)
@@ -1,4 +1,4 @@
-{% macro BuildGroupList(group) %}
+{% macro BuildGroupList(group, limit=None) %}
        <nav class="panel
                        {% if group.has_failed() %}
                                is-danger
@@ -17,7 +17,7 @@
                                                                        </p>
 
                                                                        <p class="title has-text-success">
-                                                                               {{ len(group.successful_builds) }}
+                                                                               {{ group.successful_builds | count }}
                                                                        </p>
                                                                </div>
                                                        </div>
@@ -31,7 +31,7 @@
                                                                        </p>
 
                                                                        <p class="title has-text-danger">
-                                                                               {{ len(group.failed_builds) }}
+                                                                               {{ group.failed_builds | count }}
                                                                        </p>
                                                                </div>
                                                        </div>
@@ -41,7 +41,7 @@
                        </div>
                </div>
 
-               {% for i, build in enumerate(group) %}
+               {% for i, build in group | enumerate %}
                        {# Don't show more than limit builds #}
                        {% if limit and i >= limit %}
                                {% break %}
@@ -78,7 +78,7 @@
                {% endfor %}
 
                {# Show a button to see all builds in this group #}
-               {% if limit and limit < len(group) %}
+               {% if limit and limit < group | count %}
                        {# XXX needs styling #}
                        <a class="panel-block is-justify-content-center" href="/builds/groups/{{ group.uuid }}">
                                {{ _("Show all") }}