Skip to content

Commit

Permalink
ZMI: used flexbox for twolist macro
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho committed Jun 29, 2021
1 parent 960a0c4 commit f36cf57
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 154 deletions.
17 changes: 7 additions & 10 deletions src/Products/PluggableAuthService/plugins/www/zgGroups.zpt
Expand Up @@ -202,16 +202,13 @@
<input type="hidden" name="group_id"
tal:attributes="value group_id" />
<input type="hidden" name="assign" value="1" />
<div class="form-row align-items-center">
<div class="col-2">
<div class="form-label">Principal ID</div>
</div>
<div class="col-8">
<input type="text" name="search_id" value="" class="form-control"
tal:attributes="value search_id" />
</div>
<div class="col-2">
<input type="submit" class="btn btn-primary zmi-patch" value=" Search " />
<div class="form-row align-items-center py-4 px-2">
<div class="input-group">
<input class="col-10 form-control"
placeholder="Enter Principal ID"
type="text" name="search_id" value=""
tal:attributes="value search_id" />
<input type="submit" class="col-2 btn btn-primary zmi-patch" value=" Search " />
</div>
</div>
</form>
Expand Down
17 changes: 7 additions & 10 deletions src/Products/PluggableAuthService/plugins/www/zrRoles.zpt
Expand Up @@ -207,16 +207,13 @@
<input type="hidden" name="role_id"
tal:attributes="value role_id" />
<input type="hidden" name="assign" value="1" />
<div class="form-row align-items-center">
<div class="col-2">
<div class="form-label">Principal ID</div>
</div>
<div class="col-8">
<input type="text" name="search_id" value="" class="form-control"
tal:attributes="value search_id" />
</div>
<div class="col-2">
<input type="submit" class="btn btn-primary zmi-patch" value=" Search " />
<div class="form-row align-items-center py-4 px-2">
<div class="input-group">
<input class="col-10 form-control"
placeholder="Enter Principal ID"
type="text" name="search_id" value=""
tal:attributes="value search_id" />
<input type="submit" class="col-2 btn btn-primary zmi-patch" value=" Search " />
</div>
</div>
</form>
Expand Down
232 changes: 118 additions & 114 deletions src/Products/PluggableAuthService/www/pasSearch.zpt
Expand Up @@ -15,125 +15,129 @@

<form method="get" action=""
tal:attributes="action string:${my_url}/manage_search">
<table width="98%">
<tr>
<th align="left"> Search on </th>
<th align="left"> Search term </th>
<th align="left"> Exact match </th>
<th align="left"> Max results </th>
<th align="left"> Sort on </th>
<th> &nbsp; </th>
</tr>
<tr>
<td class="form-element">
<select name="s_param">
<option value="login"> Login </option>
<option value="id"> User ID </option>
</select>
</td>
<td class="form-element">
<input type="text" width="30" name="s_term" />
</td>
<td class="form-element">
<input type="checkbox" name="exact_match:int" value="1" />
</td>
<td class="form-element">
<input type="text" size="4" name="max_results" />
</td>
<td class="form-element">
<select name="sort_by">
<option value="login"> Login </option>
<option value="id"> User ID </option>
</select>
</td>
<td class="form-element">
<input type="submit" value=" Search " />
</td>
</tr>
<table class="table Xtable-sm mb-5 Xtable-borderless">
<thead>
<tr>
<th scope="col" class="pl-3">Search on</th>
<th scope="col">Search term</th>
<th scope="col">Exact match</th>
<th scope="col">Max results</th>
<th scope="col">Sort on</th>
<th scope="col">&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td class="pl-3">
<select class="form-control" name="s_param">
<option value="login"> Login </option>
<option value="id"> User ID </option>
</select>
</td>
<td>
<input class="form-control" type="text" name="s_term"
placeholder="Enter search term" />
</td>
<td class="pl-4" style="vertical-align:middle">
<input type="checkbox" name="exact_match:int" value="1" />
</td>
<td>
<input class="form-control" type="text" size="4" name="max_results" />
</td>
<td>
<select class="form-control" name="sort_by">
<option value="login">Login</option>
<option value="id">User ID</option>
</select>
</td>
<td>
<input class="btn btn-primary" type="submit" value=" Search " />
</td>
</tr>
</tbody>
</table>
</form>

