-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Side-by-side comparison of components (#1620)
* created checkbox and form for submitting components for comparison. created rough start for displaying differences between prime component and rest * for now just implementing two comparison * click to read full text after 50 chars * styling and added Control part * displaying comparisons for x number of component statements against the prime component. Styling and abstracted out the comparison block into an included template * check for pid * removing detail/summary not really necessary * Condense comparison listings into rows of a single table Co-authored-by: Greg Elin <Greg Elin>
- Loading branch information
Showing
5 changed files
with
174 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="col-xs-12 col-sm-12 col-lg-12 "> | ||
<h2 class="sub-header">Compared components</h2> | ||
<div class="table-responsive"> | ||
<table class="table table-striped table-bordered"> | ||
<thead class="thead-dark"> | ||
<tr> | ||
<th scope="col">Component</th> | ||
<th scope="col">Control</th> | ||
<th scope="col">Catalog</th> | ||
<th scope="col">Statement</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for cmp_name, smt, diff in comp_differences %} | ||
<tr> | ||
<td scope="row" style="width: 110px;"><b>{{ cmp_name }}</b></td> | ||
<td style="width: 90px;">{{ smt.sid }}{% if smt.pid %}.{{ smt.pid }}{% endif %}</td> | ||
<td style="width: 190px;">{{ smt.sid_class }}</td> | ||
<td><a href="#diff_{{ forloop.counter }}" class="" data-toggle="collapse" style="text-decoration: none;font-weight: normal; font-size: 9pt; color: black;">{{ diff|safe }}</a></td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{% extends "base.html" %} | ||
{% load humanize %} | ||
{% load static %} | ||
|
||
{% block title %} | ||
{{ portfolio.title }} Components Selected | ||
{% endblock %} | ||
|
||
{% block head %} | ||
{% include "controls/_style-controls.html" %} | ||
<style> | ||
.float-container { | ||
border: 3px solid #fff; | ||
padding: 20px; | ||
} | ||
|
||
.float-child { | ||
width: 100%; | ||
float: left; | ||
padding: 20px; | ||
border: 2px solid slategray; | ||
} | ||
|
||
</style> | ||
|
||
{% endblock %} | ||
|
||
{% block contextbar %}{% endblock %} | ||
|
||
{% block body %} | ||
|
||
<div class="float-container"> | ||
|
||
<div class="float-child"> | ||
<h1>Component comparison</h1> | ||
<div class="col-xs-12 col-sm-12 col-lg-12"> | ||
<h2 class="sub-header">{{ compare_prime.name }}</h2> | ||
<div class="table-responsive"> | ||
<table class="table table-striped table-bordered"> | ||
<thead class="thead-dark"> | ||
<tr> | ||
<th scope="col">Component</th> | ||
<th scope="col">Control</th> | ||
<th scope="col">Catalog</th> | ||
<th scope="col">Statement</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for prime_smt in prime_smts %} | ||
<tr> | ||
<td scope="row" style="width: 110px;"><b>{{ compare_prime.name }}</b></td> | ||
<td scope="row" style="width: 90px;">{{ prime_smt.sid }}{% if prime_smt.pid %}.{{ prime_smt.pid }}{% endif %}</th> | ||
<td style="width: 190px;">{{ prime_smt.sid_class }}</td> | ||
<td>{{ prime_smt.body|safe }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="float-child"> | ||
{% with comp_differences=differences %} | ||
{% include "components/compare_block.html" %} | ||
{% endwith %} | ||
</div> | ||
|
||
</div> | ||
|
||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters