From 2e644061dccfa1847c9ce0fd93a19e941cacd878 Mon Sep 17 00:00:00 2001 From: skibidipakpak Date: Fri, 16 Apr 2021 18:58:05 +0200 Subject: [PATCH] Update bookmark plugin to make it work with v4.0.dev121 --- plugins/plugins/bookmarks/plugins/bookmark.py | 2 +- .../web.templates.plugins/bookmarks.html | 70 +++++++++++++++++-- 2 files changed, 65 insertions(+), 7 deletions(-) diff --git a/plugins/plugins/bookmarks/plugins/bookmark.py b/plugins/plugins/bookmarks/plugins/bookmark.py index 5dfc768..0359a60 100644 --- a/plugins/plugins/bookmarks/plugins/bookmark.py +++ b/plugins/plugins/bookmarks/plugins/bookmark.py @@ -26,7 +26,7 @@ def __init__(self): self.collectionName = "user_bookmarks" def getPage(self, **args): - cvesp = cves.last(rankinglookup=True, namelookup=True, via4lookup=True, capeclookup=True,subscorelookup=True) + cvesp = cves.CveHandler(rankinglookup=True, namelookup=True, via4lookup=True, capeclookup=True,subscorelookup=True) data = db.p_queryOne(self.collectionName, {"user": args["current_user"].get_id()}) bookmarks = data.get("bookmarks", []) if data else [] cve=[cvesp.getcve(cveid=x) for x in bookmarks] diff --git a/plugins/plugins/bookmarks/web.templates.plugins/bookmarks.html b/plugins/plugins/bookmarks/web.templates.plugins/bookmarks.html index 8beb7e0..3f3c258 100644 --- a/plugins/plugins/bookmarks/web.templates.plugins/bookmarks.html +++ b/plugins/plugins/bookmarks/web.templates.plugins/bookmarks.html @@ -1,10 +1,68 @@ -{% extends 'layouts/master-page' %} +{% extends 'layouts/master-page.html' %} {% block title %}Bookmarked CVEs{% endblock %} {% block content %} - + - {% include 'subpages/table.html' %} + Home +  >  + Bookmarks + + + + + + + + + + + + + + + {% for c in cve %} + {% if 'whitelisted' in c %}{%set class="whitelisted"%}{% elif 'blacklisted' in c %}{%set class="blacklisted"%} + {% else %}{%set class=""%}{% endif %} + + + + + + + + + + {% endfor %} + +
IDCVSSCVSS3SummaryLast (major) updatePublished
+ {% if 'icon' in c %} + + {% else %} + {% if 'whitelisted' in c %} + + {% elif 'blacklisted' in c %} + + {% endif %} + {% endif %} + + {{ c['id'] }} + {% if 'reason' in c %} +
{{c['reason']}} + {% endif %} +
+ {{ c['cvss'] }} + + {{ c['cvss3'] }} + +
+ {{ c['summary'][:250] }} +
+
+ {{ c['Modified'].strftime('%d-%m-%Y - %H:%M') }} + + {{ c['Published'].strftime('%d-%m-%Y - %H:%M') }} +
+ Back to Top + Mark selected {% endblock %} +