workspace -> portfolio everywhere

This commit is contained in:
dandds
2019-01-11 09:58:00 -05:00
parent 3fc323d785
commit d3d36822df
122 changed files with 2156 additions and 2129 deletions

View File

@@ -0,0 +1,36 @@
{% extends "portfolios/base.html" %}
{% from "components/text_input.html" import TextInput %}
{% block portfolio_content %}
<form method="POST" action="{{ url_for('portfolios.edit_application', portfolio_id=portfolio.id, application_id=application.id) }}">
{% include "fragments/edit_application_form.html" %}
<div class="block-list application-list-item">
<header class="block-list__header block-list__header--grow">
<h2 class="block-list__title">Application Environments</h2>
<p>
Each environment created within an application is an enclave of cloud resources that is logically separated from each other for increased security.
</p>
</header>
<ul>
{% for environment in application.environments %}
<li class="block-list__item application-edit__env-list-item">
<div class="usa-input">
<label>Environment Name</label>
<input type="text" value="{{ environment.name }}" readonly />
</div>
</li>
{% endfor %}
</ul>
</div>
<div class="action-group">
<button class="usa-button usa-button-primary" tabindex="0" type="submit">Update Application</button>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,55 @@
{% from "components/icon.html" import Icon %}
{% from "components/empty_state.html" import EmptyState %}
{% extends "portfolios/base.html" %}
{% block portfolio_content %}
{% if not portfolio.applications %}
{% set can_create_applications = user_can(permissions.ADD_APPLICATION_IN_WORKSPACE) %}
{{ EmptyState(
'This portfolio doesnt have any applications yet.',
action_label='Add a New Application' if can_create_applications else None,
action_href=url_for('portfolios.new_application', portfolio_id=portfolio.id) if can_create_applications else None,
icon='cloud',
sub_message=None if can_create_applications else 'Please contact your JEDI Cloud portfolio administrator to set up a new application.'
) }}
{% else %}
{% for application in portfolio.applications %}
<div v-cloak class='block-list application-list-item'>
<header class='block-list__header'>
<h2 class='block-list__title'>{{ application.name }} ({{ application.environments|length }} environments)</h2>
{% if user_can(permissions.RENAME_APPLICATION_IN_WORKSPACE) %}
<a class='icon-link' href='{{ url_for("portfolios.edit_application", portfolio_id=portfolio.id, application_id=application.id) }}'>
{{ Icon('edit') }}
<span>edit</span>
</a>
{% endif %}
</header>
<ul>
{% for environment in application.environments %}
<li class='block-list__item application-list-item__environment'>
<a href='{{ url_for("portfolios.access_environment", portfolio_id=portfolio.id, environment_id=environment.id)}}' target='_blank' rel='noopener noreferrer' class='application-list-item__environment__link'>
{{ Icon('link') }}
<span>{{ environment.name }}</span>
</a>
<div class='application-list-item__environment__members'>
<div class='label'>{{ environment.num_users }}</div>
<span>members</span>
</div>
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,74 @@
{% extends "portfolios/base.html" %}
{% from "components/alert.html" import Alert %}
{% from "components/icon.html" import Icon %}
{% from "components/modal.html" import Modal %}
{% from "components/text_input.html" import TextInput %}
{% block portfolio_content %}
{% set modalName = "newApplicationConfirmation" %}
{% include "fragments/flash.html" %}
<new-application inline-template v-bind:initial-data='{{ form.data|tojson }}' modal-name='{{ modalName }}'>
<form method="POST" action="{{ url_for('portfolios.create_application', portfolio_id=portfolio.id) }}" v-on:submit="handleSubmit">
{% call Modal(name=modalName, dismissable=False) %}
<h1>Create application !{ name }</h1>
<p>
When you click <em>Create Application</em>, the environments
<span v-for="(environment, index) in environments">
<strong>!{environment.name}</strong><template v-if="index < (environments.length - 1)">, </template>
</span>
will be created as individual cloud resource groups under <strong>!{ name }</strong> application.
</p>
<div class='action-group'>
<button autofocus type='submit' class='action-group__action usa-button' tabindex='0'>Create Application</button>
<button type='button' v-on:click="handleCancelSubmit" class='icon-link action-group__action' tabindex='0'>Cancel</button>
</div>
{% endcall %}
{% include "fragments/edit_application_form.html" %}
<div> {# this extra div prevents this bug: https://www.pivotaltracker.com/story/show/160768940 #}
<div v-cloak v-for="title in errors" :key="title">
{{ Alert(message=None, level="error", vue_template=True) }}
</div>
</div>
<div class="block-list application-list-item">
<header class="block-list__header block-list__header--grow">
<h2 class="block-list__title">Application Environments</h2>
<p>
Each environment created within an application is an enclave of cloud resources that is logically separated from each other for increased security.
</p>
</header>
<ul>
<li v-for="(environment, i) in environments" class="block-list__item application-edit__env-list-item">
<div class="usa-input">
<label :for="'environment_names-' + i">Environment Name</label>
<input type="text" :id="'environment_names-' + i" v-model="environment.name" placeholder="e.g. Development, Staging, Production"/>
<input type="hidden" :name="'environment_names-' + i" v-model="environment.name"/>
</div>
<button v-on:click="removeEnvironment(i)" v-if="environments.length > 1" type="button" class='application-edit__env-list-item__remover'>
{{ Icon('trash') }}
<span>Remove</span>
</button>
</li>
</ul>
<div class="block-list__footer">
<button v-on:click="addEnvironment" class="icon-link" tabindex="0" type="button">Add another environment</button>
</div>
</div>
<div class="action-group">
<button class="usa-button usa-button-primary" tabindex="0" type="submit">Create Application</button>
</div>
</form>
</new-application>
{% endblock %}