Skip to content

Commit 0b63114

Browse files
committed
Add hashes download to navbar
1 parent 39b8d83 commit 0b63114

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
0.15 (unreleased)
22
-----------------
33

4+
- An updated hash library will be saved to the results directory when
5+
generating a HTML summary page or when the `--mpl-results-always` flag is
6+
set. A button to download this file is included in the HTML summary.
7+
Various bugfixes, test improvements and documentation updates. [#138]
48

59
0.14 (2022-02-09)
610
-----------------

pytest_mpl/summary/templates/filter.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,5 @@ <h5>Show tests which have...</h5>
6262
</div>
6363
</div>
6464
</form>
65-
{% if hash_library -%}
66-
<hr>
67-
<a download="{{ hash_library }}" href="{{ hash_library }}" class="btn btn-light"
68-
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true"
69-
title="<pre>{{ hash_library }}</pre>"
70-
role="button">Download generated hash library</a>
71-
{%- endif %}
7265
</div>
7366
</div>

pytest_mpl/summary/templates/navbar.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99
<input class="form-control me-2 search" type="search" onblur="searchComplete()" placeholder="Search"
1010
aria-label="Search">
1111
</form>
12+
{% if hash_library -%}
13+
<a download="{{ hash_library }}" href="{{ hash_library }}" class="btn btn-outline-secondary me-2"
14+
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true"
15+
title="Download generated <pre>{{ hash_library }}</pre>"
16+
role="button">
17+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-hash"
18+
viewBox="0 0 16 16">
19+
<path d="M8.39 12.648a1.32 1.32 0 0 0-.015.18c0 .305.21.508.5.508.266 0 .492-.172.555-.477l.554-2.703h1.204c.421 0 .617-.234.617-.547 0-.312-.188-.53-.617-.53h-.985l.516-2.524h1.265c.43 0 .618-.227.618-.547 0-.313-.188-.524-.618-.524h-1.046l.476-2.304a1.06 1.06 0 0 0 .016-.164.51.51 0 0 0-.516-.516.54.54 0 0 0-.539.43l-.523 2.554H7.617l.477-2.304c.008-.04.015-.118.015-.164a.512.512 0 0 0-.523-.516.539.539 0 0 0-.531.43L6.53 5.484H5.414c-.43 0-.617.22-.617.532 0 .312.187.539.617.539h.906l-.515 2.523H4.609c-.421 0-.609.219-.609.531 0 .313.188.547.61.547h.976l-.516 2.492c-.008.04-.015.125-.015.18 0 .305.21.508.5.508.265 0 .492-.172.554-.477l.555-2.703h2.242l-.515 2.492zm-1-6.109h2.266l-.515 2.563H6.859l.532-2.563z"/>
20+
</svg>
21+
</a>
22+
{%- endif %}
1223
<button class="btn btn-outline-primary" aria-label="Filter" type="button" data-bs-toggle="offcanvas"
1324
data-bs-target="#offcanvasFilter" aria-controls="offcanvasFilter">
1425
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-funnel"

pytest_mpl/summary/templates/styles.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
.nav-filtertools .nav-searchbar {
1212
flex: 10;
1313
}
14+
.nav-filtertools svg {
15+
vertical-align: text-bottom;
16+
}
1417
#filterForm .spacer {
1518
flex: 1;
1619
}

0 commit comments

Comments
 (0)