Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed Nov 6, 2024
1 parent a4973a4 commit 158659e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion avAdmin/admin-directives/elections/elections.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2 ng-i18next>
class="btn btn-default delete-elections"
ng-if="hasPerms(['create'])"
ng-click="deleteSelected()">
<i class="fa fa-ellipsis-vertical"></i>
<i class="fa fa-trash"></i>
</button>

<ul class="nav nav-pills">
Expand Down Expand Up @@ -108,6 +108,7 @@ <h2 ng-i18next>

<tr ng-repeat="election in elections | filter:q | orderBy:'-id'">
<td class="td-1">
<input type="checkbox" ng-click="checkElection(election.id)">
<a
ng-if="!election.children_election_info"
ui-sref="admin.dashboard({id: election.id})"
Expand Down
8 changes: 7 additions & 1 deletion avAdmin/admin-directives/elections/elections.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ angular.module('avAdmin')
scope.nomore = false;
scope.list = {type: 'all'};
scope.elections = [];
scope.selectedElections = {};

/**
* Downloads elections from Elections api, initialize them and
Expand Down Expand Up @@ -186,6 +187,10 @@ angular.module('avAdmin')

}

function selectElection(electionId) {
scope.selectedElections[electionId] = !scope.selectedElections[electionId];
}

scope.exhtml = [];
Plugins.hook(
'admin-elections-list-extra-html',
Expand All @@ -199,7 +204,8 @@ angular.module('avAdmin')
setListType: setListType,
toggleShowChildren: toggleShowChildren,
reloadList: reloadList,
deleteSelected: deleteSelected
deleteSelected: deleteSelected,
selectElection: selectElection,
});
}

Expand Down
5 changes: 5 additions & 0 deletions avAdmin/admin-directives/elections/elections.less
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@
}

.new-election {
margin-right: 5px;
float: left;
}

.delete-elections {
margin-right: 20px;
float: left;
}
Expand Down

0 comments on commit 158659e

Please sign in to comment.