Handle resource limits in the Web interface

See @d7b010
This commit is contained in:
Francis Lachapelle
2016-02-16 12:40:59 -05:00
parent 3d7192ffef
commit 4c01417690
5 changed files with 73 additions and 31 deletions
@@ -665,7 +665,7 @@
else
{
iCalCalendar *calendar;
NSDictionary *values;
NSDictionary *values, *info;
NSString *reason;
iCalEvent *event;
@@ -682,8 +682,10 @@
reason = [values keysWithFormat: [self labelForKey: @"Maximum number of simultaneous bookings (%{NumberOfSimultaneousBookings}) reached for resource \"%{Cn} %{SystemEmail}\". The conflicting event is \"%{EventTitle}\", and starts on %{StartDate}."]];
info = [NSDictionary dictionaryWithObject: reason forKey: @"reject"];
return [NSException exceptionWithHTTPStatus: 403
reason: reason];
reason: [info jsonRepresentation]];
}
}
//
@@ -289,33 +289,32 @@
</md-dialog-actions>
<!-- attendee availability conflict -->
<md-dialog-actions class="md-default-theme md-bg md-warn"
ng-show="editor.attendeeConflictError">
<div class="md-flex"><var:string label:value="A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?"/></div>
<md-button class="md-icon-button" ng-click="editor.attendeeConflictError = false">
<md-icon label:aria-label="Close">close</md-icon>
</md-button>
</md-dialog-actions>
<md-dialog-actions class="md-default-theme md-bg md-warn"
ng-show="editor.attendeeConflictError">
<div class="md-flex">
<md-icon>person</md-icon> {{editor.attendeeConflictError.attendee_name}} ({{editor.attendeeConflictError.attendee_email}})
<md-dialog-content class="md-default-theme md-bg md-warn md-padding sg-dialog-message ng-hide"
ng-show="editor.attendeeConflictError.conflicts">
<div layout="row">
<div class="md-flex"><var:string label:value="A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?"/></div>
<md-button class="md-icon-button" ng-click="editor.attendeeConflictError = false">
<md-icon label:aria-label="Close">close</md-icon>
</md-button>
</div>
<div class="md-flex" ng-show="editor.attendeeConflictError.attendee_email">
<md-icon>person</md-icon> {{editor.attendeeConflictError.attendee_name}} ({{editor.attendeeConflictError.attendee_email}})
</div>
<div layout="row"
ng-show="editor.attendeeConflictError.conflicts"
ng-repeat="conflict in editor.attendeeConflictError.conflicts">
<md-icon>schedule</md-icon>
<div class="pseudo-input-container">
<label class="pseudo-input-label"><var:string label:value="From"/></label>
<div>{{conflict.startDate}} <md-icon>trending_flat</md-icon></div>
</div>
<div class="pseudo-input-container md-flex">
<label class="pseudo-input-label"><var:string label:value="To"/></label>
<div>{{conflict.endDate}}</div>
</div>
</md-dialog-actions>
<md-dialog-actions class="md-default-theme md-bg md-warn"
ng-show="editor.attendeeConflictError"
ng-repeat="conflict in editor.attendeeConflictError.conflicts">
<md-icon>schedule</md-icon>
<div class="pseudo-input-container">
<label class="pseudo-input-label"><var:string label:value="From"/></label>
<div>{{conflict.startDate}} <md-icon>trending_flat</md-icon></div>
</div>
<div class="pseudo-input-container md-flex">
<label class="pseudo-input-label"><var:string label:value="To"/></label>
<div>{{conflict.endDate}}</div>
</div>
</md-dialog-actions>
<md-dialog-actions ng-show="editor.attendeeConflictError">
</md-dialog-content>
<md-dialog-actions ng-show="editor.attendeeConflictError.conflicts">
<md-button type="button" ng-click="editor.cancel()">
<var:string label:value="Cancel"/>
</md-button>
@@ -329,6 +328,24 @@
<var:string label:value="Save"/>
</md-button>
</md-dialog-actions>
<!-- rejected attendee invitation -->
<md-dialog-content class="md-default-theme md-bg md-warn md-padding sg-dialog-message ng-hide" layout="row"
ng-show="editor.attendeeConflictError.reject">
<div class="md-flex">{{editor.attendeeConflictError.reject}}</div>
<md-button class="md-icon-button" ng-click="editor.attendeeConflictError = false">
<md-icon label:aria-label="Close">close</md-icon>
</md-button>
</md-dialog-content>
<md-dialog-actions ng-show="editor.attendeeConflictError.reject">
<md-button type="button" ng-click="editor.cancel()">
<var:string label:value="Cancel"/>
</md-button>
<md-button type="button"
ng-click="editor.attendeeConflictError = false">
<var:string label:value="Edit"/>
</md-button>
</md-dialog-actions>
</form>
</md-dialog>
</container>
+9 -2
View File
@@ -740,8 +740,9 @@
<!-- modal for attendee availability conflict -->
<script type="text/ng-template" id="UIxAttendeeConflictDialog">
<md-dialog flex="60" flex-xs="100">
<md-dialog-content class="md-dialog-content">
<h2 class="md-title">Warning</h2>
<md-dialog-content class="md-dialog-content"
ng-show="$AttendeeConflictDialogController.conflictError.attendee_email">
<h2 class="md-title"><var:string label:value="Warning"/></h2>
<p><var:string label:value="A time conflict exists with one or more attendees.\nWould you like to keep the current settings anyway?"/></p>
<md-list>
<md-list-item>
@@ -760,11 +761,17 @@
</md-list-item>
</md-list>
</md-dialog-content>
<md-dialog-content class="md-dialog-content"
ng-show="$AttendeeConflictDialogController.conflictError.reject">
<h2 class="md-title"><var:string label:value="Warning"/></h2>
<p>{{$AttendeeConflictDialogController.conflictError.reject}}</p>
</md-dialog-content>
<md-dialog-actions>
<md-button type="button" ng-click="$AttendeeConflictDialogController.cancel()">
<var:string label:value="Cancel"/>
</md-button>
<md-button class="md-warn" type="button"
ng-show="$AttendeeConflictDialogController.conflictError.conflicts"
ng-click="$AttendeeConflictDialogController.save()">
<var:string label:value="Save"/>
</md-button>
@@ -227,9 +227,9 @@
Alarm.getAlarms();
}, function(response) {
if (response.status == 403 &&
response.data && response.data.message && angular.isObject(response.data.message)) {
response.data && response.data.message &&
angular.isObject(response.data.message))
vm.attendeeConflictError = response.data.message;
}
});
}
}
@@ -19,6 +19,22 @@ body.popup {
}
}
md-dialog {
md-dialog-content {
&.sg-dialog-message {
// Prepare content to receive a "close" button on the right
align-items: flex-start;
display: flex;
flex-shrink: 0;
transition: background-color $swift-ease-in-duration $swift-ease-in-timing-function;
&.ng-hide {
background-color: white !important;
transition-duration: 0s;
}
}
}
}
@media (max-width: $layout-breakpoint-xs) {
md-dialog {
&[flex-xs="100"],