Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/services/sqlstore/postgres/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ func getViewData(query query.SearchPosts, tagsPlaceholder int) (string, []enum.P
switch query.View {
case "recent":
sort = "id"
case "recently-responded":
// Limit the result set to posts an admin has actually responded to;
// without this filter, open posts with NULL response_date dominate the
// tail of the list and make the sort look broken.
condition += " AND response_date IS NOT NULL"
sort = "response_date"
case "most-wanted":
sort = "votes_count"
case "most-discussed":
Expand Down
2 changes: 2 additions & 0 deletions locale/en/client.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
"home.postfilter.option.myposts": "My Posts",
"home.postfilter.option.myvotes": "My Votes",
"home.postfilter.option.notags": "Untagged",
"home.postfilter.option.pending": "Pending",
"home.postfilter.option.recent": "Recent",
"home.postfilter.option.recentlyresponded": "Recently Responded",
"home.postfilter.option.trending": "Trending",
"home.postscontainer.label.noresults": "No results matched your search, try something different.",
"home.postscontainer.label.viewmore": "View more posts",
Expand Down
2 changes: 2 additions & 0 deletions locale/pl/client.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
"home.postfilter.option.myposts": "Moje posty",
"home.postfilter.option.myvotes": "Moje Głosy",
"home.postfilter.option.notags": "Nieoznaczone",
"home.postfilter.option.pending": "Oczekujące",
"home.postfilter.option.recent": "Niedawne",
"home.postfilter.option.recentlyresponded": "Ostatnio rozpatrzone",
"home.postfilter.option.trending": "Popularne",
"home.postscontainer.label.noresults": "Brak wyników pasujących do Twojego wyszukiwania, spróbuj czegoś innego.",
"home.postscontainer.label.viewmore": "Pokaż więcej postów",
Expand Down
6 changes: 5 additions & 1 deletion public/pages/Home/components/ListPosts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ const MinimalListPostItem = (props: { post: Post; tags: Tag[]; onPostClick?: (po
<a className="text-link" href={`/posts/${props.post.number}/${props.post.slug}`} onClick={handleClick}>
{props.post.title}
</a>
{isPending && <span className="text-xs bg-yellow-100 text-yellow-800 px-2 py-1 rounded">pending</span>}
{isPending && (
<span className="text-xs bg-yellow-100 text-yellow-800 px-2 py-1 rounded">
<Trans id="post.pending">pending</Trans>
</span>
)}
</HStack>
{props.post.status !== "open" ? (
<div>
Expand Down
2 changes: 1 addition & 1 deletion public/pages/Home/components/PostFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const PostFilter = (props: PostFilterProps) => {
// Add Pending status for collaborators and admins
if (fider.session.isAuthenticated && fider.session.user.isCollaborator) {
options.push({
label: "Pending",
label: i18n._({ id: "home.postfilter.option.pending", message: "Pending" }),
value: "pending",
type: "status",
})
Expand Down
5 changes: 5 additions & 0 deletions public/pages/Home/components/PostsSort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export const PostsSort: React.FC<PostsSortProps> = ({ value = "trending", onChan
{ value: "most-wanted", label: i18n._({ id: "home.postfilter.option.mostwanted", message: "Most Wanted" }), icon: IconThumbsUp },
{ value: "most-discussed", label: i18n._({ id: "home.postfilter.option.mostdiscussed", message: "Most Discussed" }), icon: IconChat },
{ value: "recent", label: i18n._({ id: "home.postfilter.option.recent", message: "Recent" }), icon: IconClock },
{
value: "recently-responded",
label: i18n._({ id: "home.postfilter.option.recentlyresponded", message: "Recently Responded" }),
icon: IconClock,
},
]

const selectedItem = options.find((x) => x.value === value) || options[0]
Expand Down
Loading