Skip to content

Commit

Permalink
Merge pull request #351 from cultuurnet/UPS-4204-remove-bulk-chckbx
Browse files Browse the repository at this point in the history
[UPS-4204] Remove checkboxes in bulkactions screen
  • Loading branch information
hirviid authored Nov 9, 2022
2 parents b02c7a0 + 6aa1ff0 commit 28a203f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
36 changes: 35 additions & 1 deletion app/scripts/activity/activity.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ angular
.controller('ActivityController', ActivityController);

/* @ngInject */
function ActivityController (passholder, passholders, bulkSelection, activityService, DateRange, $rootScope, $scope, activityMode, $state, activeCounter) {
function ActivityController (passholder, passholders, bulkSelection, activityService, DateRange, $rootScope, $scope, activityMode, $state, activeCounter, $uibModal) {
/*jshint validthis: true */
var controller = this;
var confirmationModal = null;

// Set default parameters.
controller.query = '';
Expand Down Expand Up @@ -287,6 +288,39 @@ function ActivityController (passholder, passholders, bulkSelection, activitySer
});
};

controller.confirmBulkCheckin = function (activity) {
if (controller.passholders.length === 1) {
controller.bulkCheckin(activity);
return;
}

confirmationModal = $uibModal
.open({
animation: true,
templateUrl: 'views/passholder/bulk-actions/modal-confirm.html',
size: 'sm',
resolve: {
text: function () {
return {
title: 'Ben je zeker?',
body: 'Punten sparen voor ' + controller.passholders.length + ' pashouders?',
submit: 'Punten sparen'
};
}
},
controller: function (text) {
var $ctrl = this;
$ctrl.text = text;
$ctrl.close = confirmationModal.close;
$ctrl.submit = function() {
controller.bulkCheckin(activity);
confirmationModal.close();
};
},
controllerAs: '$ctrl'
});
};

/**
* Handle the update of a claimed activity.
* @param event
Expand Down
2 changes: 1 addition & 1 deletion app/views/activity/content-activities.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h3 ng-if="ac.activityMode == 'counter'" ui-sref="counter.main.advancedSearch.bu
<div ng-switch-when="available">
<div class="points">+<span ng-bind="::activity.points"></span></div>
<button ng-if="ac.activityMode == 'passholders'" class="btn btn-default btn-sm" ng-click="ac.checkin(activity)">Punten sparen</button>
<button ng-if="ac.activityMode == 'counter'" ng-click="ac.bulkCheckin(activity)" class="btn btn-default btn-sm" >Punten sparen</button>
<button ng-if="ac.activityMode == 'counter'" ng-click="ac.confirmBulkCheckin(activity)" class="btn btn-default btn-sm" >Punten sparen</button>
</div>
</div>
<!--status failed-->
Expand Down
13 changes: 13 additions & 0 deletions app/views/passholder/bulk-actions/modal-confirm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="modal-header">
<button type="button" class="close" ng-click="$ctrl.close()" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">{{$ctrl.text.title}}</h4>
</div>
<div class="modal-body">
<p>{{$ctrl.text.body}}</p>
</div>
<div class="modal-footer">
<a class="btn btn-default" ng-click="$ctrl.close()" >Annuleren</a>
<a class="btn btn-primary" ng-click="$ctrl.submit()">{{$ctrl.text.submit}}</a>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="sidebar__inner">

<div class="back-nav">
<a ui-sref="counter.main.advancedSearch">Terug</a>
<a ui-sref="counter.main.advancedSearch({uitpasNumbers: bac.bulkSelection.uitpasNumberSelection})">Terug</a>
</div>

<p class="element-title">
Expand All @@ -12,7 +12,6 @@

<li class="slats-item" ng-repeat="passholder in bac.passholders">
<div class="checkbox-on-left">
<input type="checkbox" class="pashouder-selectie" checked="">
{{ passholder.name.first }} {{ passholder.name.last }}

<ul class="listreset statuut">
Expand Down

0 comments on commit 28a203f

Please sign in to comment.