hipster-philology / pyrrha

A language-independent post-correction app for POS-tagging and lemmatization
https://pyrrha.huma-num.fr
MIT License
27 stars 16 forks source link

Search page -- Top and down pages navigation links mismatch with ordered results #327

Closed matgille closed 2 months ago

matgille commented 3 months ago

Describe the bug When trying to correct and ordered corpus after a search, switching from one page to another may result in the loss of the ordering if the bottom link to next page is used.

To Reproduce

When trying to go to page 4,

Expected behavior The OrderBy GET variable should be transmitted in the bottom page link.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): Using dh.chartes instance.

Solution

There may be a solution by correcting the following lines in file app/templates/main/tokens_search_through_fields.html:

            <div id="result_table" class="mt-3">
                {{ nav.render_pagination(pagination=tokens, corpus_id=corpus.id, endpoint="main.tokens_search_through_fields",
                lemma=lemma, morph=morph, POS=POS, form=form, orderBy=orderBy, desc=desc,
                get_params=["lemma", "morph", "POS", "form", "orderBy", "desc"]) }}

                {{ tokens_macros.table(tokens, corpus=corpus, changed=changed, editable=True, similar=True, sortable=True, link_back=True, search_kwargs=search_kwargs, endpoint="main.tokens_search_through_fields") }}

                {{ nav.render_pagination(pagination=tokens, corpus_id=corpus.id, endpoint="main.tokens_search_through_fields",
                lemma=lemma, morph=morph, POS=POS, form=form,
                get_params=["lemma", "morph", "POS", "form", "orderBy", "desc"]) }}
            </div>