사용자 지정 주제 정렬 순서 버튼

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

18개의 좋아요

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:

6개의 좋아요

Sure! PR welcome thanks @Moin :hugs:

5개의 좋아요

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.

5개의 좋아요

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:

4개의 좋아요

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

4개의 좋아요

병합되었습니다.

추가 주문 옵션에 대해 제가 선택한 아이콘과 라벨
{
	"icon": "custom-heart-circle-one",
	"label": "js.category.sort_options.op_likes",
	"action": "op_likes"
},
{
	"icon": "user-group",
	"label": "js.posters",
	"action": "posters"
},
{
	"icon": "far-square",
	"label": "js.category.sort_options.category",
	"action": "category"
},
{
	"icon": "square-plus",
	"label": "js.topic_voting.vote_title_plural",
	"action": "votes"
}

이 옵션들이 덜 일반적으로 사용된다고 생각하여 기본 설정에 추가하지 않았습니다. 하지만 이 옵션들을 추가하면, 이제 첫 게시물에 대한 좋아요 수, 게시자 수, 카테고리 ID, 그리고 토픽 투표 플러그인이 사용될 경우 투표 수로도 정렬할 수 있습니다.

모바일에서 라벨이 숨겨져 있을 때도 좋아요와 첫 게시물 좋아요를 구별할 수 있도록 OP(첫 게시물) 좋아요를 위한 아이콘을 만들었습니다.

4개의 좋아요

모바일에서 옵션을 선택하면 DOM이 로드될 때까지 이 모달이 위로 이동합니다.
UI 버그인가요?