From 127aed8dd03b51aa992b47f071e201abedf28e1b Mon Sep 17 00:00:00 2001 From: Ben Rog-Wilhelm Date: Fri, 11 Nov 2022 16:13:55 -0600 Subject: [PATCH] Fix: Usernotes no longer actually work. --- files/assets/css/TheMotte.css | 6 +----- files/classes/user.py | 10 ++++++++++ files/templates/submission.html | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/files/assets/css/TheMotte.css b/files/assets/css/TheMotte.css index 9054ebdb5..afad55ffa 100644 --- a/files/assets/css/TheMotte.css +++ b/files/assets/css/TheMotte.css @@ -217,15 +217,11 @@ a.visited, .usernote-link { color: var(--primary); - text-decoration: none; + text-decoration: underline; background-color: transparent; cursor: pointer; } -.usernote-link:hover { - text-decoration: underline; -} - .modal__overlay { position: fixed; top: 0; diff --git a/files/classes/user.py b/files/classes/user.py index a3d3678b1..fe70140b2 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -542,6 +542,16 @@ class User(Base): return data + @lazy + def json_notes(self, v): + data = {'username': self.username, + 'url': self.url, + 'id': self.id, + 'notes': [x.json() for x in self.notes] + } + + return data + @property @lazy def json_raw(self): diff --git a/files/templates/submission.html b/files/templates/submission.html index 9d15e66ad..fdaec48a2 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -189,7 +189,7 @@ _U_ + onclick='fillnote( {{p.author.json_notes(v) | tojson}}, {{p.id}}, null )'>U {% endif %} {% endif %}