Skip to content

Commit

Permalink
refactored python_script templates, cleaned white-space
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Frank Hoffmann authored and Dr. Frank Hoffmann committed Jun 29, 2018
1 parent bd380a5 commit 7a0bbb9
Show file tree
Hide file tree
Showing 14 changed files with 179 additions and 194 deletions.
2 changes: 1 addition & 1 deletion src/OFS/DTMLDocument.py
Expand Up @@ -171,7 +171,7 @@ def addDTMLDocument(self, id, title='', file='', REQUEST=None, submit=None):
u = self.DestinationURL()
except Exception:
u = REQUEST['URL1']
if submit == " Add and Edit ":
if submit == "Add and Edit":
u = "%s/%s" % (u, quote(id))
REQUEST.RESPONSE.redirect(u + '/manage_main')
return ''
2 changes: 1 addition & 1 deletion src/OFS/DTMLMethod.py
Expand Up @@ -433,7 +433,7 @@ def addDTMLMethod(self, id, title='', file='', REQUEST=None, submit=None):
u = self.DestinationURL()
except Exception:
u = REQUEST['URL1']
if submit == " Add and Edit ":
if submit == "Add and Edit":
u = "%s/%s" % (u, quote(id))
REQUEST.RESPONSE.redirect(u + '/manage_main')
return ''
2 changes: 1 addition & 1 deletion src/OFS/dtml/addOrderedFolder.dtml
Expand Up @@ -30,7 +30,7 @@
</div>

<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value=" Add " />
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
</div>

</form>
Expand Down
44 changes: 21 additions & 23 deletions src/OFS/dtml/cacheable.dtml
Expand Up @@ -5,39 +5,37 @@

<form action="&dtml-absolute_url;" method="post">

<div class="form-group row">
<label for="manager_id" class="form-label col-sm-3 col-md-2">New Cache this object using</label>
<div class="col-sm-9 col-md-10">
<div class="input-group">
<div class="input-group-prepend">
<input class="btn btn-primary" type="submit" name="ZCacheable_setManagerId:method" value="Save Changes" />
</div>
<select class="form-control" id="manager_id" name="manager_id">
<option value="">None</option>
<dtml-in ZCacheable_getManagerIds mapping
><option value="&dtml-id;" <dtml-if expr="id == ZCacheable_getManagerId()">selected="selected"</dtml-if
>>&dtml-id;<dtml-if title>(&dtml-title;)</dtml-if></option>
</dtml-in>
</select>
<div class="form-group row mt-4 mb-4" title="New Cache this object using">
<div class="input-group col-12">
<div class="input-group-prepend">
<span class="input-group-text">New Cache&nbsp;<span class="d-none d-sm-block">this object using </span></span>
</div>
<select class="form-control" id="manager_id" name="manager_id">
<option value="">None</option>
<dtml-in ZCacheable_getManagerIds mapping
><option value="&dtml-id;" <dtml-if expr="id == ZCacheable_getManagerId()">selected="selected"</dtml-if
>>&dtml-id;<dtml-if title>(&dtml-title;)</dtml-if></option>
</dtml-in>
</select>
<div class="input-group-append">
<input class="btn btn-primary" style="width:8rem" type="submit" name="ZCacheable_setManagerId:method" value="Save Changes" />
</div>
</div>
</div>


<dtml-if ZCacheable_getManagerURL>
<div class="form-group row">
<label for="ZCacheable_invalidate:method" class="form-label col-sm-3 col-md-2">
<a href="&dtml-ZCacheable_getManagerURL;/manage_main">Cache Settings</a>
</label>
<div class="col-sm-9 col-md-10">
<input class="btn btn-primary" type="submit" name="ZCacheable_invalidate:method" value="Invalidate" />
<div class="form-group row mt-4 mb-4" title="Revise Cache Settings">
<div class="input-group col-12">
<span class="form-control input-group-text"><a href="&dtml-ZCacheable_getManagerURL;/manage_main">Cache Settings ...</a></span>
<div class="input-group-append">
<input class="btn btn-primary" style="width:8rem" type="submit" name="ZCacheable_invalidate:method" value="Invalidate" />
</div>
</div>
</div>
</dtml-if>

<div class="mt-5">
<dtml-var ZCacheable_configHTML>
</div>
<div class="mt-5"><dtml-var ZCacheable_configHTML></div>

</form>

Expand Down
23 changes: 10 additions & 13 deletions src/OFS/dtml/cmassoc.dtml
Expand Up @@ -4,8 +4,8 @@

<main class="container-fluid">

<dtml-if show_results
><dtml-if results>
<dtml-if show_results>
<dtml-if results>

<p class="form-text">
Select which objects should be cached using this cache manager. Only
Expand Down Expand Up @@ -45,9 +45,9 @@

<form target="&dtml-URL1;" method="post">

