Merge pull request #5676 from tsiegleauq/show-vote-totals-in-user-list
Show vote weight totals in user list
This commit is contained in:
commit
9fcb6cdcba
@ -10,6 +10,9 @@
|
|||||||
[searchFieldInput]="inputValue"
|
[searchFieldInput]="inputValue"
|
||||||
(searchFieldChange)="searchFilter($event)"
|
(searchFieldChange)="searchFilter($event)"
|
||||||
>
|
>
|
||||||
|
<div class="extra-info-slot">
|
||||||
|
<ng-content select=".filter-bar-info-slot"></ng-content>
|
||||||
|
</div>
|
||||||
</os-sort-filter-bar>
|
</os-sort-filter-bar>
|
||||||
|
|
||||||
<pbl-ngrid
|
<pbl-ngrid
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<div class="custom-table-header flex-spaced">
|
<div class="custom-table-header flex-spaced">
|
||||||
<!-- Amount of filters -->
|
<!-- Amount of filters -->
|
||||||
<div class="filter-count">
|
<div class="filter-count one-line">
|
||||||
<span>{{ filterCount }} </span><span>{{ 'of' | translate }}</span>
|
<span>{{ filterCount }} </span><span>{{ 'of' | translate }}</span>
|
||||||
<span> {{ totalCount }}</span>
|
<span> {{ totalCount }}</span>
|
||||||
<span *ngIf="extraItemInfo"> · {{ extraItemInfo }}</span>
|
<ng-content select=".extra-info-slot"></ng-content>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Current filters -->
|
<!-- Current filters -->
|
||||||
|
@ -32,9 +32,11 @@ span.right-with-margin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.filter-count {
|
.filter-count {
|
||||||
|
display: flex;
|
||||||
|
min-width: fit-content;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
margin-left: 24px;
|
margin-left: 24px;
|
||||||
margin-right: 5px;
|
margin-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.current-filters {
|
.current-filters {
|
||||||
|
@ -55,12 +55,6 @@ export class SortFilterBarComponent<V extends BaseViewModel> {
|
|||||||
@Input()
|
@Input()
|
||||||
public filterService: BaseFilterListService<V>;
|
public filterService: BaseFilterListService<V>;
|
||||||
|
|
||||||
/**
|
|
||||||
* optional additional string to show after the item count. This string will not be translated here
|
|
||||||
*/
|
|
||||||
@Input()
|
|
||||||
public extraItemInfo: string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional string to tell the verbose name of the filtered items. This string is displayed,
|
* Optional string to tell the verbose name of the filtered items. This string is displayed,
|
||||||
* if no filter service is given.
|
* if no filter service is given.
|
||||||
|
@ -29,6 +29,11 @@
|
|||||||
[(selectedRows)]="selectedRows"
|
[(selectedRows)]="selectedRows"
|
||||||
(dataSourceChange)="onDataSourceChange($event)"
|
(dataSourceChange)="onDataSourceChange($event)"
|
||||||
>
|
>
|
||||||
|
<!-- extra content in the filter bar -->
|
||||||
|
<div class="filter-bar-info-slot" *ngIf="showVoteWeight">
|
||||||
|
<span>({{ 'Vote weight' | translate }} {{ totalVoteWeight }})</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Name column -->
|
<!-- Name column -->
|
||||||
<div *pblNgridCellDef="'short_name'; row as user; rowContext as rowContext" class="cell-slot fill">
|
<div *pblNgridCellDef="'short_name'; row as user; rowContext as rowContext" class="cell-slot fill">
|
||||||
<a class="detail-link" [routerLink]="user.id" *ngIf="!isMultiSelect"></a>
|
<a class="detail-link" [routerLink]="user.id" *ngIf="!isMultiSelect"></a>
|
||||||
|
@ -122,6 +122,11 @@ export class UserListComponent extends BaseListViewComponent<ViewUser> implement
|
|||||||
return this.pollService.isElectronicVotingEnabled && this.isVoteWeightActive;
|
return this.pollService.isElectronicVotingEnabled && this.isVoteWeightActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get totalVoteWeight(): number {
|
||||||
|
const votes = this.dataSource?.filteredData?.reduce((previous, current) => previous + current.vote_weight, 0);
|
||||||
|
return votes ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the columns to show
|
* Define the columns to show
|
||||||
*/
|
*/
|
||||||
|
@ -274,7 +274,6 @@ b,
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
line-height: 64px;
|
line-height: 64px;
|
||||||
text-align: right;
|
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user