From 37a766a79d4bb0bf59fa5b051250749b6403f487 Mon Sep 17 00:00:00 2001 From: acholyn Date: Tue, 14 Jan 2025 15:23:46 +0000 Subject: [PATCH 1/6] adding collapses to each work on ant (basic) --- .../research/partials/ordered_work_area.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rard/templates/research/partials/ordered_work_area.html b/src/rard/templates/research/partials/ordered_work_area.html index 5a3409cdd..c7e30247d 100644 --- a/src/rard/templates/research/partials/ordered_work_area.html +++ b/src/rard/templates/research/partials/ordered_work_area.html @@ -17,6 +17,8 @@ + + {% for work in object.ordered_works.all %}
@@ -31,10 +33,12 @@
{% if work.unknown == True and not flinks and not tlinks and not alinks %} {% elif work.unknown == True %} - {{ work.name }} + {{ work.name }} + {% else %} - {{ work.name }} + {{ work.name }} + {% if can_edit and has_object_lock %} @@ -59,8 +63,8 @@ {% endif %} -
    -
    +
      +
      {% if tlinks %} {% for link in tlinks %} From c191cec69a364b1e90b2fcb92935cf80e81eec60 Mon Sep 17 00:00:00 2001 From: acholyn Date: Tue, 14 Jan 2025 15:30:55 +0000 Subject: [PATCH 2/6] adding expand all --- src/rard/templates/research/partials/ordered_work_area.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rard/templates/research/partials/ordered_work_area.html b/src/rard/templates/research/partials/ordered_work_area.html index c7e30247d..7643fc5fb 100644 --- a/src/rard/templates/research/partials/ordered_work_area.html +++ b/src/rard/templates/research/partials/ordered_work_area.html @@ -17,7 +17,7 @@
    - + {% for work in object.ordered_works.all %} @@ -63,8 +63,8 @@ {% endif %} -
      -
      +
        +
        {% if tlinks %} {% for link in tlinks %} From c30f6a96a4a99bf02bf8349ee8943c22fc5f613a Mon Sep 17 00:00:00 2001 From: acholyn Date: Mon, 20 Jan 2025 15:40:23 +0000 Subject: [PATCH 3/6] improving icon and adding reverse content when expanded --- .../research/partials/ordered_work_area.html | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/src/rard/templates/research/partials/ordered_work_area.html b/src/rard/templates/research/partials/ordered_work_area.html index 7643fc5fb..5616df476 100644 --- a/src/rard/templates/research/partials/ordered_work_area.html +++ b/src/rard/templates/research/partials/ordered_work_area.html @@ -34,11 +34,11 @@ {% if work.unknown == True and not flinks and not tlinks and not alinks %} {% elif work.unknown == True %} {{ work.name }} - + {% else %} {{ work.name }} - + {% if can_edit and has_object_lock %} @@ -109,3 +109,43 @@
        {% endwith %} + + From f06d4c1616054d4983151a1693c98b4837b9d73c Mon Sep 17 00:00:00 2001 From: acholyn Date: Wed, 22 Jan 2025 05:46:05 +0000 Subject: [PATCH 4/6] styling + making multi button change text when all open --- src/rard/static/css/project.css | 4 +++ .../research/partials/ordered_work_area.html | 25 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/rard/static/css/project.css b/src/rard/static/css/project.css index 22ccb3658..3ba33d83d 100644 --- a/src/rard/static/css/project.css +++ b/src/rard/static/css/project.css @@ -291,6 +291,10 @@ table.books-widget .book-order { font-family: Alphabetum !important; } +.sans-serif { + font-family: "Noto Sans", sans-serif; +} + body { font-family: Arial, Helvetica, sans-serif; } diff --git a/src/rard/templates/research/partials/ordered_work_area.html b/src/rard/templates/research/partials/ordered_work_area.html index 5616df476..f4396a2de 100644 --- a/src/rard/templates/research/partials/ordered_work_area.html +++ b/src/rard/templates/research/partials/ordered_work_area.html @@ -17,7 +17,7 @@
      - + {% for work in object.ordered_works.all %} @@ -34,11 +34,15 @@ {% if work.unknown == True and not flinks and not tlinks and not alinks %} {% elif work.unknown == True %} {{ work.name }} - + {{ tlinks.count|add:flinks.count|add:alinks.count }} + + + {% else %} {{ work.name }} - + {{ tlinks.count|add:flinks.count|add:alinks.count }} + {% if can_edit and has_object_lock %} @@ -114,6 +118,8 @@ document.addEventListener('DOMContentLoaded', (event) => { var collapseElementList = [].slice.call(document.querySelectorAll('ul.collapse')); var collapseButtonList = [].slice.call(document.querySelectorAll('.collapse-button')); + var expandAllBtn = document.getElementById('multi-collapse-control'); + function onClassChange(mutationList, observer) { mutationList.forEach((mutation) => { @@ -123,14 +129,21 @@ // Find the button that controls this collapsible element and update the content var btn = collapseButtonList.find(btn => btn.getAttribute('data-target') === '#' + targetElement.id); if (btn) { - btn.innerHTML = "{% trans 'Collapse' %}"; + btn.innerHTML = "{% trans 'Collapse' %}"; } } else { var btn = collapseButtonList.find(btn => btn.getAttribute('data-target') === '#' + targetElement.id); if (btn) { - btn.innerHTML = "{% trans 'Expand' %}"; + btn.innerHTML = "{% trans 'Expand' %}"; } } + + // Only change expand all to collapse all if all are open + if (collapseElementList.length === collapseElementList.filter(el => el.classList.contains('show')).length) { + console.log("changing expand all") + expandAllBtn.innerText = "{% trans 'Collapse all' %}"; + } + else {expandAllBtn.innerText = "{% trans 'Expand all' %}";} } }); } @@ -145,7 +158,7 @@ attributeFilter: ['class'] }); - }); + }); }); From caf48a774369584edcd11e499f3ae47b1c1cee67 Mon Sep 17 00:00:00 2001 From: acholyn Date: Wed, 22 Jan 2025 06:15:47 +0000 Subject: [PATCH 5/6] stopping the toggle behaviour of expand/collapse all when one is open/closed --- .../research/partials/ordered_work_area.html | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/rard/templates/research/partials/ordered_work_area.html b/src/rard/templates/research/partials/ordered_work_area.html index f4396a2de..f9b6cbf6f 100644 --- a/src/rard/templates/research/partials/ordered_work_area.html +++ b/src/rard/templates/research/partials/ordered_work_area.html @@ -17,7 +17,7 @@
- + {% for work in object.ordered_works.all %} @@ -120,6 +120,23 @@ var collapseButtonList = [].slice.call(document.querySelectorAll('.collapse-button')); var expandAllBtn = document.getElementById('multi-collapse-control'); + $('#multi-collapse-control').click(function(e) { + // when the expand all button is clicked handle collapse/show manually (jQuery) + e.preventDefault(); + + if ($(this).hasClass('exp')) { + + $('ul.collapse').each(function() { + $(this).collapse('show'); + e.stopPropagation(); + }); + } else { + $('ul.collapse').each(function() { + $(this).collapse('hide'); + e.stopPropagation(); + }); + } + }); function onClassChange(mutationList, observer) { mutationList.forEach((mutation) => { @@ -140,10 +157,12 @@ // Only change expand all to collapse all if all are open if (collapseElementList.length === collapseElementList.filter(el => el.classList.contains('show')).length) { - console.log("changing expand all") expandAllBtn.innerText = "{% trans 'Collapse all' %}"; + expandAllBtn.classList.remove('exp'); + } + else {expandAllBtn.innerText = "{% trans 'Expand all' %}"; + expandAllBtn.classList.add('exp'); } - else {expandAllBtn.innerText = "{% trans 'Expand all' %}";} } }); } From bfb3431ef0b2c03238bbe4f23bbf61f2593c63ee Mon Sep 17 00:00:00 2001 From: acholyn Date: Wed, 22 Jan 2025 14:46:39 +0000 Subject: [PATCH 6/6] outline badge buttons! --- .../research/partials/ordered_work_area.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/rard/templates/research/partials/ordered_work_area.html b/src/rard/templates/research/partials/ordered_work_area.html index f9b6cbf6f..aecfd8216 100644 --- a/src/rard/templates/research/partials/ordered_work_area.html +++ b/src/rard/templates/research/partials/ordered_work_area.html @@ -34,15 +34,14 @@ {% if work.unknown == True and not flinks and not tlinks and not alinks %} {% elif work.unknown == True %} {{ work.name }} - {{ tlinks.count|add:flinks.count|add:alinks.count }} - - + {% else %} {{ work.name }} - {{ tlinks.count|add:flinks.count|add:alinks.count }} - + {% if can_edit and has_object_lock %} @@ -146,12 +145,15 @@ // Find the button that controls this collapsible element and update the content var btn = collapseButtonList.find(btn => btn.getAttribute('data-target') === '#' + targetElement.id); if (btn) { - btn.innerHTML = "{% trans 'Collapse' %}"; + btn.querySelector("i").classList.remove("fa-chevron-down"); + btn.querySelector("i").classList.add("fa-chevron-up"); + } } else { var btn = collapseButtonList.find(btn => btn.getAttribute('data-target') === '#' + targetElement.id); if (btn) { - btn.innerHTML = "{% trans 'Expand' %}"; + btn.querySelector("i").classList.remove("fa-chevron-up"); + btn.querySelector("i").classList.add("fa-chevron-down"); } }