]> git.ipfire.org Git - pbs.git/commitdiff
sources: Fix rendering page when source has never been fetched
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 20 Jul 2023 10:15:34 +0000 (10:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 20 Jul 2023 10:15:34 +0000 (10:15 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/sources/show.html

index e5dc00b5369e40c8b13bfdc994571a0535636c76..3e729ff0c359dd33c09f68937fd04d3cb90167f3 100644 (file)
                                <h1 class="title is-1">{{ source }}</h1>
 
                                <div class="level">
-                                       <div class="level-item has-text-centered">
-                                               <div>
-                                                       <p class="heading">{{ _("Last Check") }}</p>
-                                                       <p>
-                                                               {{ locale.format_date(source.last_fetched_at, shorter=True) }}
-                                                       </p>
+                                       {% if source.last_fetched_at %}
+                                               <div class="level-item has-text-centered">
+                                                       <div>
+                                                               <p class="heading">{{ _("Last Check") }}</p>
+                                                               <p>
+                                                                       {{ locale.format_date(source.last_fetched_at, shorter=True) }}
+                                                               </p>
+                                                       </div>
                                                </div>
-                                       </div>
+                                       {% end %}
                                </div>
                        </div>
                </div>