UCL / frrant

2 stars 0 forks source link

Feature/duplicate fragment #427

Closed acholyn closed 4 months ago

acholyn commented 5 months ago

closes #393

New view with button to duplicate the fragment. The duplication also duplicates the OriginalText and the Concordance instances associated, as well as Topics, References, Translations and ApparatusCriticusItems.

The code loops through all the fields of the OriginalText and copies their values and goes through these associated models and does the same thing, then assigns the new OriginalText instance in place of the original one. Finally, the Fragment is copied and the new OriginalText attached, and then Topics are copied.

On the frontend, the Duplicate button is clicked, a request is sent to the view with the pk of the original item. Upon completion, the user is redirected to the new unlinked fragment.

The commentary and links/apposita are not copied over, intentionally.

This has been implemented for Fragments andAnonymousFragments, unlinkedFragments` are created in both cases (tbc)