Skip to content

Commit 4ec2d93

Browse files
committed
Add prominent displays of search/resource to search results/details templates
Signed-off-by: John M. Horan <[email protected]>
1 parent fbb895a commit 4ec2d93

File tree

5 files changed

+104
-28
lines changed

5 files changed

+104
-28
lines changed

vulnerabilities/templates/package_update.html

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,19 @@
7373
<section class="section pt-0">
7474
<div class="details-container">
7575
<article class="panel is-info panel-header-only">
76-
<p class="panel-heading py-2 is-size-6">
77-
Package details
78-
</p>
76+
<div class="panel-heading py-2 is-size-6">
77+
<div class="field is-grouped is-grouped-multiline">
78+
Package details:
79+
<div class="control">
80+
<div class="tags has-addons">
81+
<span class="tag is-black custom">purl</span>
82+
<span class="tag is-white custom">
83+
{{ package.package_url }}
84+
</span>
85+
</div>
86+
</div>
87+
</div>
88+
</div>
7989
</article>
8090

8191
<div class="tabs is-boxed" id="tabs">
@@ -129,9 +139,9 @@
129139
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
130140
<thead>
131141
<tr>
132-
<th style="width: 200px;">Vulnerability</th>
142+
<th style="width: 175px;">Vulnerability</th>
133143
<th>Summary</th>
134-
<th style="width: 200px;">Aliases</th>
144+
<th style="width: 225px;">Aliases</th>
135145
</tr>
136146
</thead>
137147
<tbody>
@@ -140,15 +150,20 @@
140150
{% for vuln in impacted_vuln %}
141151
<tr>
142152
<td>
143-
<a href="{% url 'vulnerability_view' vuln.pk %}" target="_self">{{ vuln.vulnerability_id }}</a>
153+
<a href="{% url 'vulnerability_view' vuln.pk %}?vuln_id={{ vuln.vulnerability_id }}" target="_self">{{ vuln.vulnerability_id }}</a>
144154
</td>
145155
<td>
146156
{{ vuln.summary }}
147157
</td>
148158
<td>
149159
{% for alias in vuln.alias %}
150-
{{ alias }}
151-
<br />
160+
{% if alias.url %}
161+
<a href={{ alias.url }} target="_blank">{{ alias }}<i class="fa fa-external-link fa_link_custom"></i></a>
162+
<br />
163+
{% else %}
164+
{{ alias }}
165+
<br />
166+
{% endif %}
152167
{% endfor %}
153168
</td>
154169
</tr>
@@ -168,25 +183,30 @@
168183
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
169184
<thead>
170185
<tr>
171-
<th style="width: 200px;">Vulnerability</th>
186+
<th style="width: 175px;">Vulnerability</th>
172187
<th>Summary</th>
173-
<th style="width: 200px;">Aliases</th>
188+
<th style="width: 225px;">Aliases</th>
174189
</tr>
175190
</thead>
176191
<tbody>
177192
{% if resolved_vuln %}
178193
{% for vuln in resolved_vuln %}
179194
<tr>
180195
<td>
181-
<a href="{% url 'vulnerability_view' vuln.pk %}" target="_self">{{ vuln.vulnerability_id }}</a>
196+
<a href="{% url 'vulnerability_view' vuln.pk %}?vuln_id={{ vuln.vulnerability_id }}" target="_self">{{ vuln.vulnerability_id }}</a>
182197
</td>
183198
<td>
184199
{{ vuln.summary }}
185200
</td>
186201
<td>
187202
{% for alias in vuln.alias %}
188-
{{ alias }}
189-
<br />
203+
{% if alias.url %}
204+
<a href={{ alias.url }} target="_blank">{{ alias }}<i class="fa fa-external-link fa_link_custom"></i></a>
205+
<br />
206+
{% else %}
207+
{{ alias }}
208+
<br />
209+
{% endif %}
190210
{% endfor %}
191211
</td>
192212
</tr>

vulnerabilities/templates/packages.html

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,39 @@
6767
</div>
6868
</div>
6969
</article>
70-
7170
</section>
7271

