Skip to content

Commit

Permalink
chore: zpretty PT
Browse files Browse the repository at this point in the history
  • Loading branch information
gforcada committed Apr 8, 2023
1 parent e10bfa1 commit b14b2bb
Showing 1 changed file with 116 additions and 64 deletions.
180 changes: 116 additions & 64 deletions Products/CMFDiffTool/zpt/editCMFDiffTool.zpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<html tal:omit-tag="">
<span tal:replace="structure here/manage_page_header">Header</span>
<span tal:define="manage_tabs_message options/manage_tabs_message | nothing"
tal:replace="structure here/manage_tabs">Tabs</span>
<span tal:define="
manage_tabs_message options/manage_tabs_message | nothing;
"
tal:replace="structure here/manage_tabs"
>Tabs</span>


<style>
Expand All @@ -12,91 +15,140 @@

#diffTable td { padding: 1ex; }

.lastrow td {
border-bottom: 1px solid black;
.lastrow td {
border-bottom: 1px solid black;
}
</style>

<h3>Differences by Type</h3>

<form action="manage_addDiffField" method="post">

<form action="manage_addDiffField"
method="post"
>
<table>
<tr>
<th>Portal Type</th>
<th>Field name</th>
<th>Diff Type</th>
<th>Portal Type</th>
<th>Field name</th>
<th>Diff Type</th>
</tr>
<tr>
<td>
<select name="pt_name">
<option tal:repeat="pt here/portal_types/listTypeInfo"
tal:attributes="value pt/id;"
tal:content="pt/id">[group]</option>
</select>
</td>
<td>
<input type="text" name="field" />
</td>
<td>
<select name="diff">
<option tal:repeat="d here/listDiffTypes"
tal:attributes="value d;"
tal:content="d">[group]</option>
</select>
</td>
<td>
<input type="submit" name="add" value="Add field" />
</td>
<td>
<select name="pt_name">
<option tal:repeat="pt here/portal_types/listTypeInfo"
tal:content="pt/id"
tal:attributes="
value pt/id;
"
>[group]</option>
</select>
</td>
<td>
<input name="field"
type="text"
/>
</td>
<td>
<select name="diff">
<option tal:repeat="d here/listDiffTypes"
tal:content="d"
tal:attributes="
value d;
"
>[group]</option>
</select>
</td>
<td>
<input name="add"
type="submit"
value="Add field"
/>
</td>
</tr>
</table>
</form>

<form action="." method="post">
<form action="."
method="post"
>

<table id="diffTable">
<thead>
<tr>
<th>Portal Type</th>
<th>Field</th>
<th>Diff Type</th>
<th>Delete</th>
</tr>
<tr>
<th>Portal Type</th>
<th>Field</th>
<th>Diff Type</th>
<th>Delete</th>
</tr>
</thead>
<tal:p_type tal:repeat="pt_name here/portal_types/listContentTypes">
<tal:defs tal:define="diff_map python:here.getDiffForPortalType(pt_name)" tal:condition="diff_map">
<tr tal:repeat="pair diff_map/items" tal:attributes="class python:test(repeat['pair'].end, 'lastrow', nothing)">
<tal:defs tal:define="field python:pair[0]; difftype python:pair[1];">
<tal:defs tal:define="
diff_map python:here.getDiffForPortalType(pt_name);
"
tal:condition="diff_map"
>
<tr tal:repeat="pair diff_map/items"
tal:attributes="
class python:test(repeat['pair'].end, 'lastrow', nothing);
"
>
<tal:defs tal:define="
field python:pair[0];
difftype python:pair[1];
">

<td class="form-label">
<a tal:condition="repeat/pair/start"
tal:attributes="href string:../portal_types/$pt_name/manage_workspace"
tal:content="pt_name">[pt_name]</a>
</td>
<td class="form-label">
<a tal:condition="repeat/pair/start"
tal:content="pt_name"
tal:attributes="
href string:../portal_types/$pt_name/manage_workspace;
"
>[pt_name]</a>
</td>

<td class="form-label" tal:content="field">[field]</td>
<td class="form-element">
<select name="updates.diff:records">
<option tal:repeat="d here/listDiffTypes"
tal:content="d"
tal:attributes="value d;
selected python:test(d == difftype, 'selected' ,nothing);">
<td class="form-label"
tal:content="field"
>[field]</td>
<td class="form-element">
<select name="updates.diff:records">
<option tal:repeat="d here/listDiffTypes"
tal:content="d"
tal:attributes="
value d;
selected python:test(d == difftype, 'selected' ,nothing);
"
>
[group]
</option>
</select>
</td>
<td align="center">
<input type="hidden" name="updates.pt_name:records" tal:attributes="value pt_name" />
<input type="hidden" name="updates.field:records" tal:attributes="value field" />
<input type="checkbox" name="updates.delete:records" />
</td>
</option>
</select>
</td>
<td align="center">
<input name="updates.pt_name:records"
type="hidden"
tal:attributes="
value pt_name;
"
/>
<input name="updates.field:records"
type="hidden"
tal:attributes="
value field;
"
/>
<input name="updates.delete:records"
type="checkbox"
/>
</td>
</tal:defs>
</tr>
</tal:defs>
</tr>
</tal:defs>
</tal:p_type>
</table>

<input type="submit" name="manage_editDiffFields:action" value="Update" />

<input name="manage_editDiffFields:action"
type="submit"
value="Update"
/>
</form>

<span tal:replace="structure here/manage_page_footer">Footer</span>
</html>

0 comments on commit b14b2bb

Please sign in to comment.