Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
function getDefaultSettings() {
return _.cloneDeep({
show_count: false,
expose_limit: false
expose_limit: false,
loadmore: false
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,34 @@
<input ng-if="$ctrl.display.settings.limit" type="number" min="1" step="1" class="form-control four" ng-model="$ctrl.display.settings.limit" ng-model-options="{updateOn: 'blur'}" ng-change="$ctrl.onChangeLimit()">
</div>
<div class="form-group" ng-if="$ctrl.display.settings.pager">
<label for="crm-search-admin-display-limit">
{{:: ts('Page Size') }}
</label>
<input id="crm-search-admin-display-limit" type="number" min="1" step="1" class="form-control four" ng-model="$ctrl.display.settings.limit" ng-model-options="{updateOn: 'blur'}" ng-change="$ctrl.onChangeLimit()">
<div class="input-inline form-control">
<label for="crm-search-admin-display-limit">
{{:: ts('Page Size') }}
</label>
<input id="crm-search-admin-display-limit" type="number" min="1" step="1" class="form-control four" ng-model="$ctrl.display.settings.limit" ng-model-options="{updateOn: 'blur'}" ng-change="$ctrl.onChangeLimit()">
</div>
<div class="checkbox-inline form-control">
<label>
<input type="checkbox" ng-model="$ctrl.display.settings.pager.loadmore" >
<span>{{:: ts('Load More') }}</span>
</label>
</div>
<div class="checkbox-inline form-control" ng-if="!$ctrl.display.settings.pager.loadmore">
<label>
<input type="checkbox" ng-model="$ctrl.display.settings.pager.expose_limit" >
<span>{{:: ts('Adjustable Page Size') }}</span>
</label>
</div>
<div class="checkbox-inline form-control">
<label>
<input type="checkbox" ng-model="$ctrl.display.settings.pager.show_count" >
<span>{{:: ts('Show Count in Pager') }}</span>
<input type="checkbox" ng-model="$ctrl.display.settings.pager.hide_single">
<span>{{:: ts('Hide Pager if One Page') }}</span>
</label>
</div>
<div class="checkbox-inline form-control">
<label>
<input type="checkbox" ng-model="$ctrl.display.settings.pager.hide_single">
<span>{{:: ts('Hide Pager if One Page') }}</span>
<input type="checkbox" ng-model="$ctrl.display.settings.pager.show_count" >
<span>{{:: ts('Show Count in Pager') }}</span>
</label>
</div>
</div>
Expand Down
13 changes: 8 additions & 5 deletions ext/search_kit/ang/crmSearchDisplay/Pager.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<div class="form-inline" ng-if="$ctrl.settings.pager.show_count" ng-include="'~/crmSearchDisplay/ResultCount.html'">
</div>
</div>
<div ng-if="!$ctrl.settings.pager.hide_single || ($ctrl.rowCount > $ctrl.limit)" class="text-center crm-flex-2">
<ul uib-pagination
<div ng-if="!$ctrl.settings.pager.hide_single || ($ctrl.rowCount > $ctrl.limit)" class="pager-wrapper">
<div ng-if="!$ctrl.settings.pager.loadmore" class="text-center crm-flex-2">
<ul uib-pagination
class="pagination"
boundary-link-numbers="true"
total-items="$ctrl.rowCount"
Expand All @@ -15,9 +16,11 @@
force-ellipses="true"
previous-text="⬅"
next-text="⮕"
></ul>
</div>
<div>
></ul>
</div>
<div ng-if="$ctrl.settings.pager.loadmore" class="text-center crm-flex-2">
<button type="button" ng-click="selectPage(page.number, $event)" class="btn btn-primary-outline dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
</div>
<div class="form-inline text-right" ng-if="$ctrl.settings.pager.expose_limit && (!$ctrl.settings.pager.hide_single || $ctrl.rowCount > $ctrl.limit)">
<label for="{{ 'crm-search-results-page-size-' + $ctrl.uniqueId }}" >
{{:: ts('Page Size') }}
Expand Down