]> git.ipfire.org Git - pbs.git/commitdiff
jobs: Show type icon for all job types
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Feb 2025 16:20:01 +0000 (16:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Feb 2025 16:20:01 +0000 (16:20 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/builds/show.html
src/templates/jobs/macros.html

index fbc28cf2ce8356c99468a1ecfa7264be8e791fe5..ada2790c8b669620ccf29e6b5224f3e3f10a4ddb 100644 (file)
                        <div class="container">
                                <h5 class="title is-5">{{ _("Jobs")}}</h5>
 
-                               {{ JobList(build.jobs, show_arch_only=True, show_owner=False) }}
+                               {{ JobList(build.jobs, show_arch_only=True, show_type=False) }}
 
                                {# Bug? #}
                                {% if build.has_failed() %}
index 2d11c463cd4ef5cbf4df9c7c9972d6670f4d93fc..ac94aabe566f96a7421ba28de8843456ea1d260a 100644 (file)
@@ -20,7 +20,7 @@
 
 {% from "users/macros.html" import Avatar with context %}
 
-{% macro JobList(jobs, show_arch_only=False, show_owner=True) %}
+{% macro JobList(jobs, show_arch_only=False, show_type=True) %}
        <article class="panel">
                {% for job in jobs %}
                        <div class="panel-block is-block">
                                                        </div>
                                                {% endif %}
 
+
+                                               {# Runtime #}
+                                               {% if job.has_finished() %}
+                                                       <div class="level-item">
+                                                               <div class="tag">
+                                                                       {{ job.duration | format_time }}
+                                                               </div>
+                                                       </div>
+                                               {% endif %}
+
                                                {# Logs #}
                                                {% if job.show_log() %}
                                                        <div class="level-item">
                                                        </div>
                                                {% endif %}
 
-                                               {# Scratch Build? #}
-                                               {% if show_owner and job.build.is_scratch() %}
-                                                       <span class="level-item">
-                                                               <a class="button is-text is-small" href="{{ job.build.owner.link }}">
-                                                                       <figure class="image is-24x24">
-                                                                               {{ Avatar(job.build.owner, size=48) }}
-                                                                       </figure>
-                                                               </a>
-                                                       </span>
-                                               {% endif %}
+                                               {# Show type? #}
+                                               {% if show_type %}
+                                                       {# Scratch Build? #}
+                                                       {% if job.build.is_scratch() %}
+                                                               <span class="level-item">
+                                                                       <a href="{{ job.build.owner.link }}">
+                                                                               <figure class="image is-24x24">
+                                                                                       {{ Avatar(job.build.owner, size=48) }}
+                                                                               </figure>
+                                                                       </a>
+                                                               </span>
 
-                                               {# Runtime #}
-                                               {% if job.has_finished() %}
-                                                       <div class="level-item">
-                                                               <div class="tag">
-                                                                       {{ job.duration | format_time }}
-                                                               </div>
-                                                       </div>
+                                                       {# Test Build? #}
+                                                       {% elif job.build.is_test() %}
+                                                               <span class="level-item">
+                                                                       <span class="icon" title="{{ _("Test Build") }}">
+                                                                               <i class="fa-solid fa-flask"></i>
+                                                                       </span>
+                                                               </span>
+
+                                                       {# Release Build? #}
+                                                       {% else %}
+                                                               <span class="level-item">
+                                                                       <span class="icon" title="{{ _("Release Build") }}">
+                                                                               <i class="fa-solid fa-box"></i>
+                                                                       </span>
+                                                               </span>
+                                                       {% endif %}
                                                {% endif %}
                                        </div>
                                </div>