<div class="form-group row">
<div class="form-group row mt-4">
<label for="require_assoc" class="form-label col-sm-3 col-md-2">Number of exceptions to keep</label>
<div class=" col-sm-3 col-md-10">
<div class=" col-sm-9 col-md-10">
<select class="form-control" id="require_assoc" name="require_assoc:int">
<option value="0">All</option>
<option value="1">Associated with this cache manager </option>
Expand All @@ -57,7 +57,7 @@

<div class="form-group row">
<label for="meta_types" class="form-label col-sm-3 col-md-2">Of the type(s)</label>
<div class=" col-sm-3 col-md-10">
<div class=" col-sm-9 col-md-10">
<select class="form-control" multiple="multiple" id=meta_types" name="meta_types:list" size="5">
<option value="" selected>All</option>
<dtml-in all_meta_types mapping sort=name>
Expand All @@ -67,16 +67,13 @@
</div>
</div>

<div class="form-group row">
<label for="require_assoc" class="form-label col-sm-3 col-md-2">Search subfolders</label>
<div class="col-sm-3 col-md-10">
<input type="form-check-input" name="subfolders:int" value="1" checked="checked" />
<div class="zmi-controls mt-5">
<input class="btn btn-primary" type="submit" name="ZCacheManager_locate:method" value="Locate">
<div class="btn ml-3">
<input class="form-check-input" type="checkbox" name="subfolders:int" value="1" checked="checked" />
<input type="hidden" name="subfolders:int" value="0" />
<label for="require_assoc" class="form-label">Search subfolders</label>
</div>
</div>

<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="ZCacheManager_locate:method" value="Locate">
</div

</form>
Expand Down
4 changes: 2 additions & 2 deletions src/OFS/dtml/documentAdd.dtml
Expand Up @@ -40,8 +40,8 @@
</div>

<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value=" Add " />
<input class="btn btn-primary" type="submit" name="submit" value=" Add and Edit " />
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
<input class="btn btn-primary" type="submit" name="submit" value="Add and Edit" />
</div>

</form>
Expand Down
2 changes: 1 addition & 1 deletion src/OFS/dtml/folderAdd.dtml
Expand Up @@ -30,7 +30,7 @@
</div>

<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value=" Add " />
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
</div>

</form>
Expand Down
2 changes: 1 addition & 1 deletion src/OFS/dtml/listLocalRoles.dtml
Expand Up @@ -89,7 +89,7 @@
</table>

<div class="zmi-controls mt-3">
<input class="btn btn-primary" type="submit" name="submit" value=" Add " />
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
</div>

</form>
Expand Down
6 changes: 3 additions & 3 deletions src/OFS/dtml/methodAdd.dtml
Expand Up @@ -36,13 +36,13 @@
<div class="form-group row">
<label for="file" class="form-label col-sm-3 col-md-2">File</label>
<div class="col-sm-9 col-md-10">
<input type="file" id="file" class="form-control form-control-file" name="file:string" size="25" value="" />
<input type="file" id="file" class="form-control form-control-file" name="file:string" value="" />
</div>
</div>

<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value=" Add " />
<input class="btn btn-secondary" type="submit" name="submit" value=" Add and Edit " />
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
<input class="btn btn-primary" type="submit" name="submit" value="Add and Edit" />
</div>

</form>
Expand Down
2 changes: 1 addition & 1 deletion src/OFS/dtml/propertysheets.dtml
Expand Up @@ -12,7 +12,7 @@
><dtml-if id
><tr>
<td>
<dtml-if expr="isDeletable(id)"><input type=checkbox name="ids:list" value="&dtml-id;"></dtml-if>
<dtml-if expr="isDeletable(id)"><input type="checkbox" name="ids:list" value="&dtml-id;"></dtml-if>
</td>
<td>
<a href="&dtml-id;/manage">&dtml-id; <dtml-if xml_namespace>(<dtml-var xml_namespace>)</dtml-if></a>
Expand Down
2 changes: 1 addition & 1 deletion src/Products/PageTemplates/ZopePageTemplate.py
Expand Up @@ -408,7 +408,7 @@ def manage_addPageTemplate(self, id, title='', text='', encoding='utf-8',
zpt = getattr(self, id)

if RESPONSE:
if submit == " Add and Edit ":
if submit == "Add and Edit":
RESPONSE.redirect(zpt.absolute_url() + '/pt_editForm')
else:
RESPONSE.redirect(self.absolute_url() + '/manage_main')
Expand Down
4 changes: 2 additions & 2 deletions src/Products/PageTemplates/www/ptAdd.zpt
Expand Up @@ -41,8 +41,8 @@


<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value=" Add " />
<input class="btn btn-primary" type="submit" name="submit" value=" Add and Edit " />
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
<input class="btn btn-primary" type="submit" name="submit" value="Add and Edit" />
</div>

</form>
Expand Down

0 comments on commit 7a0bbb9

Please sign in to comment.