add i18n for system/home nav editor, improve link manager
This commit is contained in:
1 parent
e8e9b505af
commit
2b4e1dbc57
9 files changed
+517
-52
No files matched your search
@@ -27,30 +27,34 @@ func (s *Store) ListRecentObjects(
|
||||
) AS rn
|
||||
FROM revisions r
|
||||
),
|
||||
primary_path AS (
|
||||
ranked_path AS (
|
||||
SELECT
|
||||
p.object_uuid,
|
||||
MIN(p.path) AS path
|
||||
p.path,
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY p.object_uuid
|
||||
ORDER BY
|
||||
COALESCE(p.is_primary, 0) DESC,
|
||||
p.path ASC
|
||||
) AS rn
|
||||
FROM paths p
|
||||
GROUP BY p.object_uuid
|
||||
)
|
||||
SELECT
|
||||
o.uuid,
|
||||
COALESCE(primary_path.path, ''),
|
||||
COALESCE(ranked_path.path, ''),
|
||||
COALESCE(LENGTH(latest.body), 0),
|
||||
COALESCE(latest.created_at, o.created_at)
|
||||
FROM objects o
|
||||
LEFT JOIN latest
|
||||
ON latest.object_uuid = o.uuid
|
||||
AND latest.rn = 1
|
||||
LEFT JOIN primary_path
|
||||
ON primary_path.object_uuid = o.uuid
|
||||
LEFT JOIN ranked_path
|
||||
ON ranked_path.object_uuid = o.uuid
|
||||
AND ranked_path.rn = 1
|
||||
ORDER BY
|
||||
COALESCE(latest.created_at, o.created_at) DESC
|
||||
LIMIT ?
|
||||
`,
|
||||
limit,
|
||||
)
|
||||
`, limit)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in new issue
Block a user