Skip to content

Commit

Permalink
ZMI
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho committed May 18, 2018
1 parent 3677858 commit 5dd3042
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 76 deletions.
8 changes: 4 additions & 4 deletions src/OFS/dtml/access.dtml
Expand Up @@ -38,7 +38,7 @@
<table class="table table-hover">
<thead>
<tr>
<th scope="col" colspan="2">Permission</th>
<th scope="col" colspan="2">Permissions</th>
<th scope="col" colspan="<dtml-var expr="_.len(valid_roles)">">Roles</th>
<th class="blank">&nbsp;</th>
</tr>
Expand All @@ -63,9 +63,9 @@
</dtml-if>
<tr>
<td class="zmi-akcquire-check"">
<dtml-unless isTopLevelPrincipiaApplicationObject>
<input type="checkbox" name="acquire_&dtml-hashed_name;" &dtml-acquire; />
</dtml-unless>
<dtml-if isTopLevelPrincipiaApplicationObject>&nbsp;<dtml-else
><input type="checkbox" name="acquire_&dtml-hashed_name;" &dtml-acquire; />
</dtml-if>
</td>
<td class="zmi-akcquire-title nowrap">
<a href="manage_permissionForm?permission_to_manage=&dtml.url_quote-name;">&dtml-name;</a>
Expand Down
90 changes: 39 additions & 51 deletions src/OFS/dtml/properties.dtml
Expand Up @@ -25,7 +25,7 @@
<dtml-var manage_tabs>
</dtml-with>

<main>
<main class="container-fluid">

<form action="<dtml-var "REQUEST.URL1" html_quote>" method="post">
<dtml-if propertyMap>
Expand All @@ -34,9 +34,9 @@ Properties allow you to assign simple values to Zope objects. To change
property values, edit the values and click &quot;Save Changes&quot;.
</p>

<table class="table table-striped table-hover">
<table class="table">
<thead class="thead-light">
<tr>
<tr class="table-sm">
<th scope="col"></th>
<th scope="col">Name</th>
<th scope="col">Value</th>
Expand Down Expand Up @@ -79,38 +79,32 @@ property values, edit the values and click &quot;Save Changes&quot;.
<input type="number"
class="form-control"
name="&dtml-id;:&dtml-type;"
size="35"
value="<dtml-if "hasProperty(id)"><dtml-var "'%s' % getProperty(id)" html_quote></dtml-if>" />
<dtml-elif "type == 'long'">
<input type="number"
class="form-control"
name="&dtml-id;:&dtml-type;"
size="35"
value="<dtml-if "hasProperty(id)"><dtml-var "('%s' % getProperty(id))" html_quote></dtml-if>" />
<dtml-elif "type == 'date' and not _.same_type(getProperty(id), '')
and getProperty(id).timezoneNaive()">
<input type="text"
class="form-control"
name="&dtml-id;:&dtml-charset_tag;&dtml-type;"
size="35"
value="<dtml-var "str(getProperty(id)).rsplit(' ', 1)[0]" html_quote>" />
<dtml-elif "type in ['date', 'float', 'string', 'ustring']">
<input type="text"
class="form-control"
name="&dtml-id;:&dtml-charset_tag;&dtml-type;"
size="35"
value="<dtml-var "getProperty(id)" html_quote>" />
<dtml-elif "type=='boolean'">
<input type="checkbox"
class="form-control"
name="&dtml-id;:&dtml-type;"
size="35"
<dtml-if "getProperty(id)">checked="checked"</dtml-if> />
<dtml-elif "type in ['tokens','utokens']">
<input type="text"
class="form-control"
name="&dtml-id;:&dtml-charset_tag;&dtml-type;"
size="35"
value="<dtml-in "getProperty(id)">&dtml-sequence-item; </dtml-in>" />
<dtml-elif "type in ['text','utext']">
<textarea name="&dtml-id;:&dtml-charset_tag;&dtml-type;"
Expand Down Expand Up @@ -182,7 +176,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
<em>Unknown property type</em>
</dtml-if>
<dtml-else>
<table border="1">
<table>
<tr><td><dtml-var "getProperty(id)" html_quote></td></tr>
</table>
</dtml-if>
Expand All @@ -197,50 +191,45 @@ property values, edit the values and click &quot;Save Changes&quot;.
</tr>

