UCL / frrant

2 stars 0 forks source link

Merge latest changes into production #352

Closed tcouch closed 1 year ago

tcouch commented 2 years ago

Change summary:

Allow multiple reference inputs when creating fragments

Instead of being a property of original texts, references are now an object in their own right (with editor and reference fields). With this change original texts can have one or more references instead of just one. Users can add multiple reference when creating the fragment/original text by clicking "Add another reference", and this option is also available when editing an existing original text.

The newly created reference model has three fields:

For sorting purposes, original texts have kept their reference position property, which can be seen when editing the item. However, this property is not displayed on any detail or list pages.

Where an original text only has one reference, its reference position is displayed on the fragment detail page like this:

1.2.3

Where there are multiple references, editor name and reference position is displayed for each reference like this:

AuthorA 1.2.3 | AuthorB 4.5.6

Data migration

For each existing original_text, its reference property (a character field) is converted into a new reference object, owned by the original text. The reference property becomes the reference_position property on the newly created reference, and the editor field is blank.

Improved \@mention search

Backend:

Model Short code Sort by Example
Antiquarian @aq order_name desc @aq:varro
Bibliography @bi author_surnames, year @bi:music:jones
Topic @tp topic order @tp:war
Work @wk name @wk:musica:varro
Fragment @fr pk @fr:varro
Anonymous Fragment @af order @af:12
Testimonium @tt antiquarian_testimoniumlinksantiquarianname @tt:varro
Unlinked Fragment @uf pk @uf:123

Wildcard Search

The search page now supports searching with wildcard characters:

tcouch commented 2 years ago

One potentially controversial decision is how we're diplaying fragments' summary information in lists. In the image below, the citing work information includes all references including editor information in the same format as displayed on detail pages if there are multiple references. This is fairly trivial to change.

image
tcouch commented 2 years ago

This change can now be tested on the development server here: https://www.ucl.ac.uk/history/frrant-preprod/fragment/create/

tcouch commented 2 years ago

351 needs to be addressed before we merge this into production (original texts can currently be created with no references).

tcouch commented 2 years ago

Ok, #351 is fixed now so all original texts must have at least one reference.

tcouch commented 2 years ago

Just discovered #354 which prevents users from adding a new original text to an existing fragment. Needs fixing before we can merge.

tcouch commented 1 year ago

354 is fixed now