7372
{% if package_name %}
74-
7573
<div class="is-max-desktop mb-3">
7674
<section class="mx-5">
7775
<article class="panel is-info panel-header-only">
78-
<p class="panel-heading py-2 is-size-6">
79-
Package search results
80-
</p>
76+
<div class="panel-heading py-2 is-size-6">
77+
<div class="field is-grouped is-grouped-multiline">
78+
Package search results:
79+
<div class="control">
80+
<div class="tags has-addons">
81+
<span class="tag is-dark custom">type</span>
82+
<span class="tag is-white custom">
83+
{% if package_type %}
84+
{{ package_type }}
85+
{% else %}
86+
any
87+
{% endif %}
88+
</span>
89+
</div>
90+
</div>
91+
<div class="control">
92+
<div class="tags has-addons">
93+
<span class="tag is-dark custom">name</span>
94+
<span class="tag is-white custom">
95+
{{ package_name }}
96+
</span>
97+
</div>
98+
</div>
99+
</div>
100+
</div>
81101
</article>
102+
82103
<div class="is-flex" style="justify-content: space-between;">
83104
<div>
84105
<strong>Total records:</strong> {{ packages.paginator.count|intcomma }}

vulnerabilities/templates/vulnerabilities.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,18 @@
7070
<div class="is-max-desktop mb-3">
7171
<section class="mx-5">
7272
<article class="panel is-info panel-header-only">
73-
<p class="panel-heading py-2 is-size-6">
74-
Vulnerability search results
75-
</p>
73+
<div class="panel-heading py-2 is-size-6">
74+
<div class="field is-grouped is-grouped-multiline">
75+
Vulnerability search results:
76+
<div class="control">
77+
<div class="tags">
78+
<span class="tag is-white custom">
79+
{{ vuln_id }}
80+
</span>
81+
</div>
82+
</div>
83+
</div>
84+
</div>
7685
</article>
7786
<div class="is-flex" style="justify-content: space-between;">
7887
<div>

vulnerabilities/templates/vulnerability.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,18 @@
7070
<section class="section pt-0">
7171
<div class="details-container">
7272
<article class="panel is-info panel-header-only">
73-
<p class="panel-heading py-2 is-size-6">
74-
Vulnerability details
75-
</p>
73+
<div class="panel-heading py-2 is-size-6">
74+
<div class="field is-grouped is-grouped-multiline">
75+
Vulnerability details:
76+
<div class="control">
77+
<div class="tags">
78+
<span class="tag is-white custom">
79+
{{ vulnerability.vulnerability_id }}
80+
</span>
81+
</div>
82+
</div>
83+
</div>
84+
</div>
7685
</article>
7786

7887
<div class="tabs is-boxed" id="tabs">
@@ -256,7 +265,7 @@
256265
{% for package in vulnerability.vulnerable_to.all %}
257266
<tr>
258267
<td>
259-
<a href="{% url 'package_view' package.pk %}"> {{ package.package_url }} </a>
268+
<a href="{% url 'package_view' package.pk %}?type={{ package_type }}&name={{ package.package_url }}" target="_self">{{ package.package_url }}</a>
260269
</td>
261270
<td>{{ package.vulnerable_to|length }}</td>
262271
<td>{{ package.resolved_to|length }}</td>
@@ -287,7 +296,7 @@
287296
{% for package in vulnerability.resolved_to.all %}
288297
<tr>
289298
<td>
290-
<a href="{% url 'package_view' package.pk %}"> {{ package.package_url }} </a>
299+
<a href="{% url 'package_view' package.pk %}?type={{ package_type }}&name={{ package.package_url }}" target="_self">{{ package.package_url }}</a>
291300
</td>
292301
<td>{{ package.vulnerable_to|length }}</td>
293302
<td>{{ package.resolved_to|length }}</td>

vulnerablecode/static/css/custom.css

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ code {
9999
background-color: #ffffff;
100100
border: 0;
101101
padding: 0;
102-
/* font-size: 16px; */
103102
font-family: Consolas;
104103
}
105104

@@ -118,7 +117,6 @@ code {
118117
}
119118

120119
#tab-content div {
121-
/* min-height: 300px; */
122120
border-bottom: 0;
123121
margin-bottom: 50px;
124122
padding-bottom: 50px;
@@ -344,4 +342,23 @@ a.small_page_button {
344342
font-size: 10px !important;
345343
vertical-align: super;
346344
margin-left: 2px;
345+
}
346+
347+
.panel-header-tag {
348+
color: #000000;
349+
color: #ffcc00;
350+
color: #ffffff;
351+
background-color: #ffffff;
352+
background-color: #000000;
353+
background-color: #008080;
354+
background-color: #006666;
355+
padding: 0px 7px 2px 7px;
356+
margin-left: 5px;
357+
border-radius: 5px;
358+
line-height: 1;
359+
font-weight: normal;
360+
}
361+
362+
span.tag.custom {
363+
margin: 0px 0px 6px 10px;
347364
}

0 commit comments

Comments
 (0)