<dtml-if "id=='title' and 'd' in _['sequence-item'].get('mode', 'awd')">
<tr class="table-danger">
<tr">
<td colspan="4">
<strong>Warning:</strong> be aware that removing 'title'
without re-adding it might be dangerous.
<p class="text-danger"><strong>Warning:</strong> be aware that removing 'title'
without re-adding it might be dangerous.</p>
</td>
</tr>
</dtml-if>
</dtml-let>
</dtml-in>
<tr>
<td colspan="2">&nbsp;</td>
<td>
<input name="manage_editProperties:method"
</tr>
</table>

<div class="zmi-controls">
<input name="manage_editProperties:method"
type="submit"
class="btn btn-primary"
value="Save Changes" />
<dtml-if property_extensible_schema__>
<input name="manage_delProperties:method"
<dtml-if property_extensible_schema__>
<input name="manage_delProperties:method"
type="submit"
class="btn btn-secondary"
class="btn btn-primary"
value="Delete" />
</td>
<td>
<dtml-comment>
This needs some community review before exposing it officially.
<input type="submit" name="manage_propertyTypeForm:method"
value="Change Names/Types" />
</dtml-comment>
</td>
<dtml-else>
</td>
<td>&nbsp;</td>
</dtml-if>
</tr>
</table>
<dtml-comment>
This needs some community review before exposing it officially.
<input type="submit" name="manage_propertyTypeForm:method"
value="Change Names/Types" />
</dtml-comment>
</dtml-if>
</div>

<dtml-else>
<p>
Properties allow you to assign simple values to Zope objects. There are
currently no properties defined for this item. <dtml-if
property_extensible_schema__>To add a property, enter a name, type
and value and click the &quot;Add&quot; button.
</dtml-if>
</p>
<p class="form-help">
Properties allow you to assign simple values to Zope objects. There are
currently no properties defined for this item.
<dtml-if property_extensible_schema__>
To add a property, enter a name, type and value and click the
&quot;Add&quot; button.
</dtml-if>
</p>

</dtml-if>
</form>
Expand All @@ -250,14 +239,14 @@ and value and click the &quot;Add&quot; button.
<form action="<dtml-var "REQUEST.URL1" html_quote>/manage_addProperty"
method="post">

<p>
To add a new property, enter a name, type and value for the new
property and click the &quot;Add&quot; button.
</p>
<p class="form-help mt-5">
To add a new property, enter a name, type and value for the new
property and click the &quot;Add&quot; button.
</p>

<table class="table table-striped table-hover">
<table class="table">
<thead class="thead-light">
<tr>
<tr class="table-sm">
<th scope="col">Name</th>
<th scope="col">Value</th>
<th scope="col">Type</th>
Expand All @@ -270,20 +259,19 @@ property and click the &quot;Add&quot; button.
<input type="text"
class="form-control"
name="id:<dtml-var "REQUEST['management_page_charset_tag']">string"
size="30"
value="" />
</td>
<td>
<dtml-if "REQUEST['management_page_charset'] == 'UTF-8'">
<input type="text"
class="form-control"
name="value:UTF-8:ustring"
size="30" />
/>
<dtml-else>
<input type="text"
class="form-control"
name="value:string"
size="30" />
/>
</dtml-if>
</td>
<td>
Expand All @@ -308,7 +296,7 @@ property and click the &quot;Add&quot; button.
</select>
</td>
<td>
<input class="btn btn-outline-secondary" type="submit" name="submit" value=" Add " />
<input class="btn btn-primary" type="submit" name="submit" value=" Add " />
</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion src/OFS/dtml/renameForm.dtml
@@ -1,6 +1,6 @@
<dtml-var manage_page_header>

<main>
<main class="container-fluid">