<br clear="all" /><br />

<div tal:condition="python:s_param and s_term">


<div tal:define="id python: s_param=='id' and s_term or '';
login python: s_param=='login' and s_term or '';
match request/exact_match|options/exact_match|nothing;
sort_by request/sort_by|options/sort_by|nothing;
max request/max_results|options/max_results|nothing;
results python: here.searchUsers( id=id
, login=login
, exact_match=match
, sort_by=sort_by
, max_results=max
);
batch python: here.resultsBatch(results, request);
b_len batch/sequence_length;
b_start batch/start;
b_end batch/end;"
tal:omit-tag="">
<div tal:condition="python:s_param and s_term">
<div tal:define="id python: s_param=='id' and s_term or '';
login python: s_param=='login' and s_term or '';
match request/exact_match|options/exact_match|nothing;
sort_by request/sort_by|options/sort_by|nothing;
max request/max_results|options/max_results|nothing;
results python: here.searchUsers( id=id
, login=login
, exact_match=match
, sort_by=sort_by
, max_results=max
);
batch python: here.resultsBatch(results, request);
b_len batch/sequence_length;
b_start batch/start;
b_end batch/end;"
tal:omit-tag="">
<div class="form-help">
<span class="form-label"
tal:content="string: Results ${b_start}-${b_end} out of ${b_len} matches for search term '${s_term}'">
30 results for 'login=foo'
</span>
<span class="form-label"
tal:condition="request/previous_batch_url|nothing">
<a href=""
tal:attributes="href request/previous_batch_url">
&lt;&lt; Previous
</a>
</span>
<span class="form-label"
tal:condition="request/next_batch_url|nothing">
<a href=""
tal:attributes="href request/next_batch_url">
&nbsp;&nbsp;Next &gt;&gt;
</a>
</span>
</div>

<table class="table table-striped table-hover table-sm">

<div class="form-help">
<span class="form-label"
tal:content="string: Results ${b_start}-${b_end} out of ${b_len} matches for search term '${s_term}'">
30 results for 'login=foo'
</span>
<span class="form-label"
tal:condition="request/previous_batch_url|nothing">
<a href=""
tal:attributes="href request/previous_batch_url">
&lt;&lt; Previous
</a>
</span>
<span class="form-label"
tal:condition="request/next_batch_url|nothing">
<a href=""
tal:attributes="href request/next_batch_url">
&nbsp;&nbsp;Next &gt;&gt;
</a>
</span>
<tal:block tal:condition="results">
<thead>
<tr>
<th class="pl-3" scope="col">Internal ID</th>
<th scope="col">Login</th>
<th scope="col">User ID</th>
<th scope="col">Source Plugin</th>
<th scope="col">&nbsp;</th>
</tr>
</thead>
<tbody>
<tr tal:repeat="res batch"
tal:attributes="class python: repeat['res'].odd() and 'row-normal' or default">
<td class="pl-3" tal:content="res/id">Internal ID</td>
<td tal:content="res/login">ID</td>
<td tal:content="res/userid">Login</td>
<td tal:content="res/pluginid|nothing">Plugin ID</td>
<td>
<a href=""
tal:condition="res/editurl|nothing"
tal:attributes="href res/editurl|nothing">
<i class="far fa-edit"></i>
Edit
</a>
</td>
</tr>
</tbody>
</tal:block>
<tal:block tal:condition="not: results">
<tbody>
<tr>
<td class="zmi-object-id"> No results found. </td>
</tr>
</tbody>
</tal:block>

</table>
</div>

<table class="table table-striped table-hover table-sm">

