カスタムトピック並び替え順ボタン

Install this theme component

Hello :waving_hand:

This theme component adds a new button next to the Create Topic button, allowing you to change the topic list order. One of the main goals was to make topic ordering easily accessible on mobile devices as well and themes where the topic list header section is hidden.

Clicking on an item will show the sort order direction (ascending or descending) on the right side of the item.

Descending (icon) Ascending (icon)

Settings

This component contains several settings for customization.

Object setting

With the object setting you can change each item’s icon, label, action and order.

  • icon → icon name from the Discourse icon set
  • label → translation key (see /admin/customize/site_texts)
  • action → sorting action identifier
  • order → position of the item in the dropdown

Example for label:

likes-label

In this case the label field should be: js.likes

「いいね!」 14

Great component! I thought about creating something similar.

I noticed you did not add a license to the GitHub repo.

Would you accept a pull request that adds more order options like op_likes?

「いいね!」 5

this is a great component Don, nice work! thanks for creating this :star_struck:

「いいね!」 4

Sure! PR welcome thanks @Moin :hugs:

「いいね!」 4

One thing I noted is that I sort of expect the drop down to disappear after I’ve clicked one of the selections. I have to click outside it after the view changes to make it go away. But maybe that is by design - I’m not sure lol.

「いいね!」 3

Yeah this is by design — if you click the same item again the sorting direction changes.

「いいね!」 3

yea i was thinking that after playing with it more. i love this component - very useful for me on my own instance. thanks again :hugs:

「いいね!」 3

I notice the sort by button appears on the categories page, but doesn’t do anything there. could probably hide it in that case.

「いいね!」 3

Thanks Lilly :hugs: I’ve merged it: DEV: Remove sort button on categories page · VaperinaDEV/custom-topic-sort-order-button@1325272 · GitHub

「いいね!」 3