Skip to content

Commit

Permalink
#742 front-end backoffice for M1
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Sep 6, 2019
1 parent 96a5c5e commit e54d49e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ <h5><strong>Restrict check-in to a specific timeslot</strong></h5>
</div>
</div>

<div class="row" data-ng-if="checkInStrategiesVisible()">
<div class="col-xs-12">
<div class="form-group" bs-form-error="ticketCategory.ticketCheckInStrategy">
<label for="{{buildPrefix($index, 'ticketCheckInStrategy')}}">Check-in is allowed</label>
<select class="form-control" id="{{buildPrefix($index, 'ticketCheckInStrategy')}}" name="ticketCheckInStrategy" ng-model="ticketCategory.ticketCheckInStrategy" ng-options="strategy.id as strategy.name for strategy in checkInStrategies">
</select>
</div>
</div>
</div>

<h5><strong>Custom ticket validity</strong> <small>(will be displayed in ticket PDF, email and calendar invitation)</small></h5>

<div class="row">
Expand Down
19 changes: 19 additions & 0 deletions src/main/webapp/resources/js/admin/directive/admin-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,25 @@
};

$scope.advancedOptionsCollapsed = !hasCustomCheckIn($scope.ticketCategory) && !hasCustomTicketValidity($scope.ticketCategory);

$scope.checkInStrategiesVisible = function() {
var event = $scope.event;
if(event.begin.date && event.end.date) {
return moment(event.end.date).diff(moment(event.begin.date), 'days') > 0;
}
return moment(event.end).endOf('day').diff(moment(event.begin).startOf('day'), 'days') > 0;
};

$scope.checkInStrategies = [
{
id: 'ONCE_PER_EVENT',
name: 'Only upon first access to the venue'
},
{
id: 'ONCE_PER_DAY',
name: 'Once per day'
}
];
}
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@
ticketValidityStart: ticketValidityStart,
ticketValidityEnd: ticketValidityEnd,
tokenGenerationRequested: category.accessRestricted,
ticketCheckInStrategy: category.ticketCheckInStrategy,
sticky: false
};

Expand Down

0 comments on commit e54d49e

Please sign in to comment.