-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from JScearcy/master
Closes #13 ID Checklist
- Loading branch information
Showing
7 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
src/MCM.KidsIdApp/www/scripts/Controllers/IdChecklistController.ts
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,57 @@ | ||
/// <reference path="../Definitions/angular.d.ts" /> | ||
/// <reference path="../Definitions/angular-ui-router.d.ts" /> | ||
/// <reference path="../Services/UserService.ts" /> | ||
/// <reference path="../Services/DocumentService.ts" /> | ||
|
||
module MCM { | ||
export class IdChecklistController { | ||
private _state: any; | ||
private _childId: string; | ||
public checkList: PreparationChecklist; | ||
|
||
public static $inject = ['$state', '$stateParams','childDataService']; | ||
|
||
constructor($state: any, $stateParams: any, private _childDataService: MCM.ChildDataService) { | ||
this._state = $state; | ||
if($stateParams.childId) { | ||
this._childId = $stateParams.childId; | ||
this._childDataService.getById(this._childId).then((child) => { | ||
if(child.checklist) { | ||
this.checkList = child.checklist; | ||
} else { | ||
this.checkList = { | ||
childPhoto: false, | ||
birthCertificate: false, | ||
socialSecurityCard: false, | ||
physicalDetails: false, | ||
distinguishingFeatures: false, | ||
friends: false, | ||
dna: false, | ||
mementos: false, | ||
divorceCustodyPapers: false, | ||
otherParentsAndFamily: false, | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
|
||
public NavigateToPreviousView() { | ||
this._state.go("childProfileItem", { childId: this._childId }); | ||
} | ||
|
||
public NavigateToDocuments() { | ||
this._state.go("documents", {childId: this._childId}); | ||
} | ||
|
||
public SaveCheckList() { | ||
this._childDataService.getById(this._childId).then((child) => { | ||
child.checklist = this.checkList; | ||
this._childDataService.update(child); | ||
}); | ||
} | ||
|
||
} | ||
} | ||
|
||
angular.module("mcmapp").controller("idChecklistController", MCM.IdChecklistController); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<ion-view view-title="Missing Children Minnesota"> | ||
<ion-content> | ||
<div ng-controller="idChecklistController as iDC"> | ||
<button class="button icon-left ion-chevron-left button-block button-positive" ng-click="iDC.NavigateToPreviousView()"> | ||
ID Checklist | ||
</button> | ||
<ion-list> | ||
<ion-checkbox ng-model="iDC.checkList.childPhoto">Photo</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.birthCertificate">Birth Certificate</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.socialSecurityCard">Social Security Card</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.physicalDetails">Description Details</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.distinguishingFeatures">Distinguishing Features</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.friends">Friends</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.dna">DNA</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.mementos">Mementos</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.divorceCustodyPapers">Divorce or Custody Papers</ion-checkbox> | ||
<ion-checkbox ng-model="iDC.checkList.otherParentsAndFamily">Other Relative Info</ion-checkbox> | ||
|
||
<button class="button button-block button-positive" ng-click="iDC.SaveCheckList()"> | ||
Save | ||
</button> | ||
<button class="button button-block button-positive" ng-click="iDC.NavigateToDocuments()"> | ||
Go To Documents | ||
</button> | ||
</ion-list> | ||
</div> | ||
</ion-content> | ||
</ion-view> |