mistpe commited on
Commit
c63db81
·
verified ·
1 Parent(s): 3922044

Update templates/dashboard.html

Browse files
Files changed (1) hide show
  1. templates/dashboard.html +13 -0
templates/dashboard.html CHANGED
@@ -357,7 +357,20 @@
357
 
358
  <div class="container">
359
  {% if spaces %}
 
 
 
 
 
 
 
 
360
  {% for owner, owner_spaces in grouped_spaces.items() %}
 
 
 
 
 
361
  <div class="owner-section">
362
  <div class="owner-header">
363
  <div class="owner-name">
 
357
 
358
  <div class="container">
359
  {% if spaces %}
360
+ {% set grouped_spaces = {} %}
361
+ {% for space in spaces %}
362
+ {% if space.owner not in grouped_spaces %}
363
+ {% set _ = grouped_spaces.update({space.owner: []}) %}
364
+ {% endif %}
365
+ {% set _ = grouped_spaces[space.owner].append(space) %}
366
+ {% endfor %}
367
+
368
  {% for owner, owner_spaces in grouped_spaces.items() %}
369
+ {% set running_count = owner_spaces | selectattr('status','equalto','RUNNING') | list | length %}
370
+ {% set building_count = owner_spaces | selectattr('status','equalto','BUILDING') | list | length %}
371
+ {% set sleeping_count = owner_spaces | selectattr('status','equalto','SLEEPING') | list | length %}
372
+ {% set stopped_count = owner_spaces | selectattr('status','equalto','STOPPED') | list | length %}
373
+ {% set failed_count = owner_spaces | selectattr('status','equalto','FAILED') | list | length %}
374
  <div class="owner-section">
375
  <div class="owner-header">
376
  <div class="owner-name">