Skip to content

Commit

Permalink
Merge pull request #46 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
alecghica authored Nov 27, 2024
2 parents 3316c72 + 8e31855 commit 6456019
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

5.8 - (2024-11-26)
---------------------------
* Feature: added getObjSize info for File portal_type used to get file size information
[ichim-david - refs #280463]
* Bug fix: fixed title of the initial navigation item when `side_title_nav` isn't set
[ichim-david - refs #280463]

5.7 - (2024-11-24)
---------------------------
* Change: Improve svg upgrade step to know which svgs are fixed and not revisit them
Expand Down
9 changes: 5 additions & 4 deletions eea/volto/policy/restapi/services/contextnavigation/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def render(self):
state = ""
else:
state = api.content.get_state(root)

res["items"].append(
{
"@id": root.absolute_url(),
Expand All @@ -164,7 +163,7 @@ def render(self):
"normalized_id": normalized_id,
"thumb": "",
# set title to side_nav_title if available
"title": getattr(root, "side_nav_title", root_title),
"title": getattr(root, "side_nav_title", "") or root_title,
"type": root_type,
"review_state": state,
}
Expand All @@ -185,11 +184,12 @@ def recurse(self, children, level, bottomLevel):

for node in children:
brain = node["item"]
is_file = node["portal_type"] == "File"

icon = ""

if show_icons:
if node["portal_type"] == "File":
if is_file:
icon = self.getMimeTypeIcon(node)

has_thumb = brain.getIcon
Expand All @@ -216,8 +216,9 @@ def recurse(self, children, level, bottomLevel):
"normalized_id": node["normalized_id"],
"review_state": node["review_state"] or "",
"thumb": thumb,
"title": node.get("side_nav_title", node["Title"]),
"title": getattr(node, "side_nav_title", "") or node["Title"],
"type": node["normalized_portal_type"],
"getObjSize": brain.getObjSize if is_file else "",
}

if node.get("nav_title", False):
Expand Down
2 changes: 1 addition & 1 deletion eea/volto/policy/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7
5.8

0 comments on commit 6456019

Please sign in to comment.