From ac6a8193a34bb682e03545a231c375ce1d66da1c Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 11 Nov 2025 12:02:22 +0000 Subject: [PATCH] Refactor answer list item actions to use right-floating icons for improved accessibility and user interaction; streamline code for marked and unmarked answers. --- anatomy/templates/anatomy/mark2.html | 5 ++ .../partials/mark2_marked_list_fragment.html | 51 +++++++------------ .../mark2_unmarked_list_fragment.html | 34 +++++-------- 3 files changed, 37 insertions(+), 53 deletions(-) diff --git a/anatomy/templates/anatomy/mark2.html b/anatomy/templates/anatomy/mark2.html index 6de0d9c1..d342838f 100644 --- a/anatomy/templates/anatomy/mark2.html +++ b/anatomy/templates/anatomy/mark2.html @@ -109,6 +109,11 @@ .key .key-item.correct { border-left: 8px solid #2a9d3f; } .key .key-item.half-correct { border-left: 8px solid #ffb020; } .key .key-item.incorrect { border-left: 8px solid #d3413a; } + /* Right-floating action icons for answer external links */ + .answer-actions { min-width: 6rem; } + .answer-actions .action-icon { margin-left: 0.5rem; color: #6c757d; text-decoration: none; border: none; background: none; } + .answer-actions .action-icon:hover { color: #000; text-decoration: none; } + .answer-actions .copy-to-clipboard { cursor: pointer; } {% endblock %} diff --git a/anatomy/templates/anatomy/partials/mark2_marked_list_fragment.html b/anatomy/templates/anatomy/partials/mark2_marked_list_fragment.html index aedaa27b..97ed6b9d 100644 --- a/anatomy/templates/anatomy/partials/mark2_marked_list_fragment.html +++ b/anatomy/templates/anatomy/partials/mark2_marked_list_fragment.html @@ -1,52 +1,37 @@ {% comment %}Renders only the list items for already-marked answers (used as a partial){% endcomment %} {% for answer in correct_answers %} {% with answer_url=answer|urlencode:'' %} -
  • -
    -
    - - -
    +
  • +
    {{ answer }}
    +
    + 🔍 + + 🔗
    -
    {{ answer }}
  • {% endwith %} {% endfor %} {% for answer in half_mark_answers %} {% with answer_url=answer|urlencode:'' %} -
  • -
    -
    - - -
    +
  • +
    {{ answer }}
    +
    + 🔍 + + 🔗
    -
    {{ answer }}
  • {% endwith %} {% endfor %} {% for answer in incorrect_answers %} {% with answer_url=answer|urlencode:'' %} -
  • -
    -
    - - -
    +
  • +
    {{ answer }}
    +
    + 🔍 + + 🔗
    -
    {{ answer }}
  • {% endwith %} {% endfor %} diff --git a/anatomy/templates/anatomy/partials/mark2_unmarked_list_fragment.html b/anatomy/templates/anatomy/partials/mark2_unmarked_list_fragment.html index 9285dd20..79b79da4 100644 --- a/anatomy/templates/anatomy/partials/mark2_unmarked_list_fragment.html +++ b/anatomy/templates/anatomy/partials/mark2_unmarked_list_fragment.html @@ -2,32 +2,26 @@ {% for answer in user_answers %} {% with answer_url=answer|urlencode:'' %} {% if answer in answer_suggest_incorrect %} -
  • -
    -
    - - +
  • +
    +
    {{ answer }}
    +
    + 🔍 + + 🔗
    -
    {{ answer }}
  • {% else %} -
  • -
    -
    - - +
  • +
    +
    {{ answer }}
    +
    + 🔍 + + 🔗
    -
    {{ answer }}
  • {% endif %} {% endwith %}