WIP: use lists for application environment table
This commit is contained in:
parent
3ce7d18f7a
commit
171898c753
@ -1,6 +1,20 @@
|
|||||||
.accordion-table {
|
.accordion-table {
|
||||||
|
|
||||||
table {
|
&.accordion-table-list {
|
||||||
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion-table__head {
|
||||||
|
padding: 0.8rem 1.6rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: $color-gray;
|
||||||
|
text-transform: uppercase;
|
||||||
|
background-color: $color-gray-lightest;
|
||||||
|
border-bottom: 1px solid $color-gray-lightest;
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
thead th {
|
thead th {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
border-bottom: 1px solid $color-gray-lightest;
|
border-bottom: 1px solid $color-gray-lightest;
|
||||||
@ -63,4 +77,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
27
templates/components/toggle_list.html
Normal file
27
templates/components/toggle_list.html
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{% from "components/icon.html" import Icon %}
|
||||||
|
|
||||||
|
{% macro ToggleList(item_name, item_type, length) %}
|
||||||
|
<li is="toggler">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<span v-on:click="props.toggle">{{ item_name }}</span>
|
||||||
|
|
||||||
|
<template v-if="props.isVisible">
|
||||||
|
<span
|
||||||
|
v-on:click="props.toggle"
|
||||||
|
class='icon-link icon-link--large accordion-table__item__toggler' >
|
||||||
|
Hide {{ item_type }} ({{ length }}){{ Icon('caret_up') }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span
|
||||||
|
v-on:click="props.toggle"
|
||||||
|
class='icon-link icon-link--large accordion-table__item__toggler'>
|
||||||
|
Show {{ item_type }} ({{ length }}){{ Icon('caret_down') }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<div v-show="props.isVisible">
|
||||||
|
{{ caller() }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</li>
|
||||||
|
{% endmacro %}
|
@ -1,4 +1,5 @@
|
|||||||
{% from "components/icon.html" import Icon %}
|
{% from "components/icon.html" import Icon %}
|
||||||
|
{% from "components/toggle_list.html" import ToggleList %}
|
||||||
|
|
||||||
<div class="application-list-item">
|
<div class="application-list-item">
|
||||||
<header>
|
<header>
|
||||||
@ -13,6 +14,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<div class="accordion-table accordion-table-list">
|
||||||
|
<div class="accordion-table__head">
|
||||||
|
<span>{{ "portfolios.applications.environments.name" | translate }}</span>
|
||||||
|
<span class="right">{{ "portfolios.applications.environments.members" | translate }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class='accordion-table__items'>
|
||||||
|
{% for name, members_list in environments_obj.items() %}
|
||||||
|
{% call ToggleList(item_name=name, item_type="Members", length=(members_list|length)) %}
|
||||||
|
{% for member in members_list %}
|
||||||
|
<li>
|
||||||
|
{{ member }}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
{% endcall %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<environments-table
|
<environments-table
|
||||||
v-cloak
|
v-cloak
|
||||||
v-bind:environments='{{ environments_obj }}'
|
v-bind:environments='{{ environments_obj }}'
|
||||||
@ -24,6 +44,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody v-for='(members_list, name) in environments' class='accordion-table__items'>
|
<tbody v-for='(members_list, name) in environments' class='accordion-table__items'>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th scope='rowgroup' v-on:click="toggle($event, name)" v-html='name'></th>
|
<th scope='rowgroup' v-on:click="toggle($event, name)" v-html='name'></th>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user