From 46105cabdf43df49d7d17496c7487005f1315ac4 Mon Sep 17 00:00:00 2001 From: saturn Date: Sun, 26 Jun 2022 01:56:24 -0500 Subject: [PATCH] Implement two-axis voting, part 1. --- src/data-viewers/comment.lisp | 6 ++++-- src/interface-utils.lisp | 43 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/data-viewers/comment.lisp b/src/data-viewers/comment.lisp index d19c5e45..c1d79152 100644 --- a/src/data-viewers/comment.lisp +++ b/src/data-viewers/comment.lisp @@ -18,6 +18,9 @@ (tag list :backend-type backend-lw2-tags-comments :subfields (:--id :name :slug)) (base-score (or null fixnum)) (af-base-score (or null fixnum)) + (vote-count (or null fixnum)) + (extended-score list) + (all-votes list :subfields (:vote-type :extended-vote-type)) (page-url (or null string) :context-not :user-index) ; page-url sometimes causes "Cannot read property '_id' of undefined" error (parent-comment list :backend-type backend-lw2-tags-comments :context :index :subfields (:--id :user-id :post-id (:tag :--id :name :slug))) (parent-comment list :context :index :subfields (:--id :user-id :post-id)) @@ -25,7 +28,6 @@ (child-count (or null fixnum) :graphql-ignore t) (children list :graphql-ignore t) (af boolean :backend-type backend-alignment-forum) - (vote-count (or null fixnum)) (retracted boolean) (deleted-public boolean) (answer boolean :backend-type backend-q-and-a) @@ -69,7 +71,7 @@ ) (safe pretty-time) (safe (pretty-time-js)) (when replied ) - (vote-buttons base-score :with-buttons *enable-voting* :vote-count vote-count :af-score (and af af-base-score)) + (vote-buttons base-score :with-buttons *enable-voting* :vote-count vote-count :af-score (and af af-base-score) :extended-score extended-score :all-votes all-votes) (when af AF) (when post-id