Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
18ef29ca
Commit
18ef29ca
authored
Aug 28, 2016
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify Page Template and Scripts ZMI screens.
parent
735105da
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
3 additions
and
233 deletions
+3
-233
CHANGES.rst
CHANGES.rst
+2
-0
src/Products/PageTemplates/ZopePageTemplate.py
src/Products/PageTemplates/ZopePageTemplate.py
+0
-7
src/Products/PageTemplates/www/ptEdit.zpt
src/Products/PageTemplates/www/ptEdit.zpt
+0
-13
src/Shared/DC/Scripts/BindingsUI.py
src/Shared/DC/Scripts/BindingsUI.py
+1
-9
src/Shared/DC/Scripts/Script.py
src/Shared/DC/Scripts/Script.py
+0
-19
src/Shared/DC/Scripts/dtml/scriptBindings.dtml
src/Shared/DC/Scripts/dtml/scriptBindings.dtml
+0
-136
src/Shared/DC/Scripts/dtml/scriptTry.dtml
src/Shared/DC/Scripts/dtml/scriptTry.dtml
+0
-49
No files found.
CHANGES.rst
View file @
18ef29ca
...
...
@@ -30,6 +30,8 @@ Features Added
Restructuring
+++++++++++++
- Simplify Page Template and Scripts ZMI screens.
- Change VHM id to `virtual_hosting` to match AppInitializer.
- Raise BadRequest instead of returning MessageDialog.
...
...
src/Products/PageTemplates/ZopePageTemplate.py
View file @
18ef29ca
...
...
@@ -88,7 +88,6 @@ class ZopePageTemplate(Script, PageTemplate, Cacheable,
manage_options
=
(
{
'label'
:
'Edit'
,
'action'
:
'pt_editForm'
},
{
'label'
:
'Test'
,
'action'
:
'ZScriptHTML_tryForm'
},
)
+
SimpleItem
.
manage_options
+
Cacheable
.
manage_options
_properties
=
(
...
...
@@ -103,8 +102,6 @@ class ZopePageTemplate(Script, PageTemplate, Cacheable,
# protect methods from base class(es)
security
.
declareProtected
(
view
,
'__call__'
)
security
.
declareProtected
(
view_management_screens
,
'read'
,
'ZScriptHTML_tryForm'
)
def
__init__
(
self
,
id
,
text
=
None
,
content_type
=
'text/html'
,
strict
=
True
,
output_encoding
=
'utf-8'
):
...
...
@@ -232,10 +229,6 @@ class ZopePageTemplate(Script, PageTemplate, Cacheable,
self
.
pt_edit
(
text
,
content_type
)
return
self
.
pt_editForm
(
manage_tabs_message
=
'Saved changes'
)
def
ZScriptHTML_tryParams
(
self
):
"""Parameters to test the script with."""
return
[]
def
pt_getContext
(
self
,
*
args
,
**
kw
):
root
=
None
meth
=
aq_get
(
self
,
'getPhysicalRoot'
,
None
)
...
...
src/Products/PageTemplates/www/ptEdit.zpt
View file @
18ef29ca
...
...
@@ -23,19 +23,6 @@
tal:attributes="value request/content_type | context/content_type" />
</td>
</tr>
<tr>
<td align="left" valign="middle"></td>
<td align="left" valign="middle"></td>
<td align="left" valign="top" colspan="2">
<a href="source.html" tal:condition="context/html">Browse HTML source</a>
<a href="source.xml" tal:condition="not:context/html">Browse XML source</a>
<br />
<input type="hidden" name="expand:int:default" value="0" />
<input type="checkbox" value="1" name="expand:int"
tal:attributes="checked request/expand | context/expand" />
Expand macros when editing
</td>
</tr>
<tr tal:define="errors context/pt_errors" tal:condition="errors">
<td align="left" valign="middle" class="form-label">Errors</td>
...
...
src/Shared/DC/Scripts/BindingsUI.py
View file @
18ef29ca
...
...
@@ -12,9 +12,7 @@
##############################################################################
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.Permissions
import
view_management_screens
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
App.special_dtml
import
DTMLFile
from
Shared.DC.Scripts.Bindings
import
Bindings
...
...
@@ -22,13 +20,7 @@ class BindingsUI(Bindings):
security
=
ClassSecurityInfo
()
manage_options
=
(
{
'label'
:
'Bindings'
,
'action'
:
'ZBindingsHTML_editForm'
},
)
security
.
declareProtected
(
view_management_screens
,
'ZBindingsHTML_editForm'
)
ZBindingsHTML_editForm
=
DTMLFile
(
'dtml/scriptBindings'
,
globals
())
manage_options
=
tuple
()
security
.
declareProtected
(
'Change bindings'
,
'ZBindingsHTML_editAction'
)
def
ZBindingsHTML_editAction
(
self
,
REQUEST
):
...
...
src/Shared/DC/Scripts/Script.py
View file @
18ef29ca
...
...
@@ -15,16 +15,10 @@
This provides generic script support
"""
from
string
import
join
from
urllib
import
quote
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.Permissions
import
view_management_screens
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
App.special_dtml
import
DTMLFile
from
DocumentTemplate.DT_Util
import
TemplateDict
from
OFS.SimpleItem
import
SimpleItem
from
zExceptions
import
Redirect
from
Shared.DC.Scripts.BindingsUI
import
BindingsUI
...
...
@@ -43,19 +37,6 @@ class Script(SimpleItem, BindingsUI):
func_code
=
__code__
=
None
_Bindings_ns_class
=
TemplateDict
security
.
declareProtected
(
view_management_screens
,
'ZScriptHTML_tryForm'
)
ZScriptHTML_tryForm
=
DTMLFile
(
'dtml/scriptTry'
,
globals
())
def
ZScriptHTML_tryAction
(
self
,
REQUEST
,
argvars
):
"""Apply the test parameters.
"""
vv
=
[]
for
argvar
in
argvars
:
if
argvar
.
value
:
vv
.
append
(
"%s=%s"
%
(
quote
(
argvar
.
name
),
quote
(
argvar
.
value
)))
raise
Redirect
(
"%s?%s"
%
(
REQUEST
[
'URL1'
],
join
(
vv
,
'&'
)))
from
Signature
import
_setFuncSignature
InitializeClass
(
Script
)
src/Shared/DC/Scripts/dtml/scriptBindings.dtml
deleted
100644 → 0
View file @
735105da
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<p class="form-help">
Each of the following items describes a piece of information about
this script's calling environment. If you supply a variable name for
an item, or accept the recommended name, the information will
automatically be provided under that name when the script is called.
</p>
<form action="ZBindingsHTML_editAction" method="POST">
<dtml-with getBindingAssignments>
<table cellpadding="2" cellspacing="0" border="0">
<tr class="section-bar">
<td align="left" valign="top" colspan="2">
<div class="form-label">
Context
</div>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-text">
This is the object on which the script is being called, also known as the
"acquisition parent" of the script. This <em>may</em> be the
container, but varies according to the path through which the script is
accessed.
<br /><br />
Recommended value: <code>context</code>
</div>
</td>
<td align="left" valign="top">
<input type="text" name="name_context" value="<dtml-var expr="getAssignedName('name_context', '')" html_quote>">
</td>
</tr>
<tr class="section-bar">
<td align="left" valign="top" colspan="2">
<div class="form-label">
Container
</div>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-text">
This is the <dtml-with expr="aq_inner.aq_parent">&dtml-meta_type;
"&dtml.missing.html_quote-title_or_id;"</dtml-with>, in which this
script is located. This doesn't change unless you move the script.
<br /><br />
Recommended value: <code>container</code>
</div>
</td>
<td align="left" valign="top">
<input type="text" name="name_container" value="<dtml-var expr="getAssignedName('name_container', '')" html_quote>">
</td>
</tr>
<tr class="section-bar">
<td align="left" valign="top" colspan="2">
<div class="form-label">
Script
</div>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-text">
This is the script object "&dtml-title_or_id;" itself.
<br /><br />
Recommended value: <code>script</code>
</div>
</td>
<td align="left" valign="top">
<input type="text" name="name_m_self" value="<dtml-var expr="getAssignedName('name_m_self', '')" html_quote>">
</td>
</tr>
<tr class="section-bar">
<td align="left" valign="top" colspan="2">
<div class="form-label">
Namespace
</div>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-text">
When the script is called from DTML, this is the caller's DTML namespace,
otherwise it is an empty namespace.
<br /><br />
Recommended value: <code>_</code> (underscore character)
</div>
</td>
<td align="left" valign="top">
<input type="text" name="name_ns" value="<dtml-var expr="getAssignedName('name_ns', '')" html_quote>">
</td>
</tr>
<tr class="section-bar">
<td align="left" valign="top" colspan="2">
<div class="form-label">
Subpath
</div>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-text">
When the script is published directly from a URL, this is the
portion of the URL path after the script's name, split at slash separators
into a list of strings. Otherwise, it is an empty list.
<br /><br />
Recommended value: <code>traverse_subpath</code>
</div>
</td>
<td align="left" valign="top">
<input type="text" name="name_subpath" value="<dtml-var expr="getAssignedName('name_subpath', '')" html_quote>">
</td>
</tr>
<tr>
<td align="left" valign="top" colspan="2">
<div class="form-element">
<br />
<input class="form-element" type="submit" name="submit"
value="Save Changes" />
</div>
</td>
</tr>
</table>
</form>
</dtml-with>
<dtml-var manage_page_footer>
src/Shared/DC/Scripts/dtml/scriptTry.dtml
deleted
100644 → 0
View file @
735105da
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<p class="form-help">
Enter variable values to pass to the script in the form below and
click <em>run script</em> to view the result of the call.
</p>
<form action="&dtml-URL1;/ZScriptHTML_tryAction" method="post">
<table cellpadding="2" cellspacing="0" border="0">
<tr class="list-header">
<td align="left" valign="top">
<div class="form-label">
Parameter
</div>
</td>
<td align="left" valign="top">
<div class="form-label">
Value
</div>
</td>
</tr>
<dtml-in ZScriptHTML_tryParams>
<tr>
<td align="left" valign="top">
<input name="argvars.name:records" type="text"
value="&dtml-sequence-item;">
</td>
<td align="left" valign="top">
<input name="argvars.value:records" type="text" value="">
</td>
</tr>
<dtml-else>
<dtml-raise type="Redirect"><dtml-var URL1></dtml-raise>
</dtml-in>
<tr>
<td align="left" valign="top" colspan="2">
<div class="form-element">
<input class="form-element" type="submit" name="submit"
value="Run Script" />
</div>
</td>
</tr>
</table>
</form>
<dtml-var manage_page_footer>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment