-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
StudentSupportCallForm: Implement freeform availability collection #1450
- Loading branch information
Showing
11 changed files
with
99 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...rt/studentSupportCallForm/directives/studentAvailabilities/crnAvailable/crnAvailable.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<div class="crn-available"> | ||
crn | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.grid-available { | ||
border: 1px solid #ebebeb; | ||
border-radius: 3px; | ||
padding: 10px; | ||
} |
3 changes: 3 additions & 0 deletions
3
.../studentSupportCallForm/directives/studentAvailabilities/gridAvailable/gridAvailable.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
<div class="grid-available"> | ||
<availability-grid blob="state.supportCallResponse.availabilityBlob" | ||
on-change="saveSupportCallResponse(blob, 500)"> | ||
</availability-grid> | ||
</div> |
20 changes: 9 additions & 11 deletions
20
...rt/studentSupportCallForm/directives/studentAvailabilities/gridAvailable/gridAvailable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
instructionalSupportApp.directive("gridAvailable", this.gridAvailable = function () { | ||
instructionalSupportApp.directive("gridAvailable", this.gridAvailable = function (studentActions, $timeout) { | ||
return { | ||
restrict: 'E', | ||
templateUrl: 'gridAvailable.html', | ||
replace: true, | ||
scope: { | ||
state: '<' | ||
}, | ||
link: function (scope, element, attrs) { | ||
scope.props = {}; | ||
|
||
scope.$watch('state',function() { | ||
scope.mapStateToProps(scope.state); | ||
}); | ||
scope.saveSupportCallResponse = function(newBlob, delay) { | ||
scope.state.supportCallResponse.availabilityBlob = newBlob; | ||
|
||
scope.mapStateToProps = function(state) { | ||
scope.props.state = state; | ||
// Report changes back to server after some delay | ||
$timeout.cancel(scope.timeout); | ||
scope.timeout = $timeout(function() { | ||
studentActions.updateAvailability(scope.state.supportCallResponse); | ||
}, delay); | ||
}; | ||
|
||
scope.mapStateToProps(scope.state); | ||
scope.timeout = {}; | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.student-availabilities__header-container { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.student-availabilities__header { | ||
flex: 1 1 0px; | ||
} | ||
|
||
.student-availabilities__legend { | ||
flex: 1 1 0px; | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
} | ||
|
||
.student-availabilities__unavailable-color { | ||
background-color: #ccc; | ||
} | ||
|
||
.student-availabilities__available-color { | ||
background-color: white; | ||
} | ||
|
||
.student-availabilities__question { | ||
padding-left: 5px; | ||
} |
26 changes: 25 additions & 1 deletion
26
...upport/studentSupportCallForm/directives/studentAvailabilities/studentAvailabilities.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,26 @@ | ||
<div class="student-availabilities"> | ||
<div class="student-availabilities" ng-show="state.supportCallResponse.collectAvailabilityByGrid || state.supportCallResponse.collectAvailabilityByCrn"> | ||
<div class="student-availabilities__header-container"> | ||
<div class="student-availabilities__header"> | ||
<h5>Please indicate your un-availabilities</h5> | ||
</div> | ||
<div class="student-availabilities__legend"> | ||
<small class="legend"> | ||
<div class="legend-square student-availabilities__available-color"></div>Available | ||
<div class="legend-square student-availabilities__unavailable-color"></div>Unavailable | ||
</small> | ||
<div | ||
class="student-availabilities__question" | ||
tooltip-placement="left" | ||
uib-tooltip="You can left click and drag to paint unavailability on the grids below."> | ||
<i class="glyphicon glyphicon-question-sign"></i> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div ng-show="state.supportCallResponse.collectAvailabilityByGrid"> | ||
<grid-available></grid-available> | ||
</div> | ||
<div ng-show="state.supportCallResponse.collectAvailabilityByCrn"> | ||
<crn-available></crn-available> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters