mirror of
https://github.com/discourse/discourse.git
synced 2025-02-11 22:04:58 +00:00
6e5e607072
This commit adds support for the following ordering filters: 1. `order:activity` which orders the topics by `Topic#bumped_at` in descending order 2. `order:activity-asc` which orders the topics by `Topic#bumped_at` in ascending order 3. `order:latest-post` which orders the topics by `Topic#last_posted_at` in descending order 4. `order:latest-post-asc` which orders the topics by `Topic#last_posted_at` in ascending order 5. `order:created` which orders the topics by `Topic#created_at` in descending order 6. `order:created-asc` which orders the topics by `Topic#created_at` in ascending order 7. `order:views` which orders the topics by `Topic#views` in descending order 8. `order:views-asc` which orders the topics by `Topic#views` in ascending order 9. `order:likes` which orders the topics by `Topic#likes` in descending order 10. `order:likes-asc` which orders the topics by `Topic#likes` in ascending order 11. `order:likes-op` which orders the topics by `Post#like_count` of the first post in the topic in descending order 12. `order:likes-op-asc` which orders the topics by `Post#like_count` of the first post in the topic in ascending order 13. `order:posters` which orders the topics by `Topic#participant_count` in descending order 14. `order:posters-asc` which orders the topics by `Topic#participant_count` in ascending order 15. `order:category` which orders the topics by `Category#name` of the topic's category in descending order 16. `order:category-asc` which orders the topics by `Category#name` of the topic's category in ascending order Multiple order filters can be composed together and the order of ordering is applied based on the position of the filter in the query string. For example, `order:views order:created` will order the topics by `Topic#views` in descending order and then order the topics by `Topics#created_at` in descending order.