Skip to content

Commit

Permalink
improvement: {persistent_filter} is positioned vertically centered an…
Browse files Browse the repository at this point in the history
…d on right (LMS+ #620)
  • Loading branch information
chilek committed Sep 8, 2018
1 parent 09df45a commit a831b58
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 20 deletions.
10 changes: 9 additions & 1 deletion img/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1983,11 +1983,19 @@ table.dataTable thead tr:last-child th {
.chosen-container-single .chosen-drop {
border-radius: unset;
}
div.lms-ui-filter-container {
display: flex;
justify-content: space-between;
align-items: center;
}
div.lms-ui-filter-container div.lms-ui-filter-definition {
display: flex;
width: 80%;
}
div.lms-ui-persistent-filter {
display: flex;
justify-content: flex-end;
align-items: center;
float: right;
}
div.lms-ui-persistent-filter > * {
margin: 2px;
Expand Down
11 changes: 10 additions & 1 deletion img/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -1724,11 +1724,20 @@ table.dataTable {
}
}

div.lms-ui-filter-container {
display: flex;
justify-content: space-between;
align-items: center;
div.lms-ui-filter-definition {
display: flex;
width: 80%;
}
}

div.lms-ui-persistent-filter {
display: flex;
justify-content: flex-end;
align-items: center;
float: right;
& > * {
margin: 2px;
}
Expand Down
9 changes: 4 additions & 5 deletions lib/SmartyPlugins/function.persistent_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ function smarty_function_persistent_filter($params, $template) {
return '
<div class="lms-ui-persistent-filter">
<input class="lms-ui-filter-action" type="hidden" value="apply">
<input class="lms-ui-filter-name" type="hidden" value="">
<button class="lms-ui-button lms-ui-button-icon lms-ui-filter-modify-button'
. ($persistent_filter == -1 || empty($persistent_filter) ? ' lms-ui-button-disabled' : '') . '" title="'
. trans("<!filter>Update") . '">
</button>
<select class="lms-ui-filter-selection lms-ui-combobox" title="' . trans("<!filter>Select filter") . '">
<option value="-1">' . trans("<!filter>- none -") . '</option>
' . $filters . '
</select>
<button class="lms-ui-button lms-ui-button-icon lms-ui-filter-modify-button'
. ($persistent_filter == -1 || empty($persistent_filter) ? ' lms-ui-button-disabled' : '') . '" title="'
. trans("<!filter>Update") . '">
</button>
<button class="lms-ui-button lms-ui-button-icon lms-ui-filter-delete-button'
. ($persistent_filter == -1 || empty($persistent_filter) ? ' lms-ui-button-disabled' : '') . '" title="'
. trans("<!filter>Delete") . '">
Expand Down
27 changes: 16 additions & 11 deletions templates/default/customer/customerlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ <H1>{$layout.pagetitle}</H1>
{block name="customerlist-list-filters"}
<TR>
<TD colspan="{$number_of_table_columns}" class="nobr">
<div class="lms-ui-filter-container">
<div class="lms-ui-filter-definition">
<span class="bold">{trans("Filter:")}</span> {trans("Customers:")}
<SELECT SIZE="1" NAME="s" ONCHANGE="document.choosefilter.submit();">
<OPTION VALUE="0"{if $filter.state == 0} SELECTED{/if}>{trans("- all customers -")}</OPTION>
Expand Down Expand Up @@ -117,18 +119,21 @@ <H1>{$layout.pagetitle}</H1>
<input type="hidden" name="ng" value="">
{/if}

{trans("Assigments:")}
<select size="1" name="assigments" onchange="document.choosefilter.submit();" {if $filter.assignments}class="active"{/if}>
<option value="0" {if $filter.assignments eq '0'} selected {/if}>{trans('- all -')}</option>
<option value="7" {if $filter.assignments eq '7'} selected {/if}>{trans('expire in $a days', 7)}</option>
<option value="14" {if $filter.assignments eq '14'} selected {/if}>{trans('expire in $a days', 14)}</option>
<option value="30" {if $filter.assignments eq '30'} selected {/if}>{trans('expire in $a days', 30)}</option>
<option value="-1" {if $filter.assignments eq '-1'} selected {/if}>{trans('without end date')}</option>
<option value="-2" {if $filter.assignments eq '-2'} selected {/if}>{trans('active')}</option>
<option value="-3" {if $filter.assignments eq '-3'} selected {/if}>{trans('active, with invoice')}</option>
<option value="-4" {if $filter.assignments eq '-4'} selected {/if}>{trans('suspended')}</option>
</select>
{trans("Assigments:")}
<select size="1" name="assigments" onchange="document.choosefilter.submit();" {if $filter.assignments}class="active"{/if}>
<option value="0" {if $filter.assignments eq '0'} selected {/if}>{trans('- all -')}</option>
<option value="7" {if $filter.assignments eq '7'} selected {/if}>{trans('expire in $a days', 7)}</option>
<option value="14" {if $filter.assignments eq '14'} selected {/if}>{trans('expire in $a days', 14)}</option>
<option value="30" {if $filter.assignments eq '30'} selected {/if}>{trans('expire in $a days', 30)}</option>
<option value="-1" {if $filter.assignments eq '-1'} selected {/if}>{trans('without end date')}</option>
<option value="-2" {if $filter.assignments eq '-2'} selected {/if}>{trans('active')}</option>
<option value="-3" {if $filter.assignments eq '-3'} selected {/if}>{trans('active, with invoice')}</option>
<option value="-4" {if $filter.assignments eq '-4'} selected {/if}>{trans('suspended')}</option>
</select>

</div>
{persistent_filter}
</div>
</TD>
</TR>
{/block}
Expand Down
6 changes: 5 additions & 1 deletion templates/default/event/eventlistfilter.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
</TR>
<TR>
<TD colspan="5" class="nobr no-print">
<div class="lms-ui-filter-container">
<div class="lms-ui-filter-definition">
<FORM method="POST" action="?m=eventlist" name="filter">
<INPUT type="submit" class="hiddenbtn">
<INPUT type="HIDDEN" name="m" value="eventlist">
Expand Down Expand Up @@ -57,8 +59,10 @@
<OPTION value="0"{if $filter.closed == "0"} selected{/if}>{trans("opened<!plural:event>")}</OPTION>
<OPTION value="1"{if $filter.closed == "1"} selected{/if}>{trans("closed<!plural:event>")}</OPTION>
</SELECT>
{persistent_filter}
</FORM>
</div>
{persistent_filter}
</div>
</TD>
</TR>
{/block}
5 changes: 5 additions & 0 deletions templates/default/node/nodelist.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ <H1>{$layout.pagetitle}</H1>
</TR>
<TR>
<TD colspan="5">
<div class="lms-ui-filter-container">
<div class="lms-ui-filter-definition">

<SPAN class="bold">{trans("Filter:")}</SPAN>&nbsp;
<SPAN class="nobr">{trans("Status:")}
<SELECT SIZE="1" NAME="s" ONCHANGE="document.choosefilter.submit();">
Expand Down Expand Up @@ -105,7 +108,9 @@ <H1>{$layout.pagetitle}</H1>
{else}
<input type="hidden" name="p" value="-1">
{/if}
</div>
{persistent_filter}
</div>
</TD>
</TR>
{if $pagination->getTotal() != 0}
Expand Down
6 changes: 5 additions & 1 deletion templates/default/rt/rtfilter.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<TR>
<TD colspan="10">
<div class="lms-ui-filter-container">
<div class="lms-ui-filter-definition">
<FORM method="GET" action="?m=rtqueueview" name="filter">
<INPUT type="submit" class="hiddenbtn">
<INPUT type="HIDDEN" name="m" value="rtqueueview">
Expand Down Expand Up @@ -115,8 +117,10 @@
<option value="{$smarty.const.RT_RIGHT_INDICATOR}" {if $filter.rights == $smarty.const.RT_RIGHT_INDICATOR} selected{/if}>{trans("yes")}</option>
</SELECT>
</label>
{persistent_filter}
</FORM>
</div>
{persistent_filter}
</div>
</TD>
</TR>
{/block}

0 comments on commit a831b58

Please sign in to comment.