Skip to content

Commit

Permalink
Merge pull request #90 from plone/fixvoltocontrolpanelicon
Browse files Browse the repository at this point in the history
Thanks! Never thought about the logo a long time ago.
  • Loading branch information
fredvd authored Sep 21, 2022
2 parents ed8ac1e + 3fb1229 commit 5531a55
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions news/89.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add proper icon in classic control panel
[sneridagh]
6 changes: 6 additions & 0 deletions src/plone/volto/browser/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
xmlns:zcml="http://namespaces.zope.org/zcml"
>

<plone:static
directory="static"
name="plone.volto"
type="plone"
/>

<browser:page
name="breadcrumbs_view"
for="*"
Expand Down
3 changes: 3 additions & 0 deletions src/plone/volto/browser/static/volto.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/plone/volto/profiles/default/controlpanel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
appId="VoltoSettings"
category="plone-general"
condition_expr=""
icon_expr="string:$portal_url/product_icon.png"
icon_expr="string:volto-settings"
title="Volto Settings"
url_expr="string:${portal_url}/volto_settings"
visible="True"
Expand Down
7 changes: 7 additions & 0 deletions src/plone/volto/profiles/default/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@
</value>
</record>

<record name="plone.icon.volto-settings">
<field type="plone.registry.field.TextLine">
<title>Plone Icon Volto Control Panel</title>
</field>
<value key="resource">++plone++plone.volto/volto.svg</value>
</record>

</registry>
12 changes: 12 additions & 0 deletions src/plone/volto/upgrades.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from copy import deepcopy
from plone import api
from plone.registry import field
from plone.registry.interfaces import IRegistry
from plone.registry.record import Record
from plone.restapi.behaviors import IBlocks
from plone.volto import content
from plone.volto import logger
from plone.volto.setuphandlers import NO_RICHTEXT_BEHAVIOR_CONTENT_TYPES
from plone.volto.setuphandlers import remove_behavior
from zope.component import getUtility


MIGRATION = {
Expand Down Expand Up @@ -103,3 +107,11 @@ def migrate_listing(originBlocks):
def remove_plone_richtext_behavior(context):
for type_ in NO_RICHTEXT_BEHAVIOR_CONTENT_TYPES:
remove_behavior(type_, "plone.richtext")


def add_control_panel_classic_icon(context):
registry = getUtility(IRegistry)
registry.records["plone.icon.volto-settings"] = Record(
field.TextLine(title="Plone Icon Volto Control Panel"),
)
registry["plone.icon.volto-settings"] = "++plone++plone.volto/volto.svg"
16 changes: 16 additions & 0 deletions src/plone/volto/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,20 @@
destination="1016"
import_steps="typeinfo"
/>

<genericsetup:upgradeSteps
profile="plone.volto:default"
source="1016"
destination="1017"
>
<genericsetup:upgradeDepends
title="Update controlpanel info for Plone Site"
import_steps="controlpanel"
/>
<genericsetup:upgradeStep
title="Add proper icon for Volto settings in classic"
handler=".upgrades.add_control_panel_classic_icon"
/>
</genericsetup:upgradeSteps>

</configure>

0 comments on commit 5531a55

Please sign in to comment.