Merge pull request #98 from dod-ccpo/ui/ws-context
workspace context setup
This commit is contained in:
commit
e26109178d
@ -1,4 +1,8 @@
|
|||||||
import os
|
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):
|
def dev(self):
|
||||||
return os.getenv("TORNADO_ENV", "dev") == "dev"
|
return os.getenv("TORNADO_ENV", "dev") == "dev"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{# TODO: set this context elsewhere #}
|
{# TODO: set this context elsewhere #}
|
||||||
{# set context='workspace' #}
|
{# set context='workspace' #}
|
||||||
{% set context='global' %}
|
{% set context=navigationContext() %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
9
templates/base_workspace.html.to
Normal file
9
templates/base_workspace.html.to
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{% extends "base.html.to" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% include 'navigation/workspace_navigation.html.to' %}
|
||||||
|
|
||||||
|
{% block workspace_content %}{% end %}
|
||||||
|
|
||||||
|
{% end %}
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<div class="topbar__context topbar__context--{{context}}">
|
<div class="topbar__context topbar__context--{{context}}">
|
||||||
<a href="/" class="topbar__link">
|
<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') %}
|
{% module Icon('caret_down', classes='topbar__link-icon icon--tiny') %}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
1
templates/navigation/workspace_navigation.html.to
Normal file
1
templates/navigation/workspace_navigation.html.to
Normal file
@ -0,0 +1 @@
|
|||||||
|
nav
|
@ -1,6 +1,6 @@
|
|||||||
{% extends "base.html.to" %}
|
{% extends "base_workspace.html.to" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block workspace_content %}
|
||||||
|
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class='responsive-table-wrapper'>
|
<div class='responsive-table-wrapper'>
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for w in workspaces %}
|
{% for w in workspaces %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<td scope="row">
|
||||||
<a href="">{{ w['name'] }}</a><br>
|
<a href="/workspaces/{{w['task_order']['number']}}">{{ w['name'] }}</a><br>
|
||||||
Task Order: #{{ w['task_order']['number'] }}
|
Task Order: #{{ w['task_order']['number'] }}
|
||||||
</th>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="usa-label">{{ w['user_count'] }}</span><br>Users
|
<span class="usa-label">{{ w['user_count'] }}</span><br>Users
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user