Improve resources display on mobile
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -20,6 +20,7 @@ defmodule Mobilizon.GraphQL.Schema.ResourceType do
|
||||
field(:actor, :actor, description: "The resource's owner")
|
||||
field(:inserted_at, :naive_datetime, description: "The resource's creation date")
|
||||
field(:updated_at, :naive_datetime, description: "The resource's last update date")
|
||||
field(:published_at, :naive_datetime, description: "The resource's publication date")
|
||||
field(:type, :string, description: "The resource's type (if it's a folder)")
|
||||
field(:path, :string, description: "The resource's path")
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ defmodule Mobilizon.Resources do
|
||||
) do
|
||||
Resource
|
||||
|> where([r], r.actor_id == ^group_id and is_nil(r.parent_id))
|
||||
|> order_by(asc: :type)
|
||||
|> order_by(asc: :type, asc: :title)
|
||||
|> preload([r], [:actor, :creator])
|
||||
|> Page.build_page(page, limit)
|
||||
end
|
||||
@@ -55,7 +55,7 @@ defmodule Mobilizon.Resources do
|
||||
def get_resources_for_folder(%Resource{id: resource_id}, page, limit) do
|
||||
Resource
|
||||
|> where([r], r.parent_id == ^resource_id)
|
||||
|> order_by(asc: :type)
|
||||
|> order_by(asc: :type, asc: :title)
|
||||
|> preload([r], [:actor, :creator])
|
||||
|> Page.build_page(page, limit)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user