Skip to content

Rework article list as class-based view#3597

Merged
mauromsl merged 26 commits into
masterfrom
3199-article-pagination
Sep 15, 2023
Merged

Rework article list as class-based view#3597
mauromsl merged 26 commits into
masterfrom
3199-article-pagination

Conversation

@joemull

@joemull joemull commented Jun 6, 2023

Copy link
Copy Markdown
Member

Related issues:

In addition to fixing #3199, this work moves us closer to using class-based views for article list pages.

New things include:

  • templates, since the templates need to handle various aspects of FilteredArticlesListView in a particular way.
  • date facet field (already had datetime)
  • order by dropdown as a reusable template element for each theme
  • pagination as a reusable template element for each theme

Visually I moved a few things for clarity, and I hid the search form's order by to avoid confusion, but I tried to keep the interaction design similar.

Searching still takes you to a separate page. In the future I'd like to merge the list and search results pages so that they form one coherent path for finding the article(s) you want.

Screenshots:
Screenshot from 2023-06-06 13-32-39
Screenshot from 2023-06-06 13-08-52
Screenshot from 2023-06-06 13-31-43

@joemull joemull requested review from ajrbyers and mauromsl June 6, 2023 14:34

@mauromsl mauromsl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one, happy to see old Materialize go as a bonus (especially djang-materialize)

Comment thread src/core/views.py Outdated

def get_order_by_choices(self):
"""
Implemented by suclass

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: suclass => subclass

Usage of this method elswhere suggests that the returned value should be a list of 2-item tuples. In lieu of type annotations, can we make that clear on this docstring?

https://github.com/BirkbeckCTP/janeway/blob/cef6511967f7c62f1e4f6f3528b91a659cd0001b/src/core/views.py#L2388

@mauromsl mauromsl added the mret Mauro retrospective label Sep 15, 2023

@ajrbyers ajrbyers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two suggestions but looks good.

Comment thread src/themes/material/assets/material.js
Comment thread src/themes/material/assets/material.js Outdated
@mauromsl mauromsl merged commit 17c9fb8 into master Sep 15, 2023
@mauromsl mauromsl deleted the 3199-article-pagination branch September 15, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mret Mauro retrospective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Materialize Django helper Articles occasionally duplicate between front end 'articles' listing pages URLS for filtered articles

3 participants