UCL / frrant

2 stars 0 forks source link

Allow users to order anonymous fragments within topics #326

Closed tcouch closed 2 years ago

tcouch commented 2 years ago

Splitting this out from #290 as these requests can be tackled independently.

Description

On the /anonymous/list page, anonymous fragments are currently displayed under topic headings and the order in which they're displayed within those topics is determined by the fragment's order value. Users would like to be able to change the fragment's order within topics by dragging them up and down (or clicking up/down buttons) within the topic list (c.f. /topic/list/ page).

Current functionality

Proposed solution

Luckily @peterbispham seems to have anticipated this and added an order field to AnonymousTopicLink which we can use to record the order with respect to Topic for Anonymous Fragments. A quick survey of the database confirms this field is not currently used.

Once we have an order wrt topic for each AnonymousTopicLink, we can change the reindex_anonymous_fragments function to order AnonymousFragments by Topic order, then by AnonymousTopicLink order to determine their overall order.

tcouch commented 2 years ago

Preferred option is to remove pagination on /anonymous/list and just list the topics, clicking on a topic shows all the relevant anonymous fragments in one page (not sure the url /anonymous/list makes sense in that case)

Richard confirms they would not want to move anon fragments across topics

tcouch commented 2 years ago

Testing expected functionality

Models

AnonymousTopicLink

AnonymousFragment

setUpTestData():

Views

MoveAnonymousTopicLinkView