|
3 | 3 | {% load widget_tweaks %} |
4 | 4 | {% load static %} |
5 | 5 | {% load url_filters %} |
| 6 | +{% load utils %} |
6 | 7 |
|
7 | 8 | {% block title %} |
8 | 9 | VulnerableCode Package Details - {{ package.purl }} |
|
60 | 61 | </span> |
61 | 62 | </td> |
62 | 63 | <td class="two-col-right"> |
63 | | - {{ fixed_package_details.purl.to_string }} |
| 64 | + {{ package.purl }} |
64 | 65 | </td> |
65 | 66 | </tr> |
66 | 67 | {% if package.is_ghost %} |
|
91 | 92 | Next non-vulnerable version |
92 | 93 | </td> |
93 | 94 | <td class="two-col-right"> |
94 | | - {% if fixed_package_details.next_non_vulnerable.version %} |
95 | | - <a href="/packages/v2/{{ fixed_package_details.next_non_vulnerable|url_quote }}?search={{ fixed_package_details.next_non_vulnerable }}" |
96 | | - target="_self">{{ fixed_package_details.next_non_vulnerable.version }}</a> |
| 95 | + {% if next_non_vulnerable.version %} |
| 96 | + <a href="/packages/v2/{{ next_non_vulnerable|url_quote }}?search={{ next_non_vulnerable }}" |
| 97 | + target="_self">{{ next_non_vulnerable.version }}</a> |
97 | 98 | {% else %} |
98 | 99 | <span class="emphasis-vulnerable">None.</span> |
99 | 100 | {% endif %} |
|
104 | 105 | Latest non-vulnerable version |
105 | 106 | </td> |
106 | 107 | <td class="two-col-right"> |
107 | | - {% if fixed_package_details.latest_non_vulnerable.version %} |
108 | | - <a href="/packages/v2/{{ fixed_package_details.latest_non_vulnerable|url_quote }}?search={{ fixed_package_details.latest_non_vulnerable }}" |
109 | | - target="_self">{{ fixed_package_details.latest_non_vulnerable.version }}</a> |
| 108 | + {% if latest_non_vulnerable.version %} |
| 109 | + <a href="/packages/v2/{{ latest_non_vulnerable|url_quote }}?search={{ latest_non_vulnerable }}" |
| 110 | + target="_self">{{ latest_non_vulnerable.version }}</a> |
110 | 111 | {% else %} |
111 | 112 | <span class="emphasis-vulnerable">None.</span> |
112 | 113 | {% endif %} |
|
175 | 176 | {{ advisory.summary }} |
176 | 177 | </td> |
177 | 178 | <td style="word-wrap: break-word; word-break: break-all;"> |
178 | | - {% if package.purl == fixed_package_details.purl.to_string %} |
179 | | - {% for key, value in fixed_package_details.items %} |
180 | | - {% if key == "advisories" %} |
181 | | - {% for vuln in value %} |
182 | | - {% if vuln.advisory.advisory_id == advisory.advisory_id %} |
183 | | - {% if vuln.fixed_by_package_details is None %} |
184 | | - <span class="emphasis-vulnerable">There are no reported fixed by versions.</span> |
185 | | - {% else %} |
186 | | - {% for fixed_pkg in vuln.fixed_by_package_details %} |
187 | | - <section> |
188 | | - {% if fixed_pkg.fixed_by_purl_advisories|length == 0 %} |
189 | | - <a href="/packages/v2/{{ fixed_pkg.fixed_by_purl|url_quote }}?search={{ fixed_pkg.fixed_by_purl }}" |
190 | | - target="_self">{{ fixed_pkg.fixed_by_purl.version }}</a> |
191 | | - <br /> |
192 | | - <span class="emphasis-not-vulnerable">Subject of 0 other advisories.</span> |
193 | | - {% else %} |
194 | | - <a href="/packages/v2/{{ fixed_pkg.fixed_by_purl|url_quote }}?search={{ fixed_pkg.fixed_by_purl }}" |
195 | | - target="_self">{{ fixed_pkg.fixed_by_purl.version }}</a> |
196 | | - {% if fixed_pkg.fixed_by_purl_advisories|length != 1 %} |
197 | | - <br /> |
198 | | - <span class="emphasis-vulnerable">Subject of {{ fixed_pkg.fixed_by_purl_advisories|length }} other |
199 | | - advisory.</span> |
200 | | - {% else %} |
201 | | - <br /> |
202 | | - <span class="emphasis-vulnerable">Subject of {{ fixed_pkg.fixed_by_purl_advisories|length }} other |
203 | | - advisory.</span> |
204 | | - {% endif %} |
205 | | - |
206 | | - <div class="dropdown is-hoverable has-text-weight-normal is-right"> |
207 | | - <div class="dropdown-trigger"> |
208 | | - <i |
209 | | - class="fa fa-question-circle ml-0 fa-sm has-background-white has-text-link"></i> |
210 | | - </div> |
211 | | - <div class="dropdown-menu dropdown-vuln-list-width" id="dropdown-menu4" |
212 | | - role="menu"> |
213 | | - <div class="dropdown-content dropdown-instructions-box-shadow"> |
214 | | - <div class="dropdown-item"> |
215 | | - <div style="max-height: 200px; overflow-y: auto;"> |
216 | | - This version is subject of other advisories: |
217 | | - <div style="padding-top: 5px;"> |
218 | | - {% for fixed_by_vuln in fixed_pkg.fixed_by_purl_advisories %} |
219 | | - <div> |
220 | | - {{fixed_by_vuln.advisory_id }} |
221 | | - </div> |
222 | | - {% endfor %} |
223 | | - </div> |
224 | | - </div> |
225 | | - </div> |
226 | | - </div> |
227 | | - </div> |
228 | | - </div> |
229 | | - {% endif %} |
230 | | - </section> |
231 | | - {% endfor %} |
232 | | - {% endif %} |
233 | | - {% endif %} |
234 | | - {% endfor %} |
235 | | - {% endif %} |
236 | | - {% endfor %} |
237 | | - {% endif %} |
| 179 | + {% with fixed=fixed_package_details|get_item:advisory.id %} |
| 180 | + {% if fixed %} |
| 181 | + {% for item in fixed %} |
| 182 | + <section> |
| 183 | + <a href="/packages/v2/{{ item.pkg.purl|url_quote }}?search={{ item.pkg.purl }}" |
| 184 | + target="_self">{{ item.pkg.version }}</a> |
| 185 | + <br/> |
| 186 | + <span class="{{ item.affected_count|yesno:'emphasis-vulnerable,emphasis-not-vulnerable' }}"> |
| 187 | + Subject of {{ item.affected_count }} other advisories. |
| 188 | + </span> |
| 189 | + </section> |
| 190 | + {% endfor %} |
| 191 | + {% else %} |
| 192 | + <span class="emphasis-vulnerable">There are no reported fixed by versions.</span> |
| 193 | + {% endif %} |
| 194 | + {% endwith %} |
238 | 195 | </td> |
239 | 196 | </tr> |
240 | 197 | {% empty %} |
|
0 commit comments