Workspaces page working

This commit is contained in:
richard-dds 2018-08-21 10:51:29 -04:00
parent 95f7fb2026
commit dcd69f6b9f
3 changed files with 14 additions and 7 deletions

View File

@ -23,3 +23,11 @@ class Workspace(Base, TimestampsMixin):
@property
def users(self):
return set(role.user for role in self.roles)
@property
def user_count(self):
return len(self.users)
@property
def task_order(self):
return {"number": "task-order-number"}

View File

@ -1,7 +1,6 @@
from flask import Blueprint, render_template, request as http_request
from atst.domain.workspaces import Members, Projects, Workspaces
from flask import Blueprint, render_template, request as http_request, g
from atst.domain.workspaces import Workspaces
bp = Blueprint("workspaces", __name__)

View File

@ -11,16 +11,16 @@
</tr>
</thead>
<tbody>
{% for w in workspaces %}
{% for workspace in workspaces %}
<tr>
<td>
<a class='icon-link icon-link--large' href="/workspaces/{{w['task_order']['number']}}/projects">{{ w['name'] }}</a><br>
<a class='icon-link icon-link--large' href="/workspaces/{{ workspace.id }}/projects">{{ workspace.name }}</a><br>
</td>
<td>
#{{ w['task_order']['number'] }}
#{{ workspace.task_order.number }}
</td>
<td>
<span class="label">{{ w['user_count'] }}</span><span class='h6'>Users</span>
<span class="label">{{ workspace.user_count }}</span><span class='h6'>Users</span>
</td>
</tr>
{% endfor %}