<h2>Rename Items</h2>

Expand Down
42 changes: 22 additions & 20 deletions src/OFS/zpt/main.zpt
Expand Up @@ -23,15 +23,17 @@
</div>
</form>

<form name="objectItems"
method="post"
tal:define="
<main class="container-fluid">
<form
name="objectItems"
method="post"
tal:define="
ids here/objectIds;
sm modules/AccessControl/SecurityManagement/getSecurityManager"
tal:attributes="action string:${request/URL1}/">
tal:attributes="action string:${request/URL1}/">

<tal:not-empty condition="ids">
<table class="table table-striped table-hover table-sm"
<table class="table table-striped table-hover table-sm objectItems"
tal:condition="ids">
<thead class="thead-light">
<tr>
Expand All @@ -52,13 +54,13 @@
<tbody>
<tr tal:repeat="id ids">
<tal:ob define="ob python:here.get(id)">
<td class="text-right">
<td class="text-right zmi-object_check">
<input type="checkbox"
class="checkbox-list-item"
name="ids:list"
tal:attributes="value id" />
</td>
<td>
<td class="zmi-object_type">
<span title="Broken object"
class="icon-broken"
tal:attributes="class ob/zmi_icon | default;
Expand All @@ -67,58 +69,58 @@
tal:content="ob/meta_type | default">Broken object</span>
</span>
</td>
<td>
<td class="zmi-object_id">
<a tal:attributes="href string:${id}/manage_workspace"
tal:content="id">Id</a>
<span class="badge badge-warning"
tal:condition="ob/wl_isLocked | nothing">
Locked
</span>
</td>
<td>
<td class="zmi-object_title">
<a tal:condition="ob/title|nothing"
tal:attributes="href string:${id}/manage_workspace"
tal:content="ob/title">Title</a>
</td>

<td class="text-right"
<td class="text-right zmi-object_size"
tal:content="python:here.computeSize(ob)">
</td>
</tal:ob>
</tr>
</tbody>
</table>

<div class="form-group"
<div class="form-group zmi-controls"
tal:define="
delete_allowed python:sm.checkPermission('Delete objects', context)"
tal:condition="ids">
<tal:copy-paste condition="not:context/dontAllowCopyAndPaste|nothing">
<input class="btn btn-outline-secondary"
<input class="btn btn-primary"
type="submit"
name="manage_renameForm:method"
value="Rename" />
<input class="btn btn-outline-danger"
<input class="btn btn-primary"
type="submit"
name="manage_cutObjects:method"
value="Cut"
tal:condition="delete_allowed" />
<input class="btn btn-outline-secondary"
<input class="btn btn-primary"
type="submit"
name="manage_copyObjects:method"
value="Copy" />
<input class="btn btn-outline-info"
<input class="btnbtn-primary"
type="submit"
name="manage_pasteObjects:method"
value="Paste"
tal:condition="here/cb_dataValid" />
</tal:copy-paste>
<input class="btn btn-outline-danger"
<input class="btn btn-primary"
type="submit"
name="manage_delObjects:method"
value="Delete"
tal:condition="delete_allowed" />
<input class="btn btn-outline-secondary"
<input class="btn btn-primary"
type="submit"
name="manage_importExportForm:method"
value="Import/Export"
Expand All @@ -133,19 +135,19 @@
</div>
<div class="form-group">
<tal:copy-paste condition="not:context/dontAllowCopyAndPaste|nothing">
<input class="btn btn-outline-secondary"
<input class="btn btn-primary"
type="submit"
name="manage_pasteObjects:method"
value="Paste"
tal:condition="here/cb_dataValid" />
</tal:copy-paste>
<input class="btn btn-outline-secondary"
<input class="btn btn-primary"
type="submit"
name="manage_importExportForm:method"
value="Import/Export"
tal:condition="python:sm.checkPermission('Import/Export objects', context)" />
</div>
</tal:empty>
</form>

</main>
<tal:footer replace="structure here/manage_page_footer" />

0 comments on commit 5dd3042

Please sign in to comment.