diff --git a/backend/reviews/admin.py b/backend/reviews/admin.py index e388423bdd..219d3f1a2b 100644 --- a/backend/reviews/admin.py +++ b/backend/reviews/admin.py @@ -13,6 +13,7 @@ OuterRef, Prefetch, Q, + StdDev, Subquery, Sum, ) @@ -426,6 +427,10 @@ def _review_grants_recap_view(self, request, review_session): F("total_score") / F("vote_count"), output_field=FloatField(), ), + std_dev=StdDev( + "userreview__score__numeric_value", + filter=Q(userreview__review_session_id=review_session_id), + ), has_sent_a_proposal=Exists( Submission.objects.non_cancelled().filter( speaker_id=OuterRef("user_id"), diff --git a/backend/reviews/templates/grants-recap.html b/backend/reviews/templates/grants-recap.html index 9177c9d416..f710df78ca 100644 --- a/backend/reviews/templates/grants-recap.html +++ b/backend/reviews/templates/grants-recap.html @@ -181,6 +181,74 @@ tr:nth-of-type(odd) { background-color: var(--body-bg); } + + /* Tooltip */ + .tooltip { + position: relative; + display: inline-block; + } + + .tooltip .tooltiptext { + visibility: hidden; + opacity: 0; + width: 220px; + background-color: #333; + color: #fff; + text-align: left; + text-transform: none; + padding: 8px 10px; + border-radius: 6px; + position: absolute; + z-index: 1; + top: 125%; + left: 50%; + margin-left: -110px; + font-size: 12px; + font-weight: normal; + line-height: 1.4; + transition: opacity 0.2s ease-in-out 0.5s, visibility 0.2s ease-in-out 0.5s; + } + + .tooltip .tooltiptext::after { + content: ""; + position: absolute; + bottom: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: transparent transparent #333 transparent; + } + + .tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; + } + + /* Sortable columns */ + .sortable { + cursor: pointer; + user-select: none; + } + + .sortable:hover { + text-decoration: underline; + } + + /* Center-align columns */ + .results-table th:nth-child(1), /* number column */ + .results-table th:nth-child(3), /* score column */ + .results-table th:nth-child(4), /* std dev column */ + .results-table th:nth-child(6), /* current status column */ + .results-table th:nth-child(7), /* pending status column */ + .results-table td:nth-child(1), /* number column */ + .results-table td:nth-child(3), /* score column */ + .results-table td:nth-child(4), /* std dev column */ + .results-table td:nth-child(6), /* current status column */ + .results-table td:nth-child(7) /* pending status column */ + { + text-align: center; + } {{ item.score }} + {{ item.std_dev|floatformat:2 }}