Reorder project page stat cards based on in-progress count

Amolith created

Change summary

templates/project.html | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

Detailed changes

templates/project.html 🔗

@@ -14,8 +14,9 @@
 
 <h1>{{ project_name }}</h1>
 
+{% if stats_in_progress > 0 %}
 <div class="row">
-    <article class="card col-4{% if stats_in_progress > 0 %} border-warning{% endif %}">
+    <article class="card col-4 border-warning">
       <p class="text-light">In progress</p>
       <p><strong>{{ stats_in_progress }}</strong></p>
     </article>
@@ -28,6 +29,22 @@
       <p><strong>{{ stats_closed }}</strong></p>
     </article>
 </div>
+{% else %}
+<div class="row">
+    <article class="card col-4{% if stats_open > 0 %} border-success{% endif %}">
+      <p class="text-light">Open</p>
+      <p><strong>{{ stats_open }}</strong></p>
+    </article>
+    <article class="card col-4">
+      <p class="text-light">In progress</p>
+      <p><strong>{{ stats_in_progress }}</strong></p>
+    </article>
+    <article class="card col-4">
+      <p class="text-light">Closed</p>
+      <p><strong>{{ stats_closed }}</strong></p>
+    </article>
+</div>
+{% endif %}
 
 {% if !next_up.is_empty() %}
 <details open class="mt-4">