Skip to content

Commit

Permalink
Update ACE editor 1.4.4 to 1.5.0 (#1166)
Browse files Browse the repository at this point in the history
* Update ACE editor

Ref: #1161

* - guard ZMI resources with permission, create a public resource for logos

* - jazz up auto-generated default root page

* jazz up auto-generated default root page (2)

---------

Co-authored-by: Jens Vagelpohl <[email protected]>
  • Loading branch information
drfho and dataflake authored Oct 11, 2023
1 parent dcff181 commit ce5288a
Show file tree
Hide file tree
Showing 24 changed files with 87 additions and 21 deletions.
37 changes: 36 additions & 1 deletion src/OFS/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ def install_root_view(self):
if 'index_html' not in app:
from Products.PageTemplates.ZopePageTemplate import \
ZopePageTemplate
root_pt = ZopePageTemplate('index_html')
root_pt = ZopePageTemplate('index_html',
text=DEFAULT_ROOT_TEMPLATE)
root_pt.pt_setTitle('Auto-generated default page')
app._setObject('index_html', root_pt)
self.commit('Added default view for root object')
Expand Down Expand Up @@ -513,3 +514,37 @@ def pgetattr(product, name, default=install_products, __init__=0):
return default

raise AttributeError(name)


DEFAULT_ROOT_TEMPLATE = """\
<!DOCTYPE html>
<html>
<head>
<title tal:content="template/title">The title</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="shortcut icon" type="image/x-icon" href="/++resource++logo/favicon/favicon.svg" />
<link rel="stylesheet" type="text/css" href="/++resource++logo/default.css" />
</head>
<body>
<a href="https://www.zope.dev" target="_blank">
<img src="/++resource++logo/Zope.svg" id="logo" alt="Zope logo" />
</a>
<h1>
<span tal:condition="template/title" tal:replace="context/title_or_id">
content title or id
</span>:
<span tal:condition="template/title" tal:replace="template/title">
optional template title
</span>
</h1>
<p>
This is Page Template <em tal:content="template/id">template id</em>.
</p>
<p>
For documentation, please visit
<a href="https://zope.readthedocs.io">https://zope.readthedocs.io</a>.
</p>
</body>
</html>
"""
8 changes: 7 additions & 1 deletion src/zmi/styles/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

<browser:resourceDirectory
name="zmi"
directory="resources" />
directory="resources"
permission="zope2.ViewManagementScreens" />

<browser:resourceDirectory
name="logo"
directory="resources/logo"
permission="zope.Public" />

<subscriber
provides="App.interfaces.ICSSPaths"
Expand Down
2 changes: 1 addition & 1 deletion src/zmi/styles/resources/ace.ajax.org/ace.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/zmi/styles/resources/ace.ajax.org/ext-searchbox.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/zmi/styles/resources/ace.ajax.org/mode-css.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/zmi/styles/resources/ace.ajax.org/mode-html.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/zmi/styles/resources/ace.ajax.org/mode-javascript.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/zmi/styles/resources/ace.ajax.org/mode-json.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/zmi/styles/resources/ace.ajax.org/mode-less.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/zmi/styles/resources/ace.ajax.org/mode-markdown.js

Large diffs are not rendered by default.

Loading

0 comments on commit ce5288a

Please sign in to comment.