Skip to content

Commit f9f8985

Browse files
committed
style: separate icons into their own column and set percentage width for each column
1 parent 2c5371d commit f9f8985

2 files changed

Lines changed: 56 additions & 27 deletions

File tree

teamvault/apps/secrets/templates/secrets/secret_revisions.html

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ <h2 class="mb-3">
1111
</h2>
1212
<div class="card">
1313
<div class="card-body table-responsive">
14-
<table class="table table-hover">
14+
<table class="table table-hover table-layout-fixed">
1515
<thead>
1616
<tr>
17-
<th>{% trans "Date" %}</th>
18-
<th>{% trans "Changed by" %}</th>
19-
<th>{% trans "Name" %}</th>
20-
<th>{% trans "Details" %}</th>
21-
<th>{% trans "View" %}</th>
17+
<th id="date">{% trans "Date" %}</th>
18+
<th id="change-type" aria-label="Change type"></th>
19+
<th id="changed-by">{% trans "Changed by" %}</th>
20+
<th id="name">{% trans "Name" %}</th>
21+
<th id="details">{% trans "Details" %}</th>
22+
<th id="view">{% trans "View" %}</th>
2223
</tr>
2324
</thead>
2425
<tbody>
@@ -32,31 +33,36 @@ <h2 class="mb-3">
3233
</span>
3334
</td>
3435
<td>
35-
{% if r.kind == "payload" %}
36-
<span>
36+
<div class="d-flex align-items-center">
37+
{% if r.kind == "payload" %}
38+
<span>
39+
<i class="fa fa-key text-primary ms-1" data-bs-toggle="tooltip"
40+
title="{% trans 'Secret value changed' %}"></i>
41+
</span>
42+
<span class="revision-icon-placeholder"></span>
43+
{% elif r.kind == "restore" %}
44+
<span>
45+
<i class="fa fa-undo text-danger me-1" data-bs-toggle="tooltip"
46+
title="{% trans 'Secret was restored to this version' %}"></i>
47+
</span>
48+
<span class="revision-icon-placeholder"></span>
49+
{% elif r.kind == "meta" %}
50+
<span>
51+
<i class="fa fa-pencil text-muted ms-1" data-bs-toggle="tooltip"
52+
title="{% trans 'Metadata changed' %}"></i>
53+
</span>
54+
<span class="revision-icon-placeholder"></span>
55+
{% elif r.kind == "payload_and_meta" %}
3756
<i class="fa fa-key text-primary ms-1" data-bs-toggle="tooltip"
3857
title="{% trans 'Secret value changed' %}"></i>
39-
</span>
40-
<span class="revision-icon-placeholder"></span>
41-
{% elif r.kind == "restore" %}
42-
<span>
43-
<i class="fa fa-undo text-danger me-1" data-bs-toggle="tooltip"
44-
title="{% trans 'Secret was restored to this version' %}"></i>
45-
</span>
46-
<span class="revision-icon-placeholder"></span>
47-
{% elif r.kind == "meta" %}
48-
<span>
4958
<i class="fa fa-pencil text-muted ms-1" data-bs-toggle="tooltip"
5059
title="{% trans 'Metadata changed' %}"></i>
51-
</span>
52-
<span class="revision-icon-placeholder"></span>
53-
{% elif r.kind == "payload_and_meta" %}
54-
<i class="fa fa-key text-primary ms-1" data-bs-toggle="tooltip"
55-
title="{% trans 'Secret value changed' %}"></i>
56-
<i class="fa fa-pencil text-muted ms-1" data-bs-toggle="tooltip"
57-
title="{% trans 'Metadata changed' %}"></i>
58-
{% endif %}
59-
{{ r.user }}
60+
{% endif %}
61+
</div>
62+
</td>
63+
64+
<td>
65+
<span class="d-block text-truncate" data-bs-toggle="tooltip" title="{{ r.user }}">{{ r.user }}</span>
6066
</td>
6167

6268
<td>

teamvault/static/scss/secrets.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,26 @@ $max_progress: 30s;
177177
display: inline-block;
178178
width: 1.25em;
179179
}
180+
181+
.table-layout-fixed {
182+
table-layout: fixed;
183+
184+
#date {
185+
width: 12%;
186+
}
187+
#change-type {
188+
width: 4%;
189+
}
190+
#changed-by {
191+
width: 15%;
192+
}
193+
#name {
194+
width: 15%;
195+
}
196+
#details {
197+
width: 44%;
198+
}
199+
#view {
200+
width: 10%;
201+
}
202+
}

0 commit comments

Comments
 (0)