workspace context setup

This commit is contained in:
Andrew Croce 2018-07-26 16:41:37 -04:00
parent 49460768ef
commit 5cabf8b66e
7 changed files with 21 additions and 7 deletions

View File

@ -1,4 +1,8 @@
import os
import re
def navigationContext(self):
return 'workspace' if re.match('\/workspaces\/[A-Za-z0-9]*', self.request.uri) else 'global'
def dev(self):
return os.getenv("TORNADO_ENV", "dev") == "dev"

View File

@ -1,6 +1,6 @@
{# TODO: set this context elsewhere #}
{# set context='workspace' #}
{% set context='global' %}
{% set context=navigationContext() %}
<!DOCTYPE html>
<html>

View File

@ -0,0 +1,9 @@
{% extends "base.html.to" %}
{% block content %}
{% include 'navigation/workspace_navigation.html.to' %}
{% block workspace_content %}{% end %}
{% end %}

View File

@ -6,7 +6,7 @@
<div class="topbar__context topbar__context--{{context}}">
<a href="/" class="topbar__link">
<span class="topbar__link-label">JEDI</span>
<span class="topbar__link-label">{{ "Workspace Name" if context == 'workspace' else "JEDI" }}</span>
{% module Icon('caret_down', classes='topbar__link-icon icon--tiny') %}
</a>

View File

@ -0,0 +1 @@
nav

View File

@ -1,6 +1,6 @@
{% extends "base.html.to" %}
{% extends "base_workspace.html.to" %}
{% block content %}
{% block workspace_content %}
<div class="panel">
<div class='responsive-table-wrapper'>

View File

@ -13,10 +13,10 @@
<tbody>
{% for w in workspaces %}
<tr>
<th scope="row">
<a href="">{{ w['name'] }}</a><br>
<td scope="row">
<a href="/workspaces/{{w['task_order']['number']}}">{{ w['name'] }}</a><br>
Task Order: #{{ w['task_order']['number'] }}
</th>
</td>
<td>
<span class="usa-label">{{ w['user_count'] }}</span><br>Users
</td>