Merge pull request #197 from dod-ccpo/workspaces2
Create workspaces and projects
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
subnav=[
|
||||
{
|
||||
"label": "Add New Project",
|
||||
"href":"/",
|
||||
"active": g.matchesPath('workspaces/projects/new'),
|
||||
"href": url_for('workspaces.new_project', workspace_id=workspace.id),
|
||||
"active": g.matchesPath('\/workspaces\/[A-Za-z0-9-]*\/projects'),
|
||||
"icon": "plus"
|
||||
}
|
||||
]
|
||||
|
@@ -88,7 +88,7 @@
|
||||
<footer class='block-list__footer'>
|
||||
<a href='/' class='icon-link'>
|
||||
{% module Icon('plus') %}
|
||||
<span>Add another environment</span>
|
||||
<span class="icon-link">Add another environment</span>
|
||||
</a>
|
||||
</footer>
|
||||
</section>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% block workspace_content %}
|
||||
|
||||
{% if not members %}
|
||||
{% if not workspace.members %}
|
||||
|
||||
{{ EmptyState(
|
||||
'There are currently no members in this Workspace.',
|
||||
@@ -58,7 +58,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for m in members %}
|
||||
{% for m in workspace.members %}
|
||||
<tr>
|
||||
<td><a href="/workspaces/123456/members/789/edit" class="icon-link icon-link--large">{{ m['first_name'] }} {{ m['last_name'] }}</a></td>
|
||||
<td class='table-cell--shrink'>{% if m['num_projects'] == '0' %} <span class="label label--info">No Project Access</span> {% endif %}</td>
|
||||
|
59
templates/workspace_project_new.html
Normal file
59
templates/workspace_project_new.html
Normal file
@@ -0,0 +1,59 @@
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/tooltip.html" import Tooltip %}
|
||||
|
||||
{% extends "base_workspace.html" %}
|
||||
|
||||
{% block workspace_content %}
|
||||
<new-project inline-template v-bind:initial-data='{{ form.data|tojson }}'>
|
||||
<form method="POST" action="{{ url_for('workspaces.update_project', workspace_id=workspace.id) }}" >
|
||||
{{ form.csrf_token }}
|
||||
<div class="panel">
|
||||
<div class="panel__heading panel__heading--grow">
|
||||
<h1>Add a new project</h1>
|
||||
{{ Tooltip(
|
||||
"AT-AT allows you to organize your workspace into multiple projects, each of which may have environments.",
|
||||
title="learn more"
|
||||
)}}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel__content">
|
||||
{{ TextInput(form.name) }}
|
||||
{{ TextInput(form.description, paragraph=True) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block-list project-list-item">
|
||||
<header class="block-list__header">
|
||||
<h2 class="block-list__title">Project Environments</h2>
|
||||
{{ Tooltip(
|
||||
"Each environment created within a project is an enclave of cloud resources that is logically separated from each other for increased security.",
|
||||
title="learn more"
|
||||
)}}
|
||||
</header>
|
||||
|
||||
<ul>
|
||||
<li v-for="(_, i) in environments" class="block-list__item">
|
||||
{{ TextInput(form.environment_name) }}
|
||||
<span class="icon-link icon-link--danger icon-link--vertical" v-on:click="removeEnvironment(i)">{{ Icon('x') }} Remove</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="block-list__footer">
|
||||
<a v-on:click="addEnvironment" class="icon-link">Add another environment</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="action-group">
|
||||
<input type="submit" value="Create Project" class="usa-button usa-button-primary">
|
||||
<a href="{{ url_for('workspaces.workspace_projects', workspace_id=workspace.id) }}" class="action-group__action">Cancel</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</new-project>
|
||||
{% endblock %}
|
@@ -1,24 +1,34 @@
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/alert.html" import Alert %}
|
||||
|
||||
{% extends "base_workspace.html" %}
|
||||
|
||||
{% block workspace_content %}
|
||||
|
||||
{% for project in projects %}
|
||||
{% if request.args.get("newWorkspace") %}
|
||||
{{ Alert('Workspace created!',
|
||||
message="\
|
||||
<p>You are now ready to create projects and environments within the JEDI Cloud.</p>
|
||||
",
|
||||
level='success'
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% for project in workspace.projects %}
|
||||
<div class='block-list project-list-item'>
|
||||
<header class='block-list__header'>
|
||||
<h2 class='block-list__title'>{{ project['name'] }} ({{ project['environments']|length }} environments)</h2>
|
||||
<a class='icon-link' href=''>
|
||||
<h2 class='block-list__title'>{{ project.name }} ({{ project.environments|length }} environments)</h2>
|
||||
<a class='icon-link' href='/workspaces/123456/projects/789/edit'>
|
||||
{{ Icon('edit') }}
|
||||
<span>edit</span>
|
||||
</a>
|
||||
</header>
|
||||
<ul>
|
||||
{% for environment in project['environments'] %}
|
||||
{% for environment in project.environments %}
|
||||
<li class='block-list__item project-list-item__environment'>
|
||||
<a href='/' target='_blank' rel='noopener noreferrer' class='project-list-item__environment__link'>
|
||||
{{ Icon('link') }}
|
||||
<span>{{ environment["name"]}}</span>
|
||||
<span>{{ environment.name }}</span>
|
||||
</a>
|
||||
|
||||
<div class='project-list-item__environment__members'>
|
||||
|
@@ -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 %}
|
||||
|
@@ -1,12 +0,0 @@
|
||||
{% extends "base.html.to" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="usa-width-one-whole empty-state">
|
||||
<p>There are currently no JEDI workspaces</p>
|
||||
<a href="" class="usa-button">New Workspace</a>
|
||||
</div>
|
||||
|
||||
|
||||
{% end %}
|
||||
|
Reference in New Issue
Block a user