snapshots: xml diff, use gadjo to collapse lines between changes (#89445)
gitea/wcs/pipeline/head This commit looks good Details

This commit is contained in:
Lauréline Guérin 2024-04-11 16:07:28 +02:00 committed by Lauréline Guérin
parent 63880dddd4
commit d43865b2a5
3 changed files with 4 additions and 72 deletions

View File

@ -145,6 +145,8 @@ class SnapshotsDirectory(Directory):
'snapshot2': snapshot2,
}
)
get_response().add_javascript(['gadjo.snapshotdiff.js'])
get_response().add_css_include('gadjo.snapshotdiff.css')
return template.QommonTemplateResponse(
templates=['wcs/backoffice/snapshots_compare.html'],
context=context,

View File

@ -1018,7 +1018,7 @@ ul#fields-filter li {
}
}
div.object--status-infos, p.snapshot-description {
div.object--status-infos {
font-size: 80%;
margin: 0;
}
@ -2584,76 +2584,6 @@ p.snapshots-navigation {
text-align: center;
}
div.diff {
margin: 1em 0;
}
table.diff {
background: white;
border: 1px solid #f3f3f3;
border-collapse: collapse;
width: 100%;
colgroup, thead, tbody, td {
border: 1px solid #f3f3f3;
}
tbody tr:nth-child(even) {
background: #fdfdfd;
}
th, td {
max-width: 30vw;
/* it will not actually limit width as the table is set to
* expand to 100% but it will prevent one side getting wider
*/
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
}
.diff_header {
background: #f7f7f7;
}
td.diff_header {
text-align: right;
padding-right: 10px;
color: #606060;
}
.diff_next {
display: none;
}
.diff_add {
background-color: #aaffaa;
}
.diff_chg {
background-color: #ffff77;
}
.diff_sub {
background-color: #ffaaaa;
}
}
ins {
text-decoration: none;
background-color: #d4fcbc;
}
del {
text-decoration: line-through;
background-color: #fbb6c2;
color: #555;
}
.inspect-tabs h3 {
del, ins {
font-weight: bold;
background-color: transparent;
}
del, del a {
color: #fbb6c2 !important;
}
ins, ins a {
color: #d4fcbc !important;
}
}
#sidebar .operator-and-value-widget {
.title-and-operator {
display: flex;

View File

@ -11,7 +11,7 @@
{% block content %}
<p class="snapshot-description">{{ fromdesc|safe }} ➔ {{ todesc|safe }}</p>
<div class="diff">
<div class="snapshot-diff">
{% if mode == 'xml' %}
{{ diff_serialization|safe }}
{% else %}