<tbody tal:condition="results">
<tr>
<th scope="col" class="zmi-object-id"> Internal ID </th>
<th scope="col" class="zmi-object-id"> Login </th>
<th scope="col" class="zmi-object-id"> User ID </th>
<th scope="col" class="zmi-object-id"> Source Plugin </th>
<td>&nbsp;</td>
</tr>

<tr tal:repeat="res batch"
tal:attributes="class python: repeat['res'].odd() and 'row-normal' or default">
<td class="zmi-object-id" tal:content="res/id"> Internal ID </td>
<td class="zmi-object-id" tal:content="res/login"> ID </td>
<td class="zmi-object-id" tal:content="res/userid"> Login </td>
<td class="zmi-object-id" tal:content="res/pluginid|nothing"> Plugin ID </td>
<td class="zmi-object-id">
<a href=""
tal:condition="res/editurl|nothing"
tal:attributes="href res/editurl|nothing">
Edit
</a>
</td>
</tr>
</tbody>

<tbody tal:condition="not: results">
<tr>
<td class="zmi-object-id"> No results found. </td>
</tr>
</tbody>

</table>

</div>

</div>

</form>
</main>

<h1 tal:replace="structure here/manage_page_footer"> PAGE FOOTER </h1>
44 changes: 24 additions & 20 deletions src/Products/PluggableAuthService/www/two_lists.zpt
Expand Up @@ -31,54 +31,58 @@ by the including template:

</tal:comment>

<table class="table table-sm table-borderless"
metal:define-macro="two_lists"
>
<div metal:define-macro="two_lists">

<tal:block metal:define-slot="hidden_vars" />

<tr>
<div class="row align-items-center">

<td class="col-5">
<div align="center">
<div class="col-5">
<label class="d-block text-center" for="items_available">
<span metal:define-slot="left_title">Available</span>
</div>
<select size="10" name="items:list" class="form-control"
</label>
<select size="10" id="items_available" name="items:list" class="form-control"
multiple="multiple"
tal:attributes="name string:${left_name}:list" >
<option tal:repeat="item left_list"
tal:attributes="value python:item[0]"
tal:content="python: item[1]"/>
</select>
</td>
<td class="text-center align-middle col-1">
</div>

<div class="col-1 text-center" tal:attributes="class python:right_is_ordered and 'col-1 text-center' or 'col-2 text-center'">
<button class="btn btn-sm btn-light" name="left_to_right:method"
tal:attributes="name string:${left_to_right}:method"><i class="far fa-arrow-alt-circle-right fa-2x"></i></button>
<br/>
<button class="btn btn-sm btn-light" name="right_to_left:method"
tal:attributes="name string:${right_to_left}:method"><i class="far fa-arrow-alt-circle-left fa-2x"></i></button>
</td>
<td class="col-5" tal:attributes="class python:right_is_ordered and 'col-4' or 'col-5'">
<div align="center">
</div>

<div class="col-5">
<label class="d-block text-center" for="items_active">
<span metal:define-slot="right_title">Active</span>
</div>
<select size="10" name="items:list" class="form-control"
</label>
<select size="10" id="items_active" name="items:list" class="form-control"
multiple="multiple"
tal:attributes="name string:${right_name}:list" >
<option tal:repeat="item right_list"
tal:attributes="value python:item[0]"
tal:content="python: item[1]"/>
</select>
</td>
<td tal:condition="right_is_ordered | nothing" class="col-1">
</div>

<div tal:condition="right_is_ordered | nothing" class="col-1">
<button class="btn btn-sm btn-light" name="move_up:method"
tal:attributes="name string:${move_up}:method"><i class="far fa-arrow-alt-circle-up fa-2x"></i></button>
<br/>
<button class="btn btn-sm btn-light" name="move_down:method"
tal:attributes="name string:${move_down}:method"><i class="far fa-arrow-alt-circle-up fa-2x"></i></button>
</td>
</tr>
</table>
</div>

</div>

</div>

</form>

</body>
Expand Down

0 comments on commit f36cf57

Please sign in to comment.