Display Empty State component on workspace project
Adjust button and message depending on user permissions
This commit is contained in:
parent
2c5bad75a5
commit
0dd350112c
@ -1,10 +1,29 @@
|
|||||||
{% from "components/icon.html" import Icon %}
|
{% from "components/icon.html" import Icon %}
|
||||||
{% from "components/alert.html" import Alert %}
|
{% from "components/alert.html" import Alert %}
|
||||||
|
{% from "components/empty_state.html" import EmptyState %}
|
||||||
|
|
||||||
{% extends "base_workspace.html" %}
|
{% extends "base_workspace.html" %}
|
||||||
|
|
||||||
|
|
||||||
{% block workspace_content %}
|
{% block workspace_content %}
|
||||||
|
|
||||||
|
{% if not workspace.projects %}
|
||||||
|
|
||||||
|
{% set can_create_projects = user_can(permissions.ADD_APPLICATION_IN_WORKSPACE) %}
|
||||||
|
{% set sub_message = None if can_create_projects else 'Please contact your workspace administrator to set up a new project.' %}
|
||||||
|
{% set action_label = 'Add a New Project' if can_create_projects else None %}
|
||||||
|
{% set action_href = url_for('workspaces.new_project', workspace_id=workspace.id) if can_create_projects else None %}
|
||||||
|
|
||||||
|
{{ EmptyState(
|
||||||
|
'This workspace doesn’t have any projects yet.',
|
||||||
|
action_label=action_label,
|
||||||
|
action_href=action_href,
|
||||||
|
icon='cloud',
|
||||||
|
sub_message=sub_message
|
||||||
|
) }}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
{% for project in workspace.projects %}
|
{% for project in workspace.projects %}
|
||||||
<div class='block-list project-list-item'>
|
<div class='block-list project-list-item'>
|
||||||
<header class='block-list__header'>
|
<header class='block-list__header'>
|
||||||
@ -32,5 +51,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user