]> git.ipfire.org Git - pbs.git/commitdiff
jobs: Move runtime into subtitle
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Feb 2025 16:26:14 +0000 (16:26 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Feb 2025 16:26:14 +0000 (16:26 +0000)
This is a lot easier and looks cleaner because the runtime has a very
variable width.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/jobs/macros.html

index aa10c01c553f8faaafeabf9bbc154da0c7ac3dd4..140c1fd1e8af3cbb337d2ecb62d675f4a5431f96 100644 (file)
                                                                {% elif job.has_failed() %}
                                                                        <p class="has-text-danger">
                                                                                <small>
-                                                                                       {{ _("Failed %s") % job.finished_at | format_date(shorter=True) }}
+                                                                                       {% set args = {
+                                                                                               "duration" : job.duration | format_time,
+                                                                                               "when"     : job.finished_at | format_date(shorter=True),
+                                                                                       } %}
+
+                                                                                       {{ _("Failed %(when)s after %(duration)s") % args }}
                                                                                </small>
                                                                        </p>
 
                                                                {% elif job.has_finished() %}
                                                                        <p class="has-text-success">
                                                                                <small>
-                                                                                       {{ _("Finished %s") % job.finished_at | format_date(shorter=True) }}
+                                                                                       {% set args = {
+                                                                                               "duration" : job.duration | format_time,
+                                                                                               "when"     : job.finished_at | format_date(shorter=True),
+                                                                                       } %}
+
+                                                                                       {{ _("Finished %(when)s in %(duration)s") % args }}
                                                                                </small>
                                                                        </p>
 
                                                        {% endif %}
                                                {% 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">