Add conditional empty state modules to Requests, Workspace Members, and Workspace Projects

This commit is contained in:
Andrew Croce 2018-07-30 16:10:28 -04:00
parent a7f49d1299
commit d9d638ab3b
3 changed files with 163 additions and 144 deletions

View File

@ -1,5 +1,9 @@
{% extends "base.html.to" %}
{% block template_vars %}
{% set requestsEmpty = False %}
{% end %}
{% block modal %}
{% if modalOpen() %}
{% apply modal %}
@ -31,12 +35,22 @@
{% block content %}
{% if requestsEmpty %}
{% module Alert('Pending Financial Verification',
{% module EmptyState(
'There are currently no active requests for you to see.',
actionLabel='Create a new JEDI Cloud Request',
actionHref='/requests/new',
icon='document'
)%}
{% else %}
{% module Alert('Pending Financial Verification',
message="<p>Your next step is to create a Task Order (T.O.) associated with JEDI Cloud. Please consult a Contracting Officer (KO) or Contracting Officer Representative (COR) to help with this step.</p>"
) %}
) %}
<div class="col col--grow">
<div class="col col--grow">
<form class='search-bar'>
<div class='usa-input search-input'>
@ -91,7 +105,9 @@
</tbody>
</table>
</div>
</div>
</div>
{% end %}
{% end %}

View File

@ -1,9 +1,24 @@
{% extends "base_workspace.html.to" %}
{% block template_vars %}
{% set membersEmpty = False %}
{% end %}
{% block workspace_content %}
{% if membersEmpty %}
<form class='search-bar'>
{% module EmptyState(
'There are currently no members in this Workspace.',
actionLabel='Invite a new Member',
actionHref='/members/new',
icon='avatar'
)%}
{% else %}
<form class='search-bar'>
<div class='usa-input search-input'>
<label for='members-search'>Search members by name</label>
<input type='search' id='members-search' name='members-search' placeholder="Search by name"/>
@ -31,40 +46,10 @@
<option value="">Developer</option>
</select>
</div>
</form>
{# <div class='panel panel__actions'>
<div class='row'>
<div class='col col--grow col--pad'>
<form class="usa-search usa-search-small">
<label class="usa-sr-only" for="search-field-small">Search small</label>
<input id="search-field-small" type="search" name="search" placeholder="Search by name">
<button type="submit">
<span class="usa-sr-only">Search</span>
</button>
</form>
</div>
<div class='col col--grow col--pad'>
<select id="filter_status" name="filter_status" required="">
<option value="" selected disabled>Filter by status</option>
<option value="">Active</option>
<option value="">Pending</option>
<option value="">Denied</option>
</select>
</div>
<div class='col col--grow col--pad'>
<select id="filter_role" name="filter_role" required="">
<option value="" selected disabled>Filter by role</option>
<option value="">Admin</option>
<option value="">CCPO</option>
<option value="">Developer</option>
</select>
</div>
</div>
</div> #}
<div class='responsive-table-wrapper'>
<div class='responsive-table-wrapper'>
<table>
<thead>
<tr>
@ -85,8 +70,9 @@
{% end %}
</tbody>
</table>
</div>
</div>
{% end %}
{% end %}

View File

@ -1,8 +1,23 @@
{% extends "base_workspace.html.to" %}
{% block template_vars %}
{% set projectsEmpty = False %}
{% end %}
{% block workspace_content %}
{% for project in projects %}
{% if projectsEmpty %}
{% module EmptyState(
'There are currently no projects set up for this Workspace.',
actionLabel='Create a new Project',
actionHref='/project/new',
icon='cloud'
)%}
{% else %}
{% for project in projects %}
<div class='block-list project-list-item'>
<header class='block-list__header'>
<h2 class='block-list__title'>{{ project['name'] }} ({{ len(project['environments'])}} environments)</h2>
@ -27,6 +42,8 @@
{% end %}
</ul>
</div>
{% end %}
{% end %}
{% end %}