Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b93c863
update cover image generation logic to show uncropped images
yl5682 Apr 1, 2026
f244792
update cover image generation logic to show uncropped images (collect…
yl5682 Apr 1, 2026
a79161f
adjust foreground-background contrast for full description modal
yl5682 Apr 2, 2026
51bac2d
add an unescape filter to render html entities for collection descrip…
yl5682 Apr 2, 2026
380689d
add spacing between paragraphs in collection full description modal
yl5682 Apr 2, 2026
ab0a3e8
add a button/modal for collection metadata
yl5682 Apr 2, 2026
9a781d7
fix a missing include
yl5682 Apr 7, 2026
ce3890b
improve contrast for flatpage links
yl5682 Apr 7, 2026
69c6b81
update the collection hero layout and styles
yl5682 May 10, 2026
de4a593
hide pagination when there is no item to show
yl5682 May 10, 2026
abf5d7c
update flatpage link colors
yl5682 May 12, 2026
67d8e5f
make the vertical spacing between title and content consistent
yl5682 May 12, 2026
ae13442
update breadcrumb for profile pages
yl5682 May 13, 2026
75b9e47
style account overview page
yl5682 May 13, 2026
0f955fd
update other sections of user profile
yl5682 May 13, 2026
efa9fdc
polish user profile forms
yl5682 May 13, 2026
bc6fec9
update the logout uk-alert-success banner style
yl5682 May 13, 2026
87b402b
style the notification modal
yl5682 May 13, 2026
5bdb2bb
add pagination on the bottom
yl5682 May 13, 2026
8df36e0
update login modal social auth
yl5682 May 13, 2026
0db4c64
stretch page to fill entire viewport
yl5682 May 13, 2026
e6208ab
add label for homepage search field
yl5682 May 13, 2026
1d21373
accessibility: search and my account
yl5682 May 13, 2026
f113713
accessibility: add text to search page button
yl5682 May 13, 2026
ecf8adf
accessibility: search page form fields
yl5682 May 13, 2026
fcd5969
accessibility: volume page fields
yl5682 May 13, 2026
4f73859
accessibility: aria-label
yl5682 May 13, 2026
8d2dd18
Merge branch 'develop' into ui-bug-triage
yl5682 May 13, 2026
ab6b01a
[BUG] Text overlay toggle obstructing text
yl5682 Jun 10, 2026
19a1752
style login page (unstyled)
yl5682 Jun 11, 2026
d916768
render human-readable text on collections page
yl5682 Jun 11, 2026
6181c32
fix an issue with annotation loading
yl5682 Jun 11, 2026
7842aa1
skip MATOMO if unavailable
yl5682 Jun 12, 2026
6851184
Merge branch 'develop' into ui-bug-triage
yl5682 Jun 12, 2026
fca4935
eliminate warnings
yl5682 Jun 12, 2026
2b2dd7d
update wagtail to remove deprecation warnings
yl5682 Jun 12, 2026
8ad8f4f
BUG: Improve formatting of collection hero image and its metadata
yl5682 Jun 12, 2026
7c3ec71
handle html entities accordingly for collection view/pages
yl5682 Jun 12, 2026
9cf7e54
set default elasticsearch namespaces
yl5682 Jun 12, 2026
ff69351
address collection description html entries issue
yl5682 Jun 12, 2026
cb25a7a
use libsass for runtime compilation for now
yl5682 Jun 12, 2026
0da3d06
change annotation text color
yl5682 Jun 12, 2026
4e1ec55
fix annotation search query
yl5682 Jun 12, 2026
e636c63
prevent the annotator from being obstructed by the modals
yl5682 Jun 12, 2026
55404e1
adjust annotation index button css
yl5682 Jun 13, 2026
8ced497
address annotation and search result misalignments
yl5682 Jun 13, 2026
eff0e76
fix inconsistent pdf download button
yl5682 Jun 13, 2026
3e948ab
fix on-page annotation count update issues
yl5682 Jun 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions apps/cms/templatetags/url_replace.py

This file was deleted.

2 changes: 1 addition & 1 deletion apps/iiif/manifests/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ManifestDocument(Document):
class Index:
"""Settings for Elasticsearch"""

name = f"{settings.INDEX_PREFIX}_manifests"
name = f"{settings.INDEX_PREFIX}_manifests" if settings.INDEX_PREFIX else "manifests"

class Django:
"""Settings for automatically pulling data from Django"""
Expand Down
13 changes: 7 additions & 6 deletions apps/readux/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Annotations(View):
"""

def get_queryset(self):
return Canvas.objects.filter(pid=self.kwargs["canvas"])
return Canvas.objects.filter(pid=self.kwargs["canvas"], manifest__pid=self.kwargs["vol"])

def get(self, request, *args, **kwargs):
username = kwargs["username"]
Expand Down Expand Up @@ -54,19 +54,20 @@ def get(self, request, *args, **kwargs):
)

if "3" in kwargs["version"]:
canvas = queryset.first()
annotations = []

if username == "ocr":
annotations = queryset.first().annotation_set.all()
annotations = canvas.annotation_set.all()
elif owner.username == username:
annotations = queryset.first().userannotation_set.filter(
owner=owner
)
annotations = canvas.userannotation_set.filter(owner=owner)

return JsonResponse(
json.loads(
serialize(
"annotation_page_v3", queryset, annotations=annotations
"annotation_page_v3",
Canvas.objects.filter(pk=canvas.pk),
annotations=annotations,
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion apps/readux/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UserAnnotationDocument(Document):
class Index:
"""Settings for Elasticsearch"""

name = f"{settings.INDEX_PREFIX}_annotations"
name = f"{settings.INDEX_PREFIX}_annotations" if settings.INDEX_PREFIX else "annotations"

class Django:
"""Settings for automatically pulling data from Django"""
Expand Down
22 changes: 18 additions & 4 deletions apps/readux/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ def get_queryresults(self):
anno_queries_exact.append({"bool": {"should": [nested_exact]}})

# combine exact and partial with bool: { should, must }
q = Q("bool", should=anno_queries, must=anno_queries_exact)
# NOTE: because we apply `.filter()` (owner + manifest), the bool query has a
# filter context. When there is no `must` clause, Elasticsearch defaults
# minimum_should_match to 0, which would return *every* annotation in the volume
# regardless of the keyword. Require at least one `should` match when there are no
# exact (must) queries to enforce the keyword.
bool_kwargs = {"should": anno_queries, "must": anno_queries_exact}
if not anno_queries_exact:
bool_kwargs["minimum_should_match"] = 1
q = Q("bool", **bool_kwargs)
annotations = annotations.query(q)
annotations = annotations.highlight("content")

Expand All @@ -154,11 +162,16 @@ def get_queryresults(self):
annotation_matches = []
if annotation_match_count:
for anno in anno_response.hits:
# skip hits without a highlight (no actual keyword match); accessing
# missing highlight data would otherwise raise an AttributeError
highlight = getattr(anno.meta, "highlight", None)
if not highlight or "content" not in highlight:
continue
annotation_matches.append(
{
"canvas_index": anno["canvas_index"],
"canvas_pid": anno["canvas_pid"],
"context": list(anno.meta.highlight.content),
"context": list(highlight.content),
}
)

Expand All @@ -171,10 +184,11 @@ def get_queryresults(self):
annotation_matches_on_canvas = 0
annotation_matches_in_volume = 0
for k, v in groupby(annotation_matches, key=group_key):
canvas_matches = list(flatten([match["context"] for match in v]))
group = list(v)
canvas_matches = list(flatten([match["context"] for match in group]))
annotation_matches_grouped.append(
{
"canvas_index": anno["canvas_index"],
"canvas_index": group[0]["canvas_index"],
"canvas_match_count": len(canvas_matches),
"canvas_pid": k,
"context": canvas_matches,
Expand Down
15 changes: 15 additions & 0 deletions apps/readux/tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ def test_manifest_canvas_user_annotation_partial_search(self):
# should be in canvas indices 1 and 2
assert match["canvas_index"] in [1, 2]

def test_manifest_canvas_user_annotation_partial_search_no_results(self):
# a partial (non-exact) keyword that matches none of the user's annotations should
# return zero matches. Regression test: a filter context with only `should` clauses
# caused Elasticsearch to default minimum_should_match to 0 and return every
# annotation in the volume regardless of the keyword.
query_params = {'volume_id': self.volume.pid, 'keyword': 'nonexistentword'}
request = self.request.get(
self.url, query_params
)
request.user = self.user
response = self.search_manifest_view(request)
search_results = self.load_results(response)
assert search_results['matches_in_annotations']['total_matches_in_volume'] == 0
assert len(search_results['matches_in_annotations']['volume_matches']) == 0

def test_manifest_canvas_user_annotation_exact_search(self):
query_params = {'volume_id': self.volume.pid, 'keyword': '"outcasts"'}
request = self.request.get(
Expand Down
13 changes: 12 additions & 1 deletion apps/static/css/components/collection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,18 @@
.description-text {
display: block;
}


/* Links need a light color for contrast against the dark hero background */
a {
color: $rx-color-sky-blue;
text-decoration: underline;

&:hover,
&:focus {
color: $rx-color-faded-mint;
}
}

/* When description is truncated */
&.description-truncated .description-text::after {
content: '';
Expand Down
33 changes: 33 additions & 0 deletions apps/static/css/components/reader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,39 @@
right: 240px;
}

/* .ecds-annotator sets color:white globally; reset text color for annotation
content popups and the Jodit editor which both have white backgrounds. */
.rdx-annotation-content,
.jodit-container {
color: $rx-color-dark-charcoal;
}

.uk-search {
padding-right: 10px;
}

.rx-annotation-index-row {
display: flex;
align-items: center;
gap: 0.4rem;

a {
display: flex;
align-items: center;
line-height: 1;
}

.rx-label-copy {
vertical-align: middle;
}
}

.rx-search-result-list {
margin-top: 0.25rem !important;
margin-bottom: 0 !important;
padding-left: 1.25rem !important;

.rx-search-result-item {
margin-top: 0.2rem;
}
}
44 changes: 31 additions & 13 deletions apps/static/css/readux.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ html, body {

main { flex-grow: 1; }

/* Home page navigation transparent */
.home-nav { nav { background-color: transparent !important; } }
/* Home page navigation transparent, light text/icons over dark hero */
.home-nav {
nav { background-color: transparent !important; }
a, .brand-logo, .brand-tagline { color: $color-white !important; }
svg line, svg path, svg circle, svg polygon, svg polyline, svg rect {
stroke: $color-white !important;
}
}

/* Overlay & content shell */
.overlay {
Expand Down Expand Up @@ -185,8 +191,9 @@ em { color: inherit !important; }
/* Buttons */
.uk-button-default { @include interactive-border($rx-color-midnight-blue); }
.uk-button-primary {
background-color: var(--link-color);
&:hover, &:active { background-color: var(--link-color); filter: contrast(var(--contrast)); }
background-color: var(--link-color) !important;
color: #fff !important;
&:hover, &:active { background-color: var(--link-color) !important; color: #fff !important; filter: contrast(var(--contrast)); }
}

/* Close icon */
Expand Down Expand Up @@ -342,9 +349,6 @@ button.google, button.github { color: $color-white; }
padding: 0; margin: 0; user-select: auto;
}
.rx-action-btn { letter-spacing: 0.1em; font-size: small; }
.rx-action-btn:hover {
.rx-label-copy { background-color: $rx-color-midnight-blue !important; color: $color-white !important; }
}

.rx-breadcrumb-item > a, .rx-action-btn, .rx-icon-btn, .uk-dropdown-nav > li > a:hover {
color: var(--link-color) !important; opacity: 0.75; transition: all 100ms ease-in-out;
Expand All @@ -356,12 +360,26 @@ button.google, button.github { color: $color-white; }
.rx-anchor { color: var(--link-color) !important; opacity: 0.75; word-break: break-all; transition: all 100ms; &:hover { color: var(--link-color); opacity: 1; } }

.rx-label-copy {
background: $color-white;
color: var(--link-color) !important;
border: var(--link-color) 1px solid;
font-size: 0.75rem; letter-spacing: 0.1rem; cursor: pointer; transition: all 100ms ease-in-out; font-weight: 600; font-family: 'Consolas','Monaco','Andale Mono','Ubuntu Mono','monospace' !important;
&:active { background-color: $rx-color-midnight-blue !important; border: 1px solid $rx-color-midnight-blue !important; opacity: 1; }
&:hover { background: $rx-color-midnight-blue; border-color: $rx-color-midnight-blue; color: $color-white !important; }
background: $rx-color-midnight-blue !important;
color: $color-white !important;
border: none !important;
font-size: 0.75rem;
letter-spacing: 0.1rem;
cursor: pointer;
transition: background 150ms ease-in-out, opacity 150ms ease-in-out;
font-weight: 600;
font-family: 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace !important;

&:hover {
background: darken($rx-color-midnight-blue, 12%) !important;
color: $color-white !important;
opacity: 0.9;
}

&:active {
background: darken($rx-color-midnight-blue, 20%) !important;
opacity: 1;
}
}

/* Navigation & bars */
Expand Down
6 changes: 3 additions & 3 deletions apps/static/js/components/OcrInspector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
This page does not have any usable OCR.
</div>

<div class="rx-info-content-label uk-flex-between rx-flex" style="align-items:center;">
<label class="uk-switch" for="ocr-overlay">
<span>Overlay OCR on Page</span>
<div class="rx-info-content-label uk-flex uk-flex-middle" style="gap: 1rem; align-items:center;">
<label class="uk-switch" for="ocr-overlay" style="margin: 0; flex-shrink: 0;">
<input
type="checkbox"
id="ocr-overlay"
Expand All @@ -17,6 +16,7 @@
>
<div class="uk-switch-slider"></div>
</label>
<span style="flex: 1;">Overlay OCR on Page</span>
</div>

<div class="rx-info-content-value uk-margin-small-bottom uk-text-italic">
Expand Down
Loading
Loading