(function(){ 'use strict'; angular.module('raz') .component('lcmImplementationGuide', { templateUrl: '/js/angular/literacy-curriculum-map/components/lcm-implementation-guide.html', controller: 'LCMImplementationGuideController', bindings: { gradeIndex: '<', block: '<' } }) .controller('LCMImplementationGuideController', LCMImplementationGuideController); LCMImplementationGuideController.$inject = ['lazAccessRestrictionService']; function LCMImplementationGuideController (lazAccessRestrictionService) { var ctrl = this; ctrl.coreBlockId = null; ctrl.BLOCKS = { SHARED : 1, READ : 2, PA : 3, PHONICS : 4, GRAMMAR : 5, WRITING : 6, SMALL : 7, CENTERS : 8, STATIONS : 9 } ctrl.$onInit = function() { ctrl.coreBlockId = parseInt(ctrl.block['core_block_id']); ctrl.blockName = chooseBlockName(); ctrl.guideName = chooseGuideName(); ctrl.implementationTitle = '5-Day Implementation Guide'; ctrl.page = '/literacy-curriculum-map'; lazAccessRestrictionService.setPageAfterLogin(ctrl.page); } ctrl.checkAuthorization = function (event, pageAfterLogin, downloadPath) { if (!lazAccessRestrictionService.isAuthorized()) { event.preventDefault(); event.stopPropagation(); lazAccessRestrictionService.loginIfNotAuthorized(pageAfterLogin, downloadPath); } }; ctrl.isAuthorized = function() { return lazAccessRestrictionService.isAuthorized(); }; function chooseBlockName() { switch (ctrl.coreBlockId) { case ctrl.BLOCKS.SHARED: return 'Shared Reading'; case ctrl.BLOCKS.READ: return 'Read Aloud'; case ctrl.BLOCKS.PA: return 'Phonological Awareness'; case ctrl.BLOCKS.PHONICS: return 'Phonics'; case ctrl.BLOCKS.GRAMMAR: return 'Grammar / Word Work'; case ctrl.BLOCKS.WRITING: return 'Writing'; case ctrl.BLOCKS.SMALL: return 'Small Group Instruction'; case ctrl.BLOCKS.CENTERS: return 'Centers'; case ctrl.BLOCKS.STATIONS: return 'Stations'; default: return null; } } function chooseGuideName() { switch (ctrl.coreBlockId) { case ctrl.BLOCKS.SHARED: return 'shared-reading-guide'; case ctrl.BLOCKS.READ: return 'read-aloud-guide'; case ctrl.BLOCKS.PA: return 'phonological-awareness-guide'; case ctrl.BLOCKS.PHONICS: return 'phonics-guide'; case ctrl.BLOCKS.GRAMMAR: return 'grammar-word-work-guide'; case ctrl.BLOCKS.WRITING: return 'writing-guide'; case ctrl.BLOCKS.SMALL: return 'small-group-instruction-guide'; case ctrl.BLOCKS.CENTERS: return 'centers-guide'; case ctrl.BLOCKS.STATIONS: return 'stations-guide'; default: return null; } } } })();