commit
98f8593c4c
@ -1,14 +1,19 @@
|
|||||||
import ToggleMixin from '../mixins/toggle'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'toggler',
|
name: 'toggler',
|
||||||
|
|
||||||
mixins: [ToggleMixin],
|
data: function() {
|
||||||
|
return {
|
||||||
|
selectedSection: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
props: {
|
methods: {
|
||||||
defaultVisible: {
|
toggleSection: function(sectionName) {
|
||||||
type: Boolean,
|
if (this.selectedSection === sectionName) {
|
||||||
default: () => false,
|
this.selectedSection = null
|
||||||
|
} else {
|
||||||
|
this.selectedSection = sectionName
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.accordion-table__item-content {
|
.accordion-table__item-content {
|
||||||
padding-top: $gap*3;
|
padding-top: $gap*2;
|
||||||
padding-right: $gap;
|
padding-right: $gap;
|
||||||
padding-bottom: $gap*3;
|
padding-bottom: $gap*2;
|
||||||
padding-left: $gap*3;
|
padding-left: $gap*2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.accordion-table__items {
|
.accordion-table__items {
|
||||||
@ -69,7 +69,6 @@
|
|||||||
float: right;
|
float: right;
|
||||||
color: $color-blue;
|
color: $color-blue;
|
||||||
padding: $gap;
|
padding: $gap;
|
||||||
margin: -$gap 0;
|
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
@include icon-size(12);
|
@include icon-size(12);
|
||||||
|
@ -1,45 +1,16 @@
|
|||||||
{% from "components/icon.html" import Icon %}
|
{% macro ToggleButton(action, open_html, close_html, section_name) %}
|
||||||
|
<span v-on:click="toggleSection('{{ section_name }}')">
|
||||||
{% macro ToggleItem(action, item_type, length, icon) %}
|
<div v-if="selectedSection === '{{ section_name }}'">
|
||||||
<span
|
{{ close_html }}
|
||||||
v-on:click="props.toggle"
|
</div>
|
||||||
class="icon-link icon-link--large accordion-table__item__toggler">
|
<div v-else>
|
||||||
{{ action }} {{ item_type }} ({{ length }}){{ Icon(icon) }}
|
{{ open_html }}
|
||||||
|
</div>
|
||||||
</span>
|
</span>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro ToggleList(item_name, item_type, length) %}
|
{% macro ToggleSection(section_name) %}
|
||||||
<li is="toggler" class="accordion-table__item">
|
<div v-show="selectedSection === '{{ section_name }}'">
|
||||||
<template slot-scope="props">
|
|
||||||
<div class="accordion-table__item-content">
|
|
||||||
<span v-on:click="props.toggle">
|
|
||||||
{{ item_name }}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<template v-if="props.isVisible">
|
|
||||||
{{
|
|
||||||
ToggleItem(
|
|
||||||
("common.hide" | translate),
|
|
||||||
item_type,
|
|
||||||
length,
|
|
||||||
"caret_up",
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
{{
|
|
||||||
ToggleItem(
|
|
||||||
("common.show" | translate),
|
|
||||||
item_type,
|
|
||||||
length,
|
|
||||||
"caret_down",
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<div v-show="props.isVisible">
|
|
||||||
{{ caller() }}
|
{{ caller() }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
</li>
|
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{% from "components/icon.html" import Icon %}
|
{% from "components/icon.html" import Icon %}
|
||||||
{% from "components/toggle_list.html" import ToggleList %}
|
{% from "components/toggle_list.html" import ToggleButton, ToggleSection %}
|
||||||
|
|
||||||
<div class="application-list-item">
|
<div class="application-list-item">
|
||||||
<header>
|
<header>
|
||||||
@ -22,7 +22,45 @@
|
|||||||
|
|
||||||
<ul class="accordion-table__items">
|
<ul class="accordion-table__items">
|
||||||
{% for name, members_list in environments_obj.items() %}
|
{% for name, members_list in environments_obj.items() %}
|
||||||
{% call ToggleList(item_name=name, item_type="Members", length=(members_list|length)) %}
|
<toggler inline-template>
|
||||||
|
<li class="accordion-table__item">
|
||||||
|
<div class="accordion-table__item-content">
|
||||||
|
<span>
|
||||||
|
{{ name }}
|
||||||
|
</span>
|
||||||
|
<span class="icon-link">
|
||||||
|
{% set edit_environment_button %}
|
||||||
|
{{ Icon('edit') }}
|
||||||
|
{% endset %}
|
||||||
|
|
||||||
|
{{
|
||||||
|
ToggleButton(
|
||||||
|
open_html=edit_environment_button,
|
||||||
|
close_html=edit_environment_button,
|
||||||
|
section_name="edit"
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
<span class="icon-link icon-link--large accordion-table__item__toggler">
|
||||||
|
{% set open_environments_button %}
|
||||||
|
{{ "common.show" | translate }} Environments ({{ members_list | length }}) {{ Icon('caret_down') }}
|
||||||
|
{% endset %}
|
||||||
|
|
||||||
|
{% set close_environments_button %}
|
||||||
|
{{ "common.hide" | translate }} Environments ({{ members_list | length }}) {{ Icon('caret_up') }}
|
||||||
|
{% endset %}
|
||||||
|
|
||||||
|
{{
|
||||||
|
ToggleButton(
|
||||||
|
open_html=open_environments_button,
|
||||||
|
close_html=close_environments_button,
|
||||||
|
section_name="environments"
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% call ToggleSection(section_name="environments") %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for member in members_list %}
|
{% for member in members_list %}
|
||||||
<li class="accordion-table__item__expanded">
|
<li class="accordion-table__item__expanded">
|
||||||
@ -32,6 +70,24 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|
||||||
|
{% call ToggleSection(section_name="edit") %}
|
||||||
|
<ul>
|
||||||
|
<li class="accordion-table__item__expanded">
|
||||||
|
<div>
|
||||||
|
<form>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-col form-col--half">
|
||||||
|
Row here
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endcall %}
|
||||||
|
</li>
|
||||||
|
</toggler>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,11 +35,13 @@
|
|||||||
|
|
||||||
<div class='application-list'>
|
<div class='application-list'>
|
||||||
{% for application in portfolio.applications|sort(attribute='name') %}
|
{% for application in portfolio.applications|sort(attribute='name') %}
|
||||||
<div is='toggler' v-cloak class='accordion application-list-item'>
|
{% set section_name = "application-{}".format(application.id) %}
|
||||||
<template slot-scope='props'>
|
|
||||||
|
<toggler inline-template>
|
||||||
|
<div class='accordion application-list-item'>
|
||||||
<header class='accordion__header row'>
|
<header class='accordion__header row'>
|
||||||
<div class='col col-grow'>
|
<div class='col col-grow'>
|
||||||
<h3 class='icon-link accordion__title' v-on:click="props.toggle">{{ application.name }}</h3>
|
<h3 class='icon-link accordion__title' v-on:click="toggleSection('{{ section_name }}')">{{ application.name }}</h3>
|
||||||
<span class='accordion__description'>{{ application.description }}</span>
|
<span class='accordion__description'>{{ application.description }}</span>
|
||||||
<div class='accordion__actions'>
|
<div class='accordion__actions'>
|
||||||
{% if user_can(permissions.VIEW_APPLICATION) %}
|
{% if user_can(permissions.VIEW_APPLICATION) %}
|
||||||
@ -59,17 +61,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='col'>
|
<div class='col'>
|
||||||
<span v-on:click="props.toggle" class='icon-link toggle-link'>
|
<span class='icon-link toggle-link' v-on:click="toggleSection('{{ section_name }}')">
|
||||||
<template v-if="props.isVisible">
|
<span v-if="selectedSection === '{{ section_name }}'">
|
||||||
{{ Icon('minus') }}
|
{{ Icon('minus') }}
|
||||||
</template>
|
</span>
|
||||||
<template v-else>
|
<span v-else>
|
||||||
{{ Icon('plus') }}
|
{{ Icon('plus') }}
|
||||||
</template>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<ul v-if="props.isVisible">
|
<ul v-show="selectedSection === '{{ section_name }}'">
|
||||||
{% for environment in application.environments %}
|
{% for environment in application.environments %}
|
||||||
<li class='accordion__item application-list-item__environment'>
|
<li class='accordion__item application-list-item__environment'>
|
||||||
<div class='application-list-item__environment__name'>
|
<div class='application-list-item__environment__name'>
|
||||||
@ -83,8 +85,8 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
|
</toggler>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% from "components/empty_state.html" import EmptyState %}
|
{% from "components/empty_state.html" import EmptyState %}
|
||||||
{% from "components/icon.html" import Icon %}
|
{% from "components/icon.html" import Icon %}
|
||||||
{% from "components/toggle_list.html" import ToggleList %}
|
{% from "components/toggle_list.html" import ToggleButton, ToggleSection %}
|
||||||
|
|
||||||
{% set secondary_breadcrumb = 'portfolios.applications.team_settings.title' | translate({ "application_name": application.name }) %}
|
{% set secondary_breadcrumb = 'portfolios.applications.team_settings.title' | translate({ "application_name": application.name }) %}
|
||||||
|
|
||||||
@ -67,22 +67,39 @@
|
|||||||
{% set user_info = environment_users[user.id] %}
|
{% set user_info = environment_users[user.id] %}
|
||||||
{% set user_permissions = user_info["permissions"] %}
|
{% set user_permissions = user_info["permissions"] %}
|
||||||
|
|
||||||
{% set user_row %}
|
|
||||||
|
<toggler inline-template>
|
||||||
|
<li class="accordion-table__item">
|
||||||
|
<div class="accordion-table__item-content">
|
||||||
|
<span>
|
||||||
|
{{ name }}
|
||||||
<span>{{ user.full_name }}</span>
|
<span>{{ user.full_name }}</span>
|
||||||
<span>{{ user_permissions["delete_access"] }}</span>
|
<span>{{ user_permissions["delete_access"] }}</span>
|
||||||
<span>{{ user_permissions["environment_management"] }}</span>
|
<span>{{ user_permissions["environment_management"] }}</span>
|
||||||
<span>{{ user_permissions["team_management"] }}</span>
|
<span>{{ user_permissions["team_management"] }}</span>
|
||||||
|
</span>
|
||||||
|
<span class="icon-link icon-link--large accordion-table__item__toggler">
|
||||||
|
{% set open_html %}
|
||||||
|
{{ "common.show" | translate }} {{ "portfolios.applications.team_settings.environments" | translate }} ({{ user_info['environments'] | length }})
|
||||||
{% endset %}
|
{% endset %}
|
||||||
|
|
||||||
{% call ToggleList(
|
{% set close_html %}
|
||||||
item_name=user_row,
|
{{ "common.hide" | translate }} {{ "portfolios.applications.team_settings.environments" | translate }} ({{ user_info['environments'] | length }})
|
||||||
item_type=("portfolios.applications.team_settings.environments" | translate),
|
{% endset %}
|
||||||
length=(user_info["environments"] | length)
|
|
||||||
|
{{
|
||||||
|
ToggleButton(
|
||||||
|
open_html=open_html,
|
||||||
|
close_html=close_html,
|
||||||
|
section_name="environments"
|
||||||
)
|
)
|
||||||
%}
|
}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{% call ToggleSection(section_name="environments") %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for environment in user_info["environments"] %}
|
{% for environment in user_info["environments"] %}
|
||||||
<li class="accordion-table__item__expanded">
|
<li>
|
||||||
<div class="accordion-table__item-content">
|
<div class="accordion-table__item-content">
|
||||||
{{ environment.name }}
|
{{ environment.name }}
|
||||||
</div>
|
</div>
|
||||||
@ -90,6 +107,8 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
</li>
|
||||||
|
</toggler>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user