From a066dd6c52ae0bcf2ab70b10a4b04ecd530af159 Mon Sep 17 00:00:00 2001 From: Nathan Jones Date: Mon, 2 Nov 2015 16:52:48 -0700 Subject: [PATCH] -Removed plugin folder, moved all code to src/ -added more eslint rules for es6 -upped version to 1.1.0 -added PowerQuery version of sped alert, but won't be useful until we move to 9.x --- .babelrc | 3 + .eslintrc | 5 +- gulpfile.js | 89 +++++++- package.json | 17 +- plugin/plugin.xml | 11 - plugin/user_schema_root/u_sped.xml | 24 -- plugin/web_root/admin/alerts/iepalert.html | 13 -- plugin/web_root/admin/json/alert.json.html | 19 -- .../asmtdescr.iepalert.content.footer.txt | 1 - ...ttendancedates.iepalert.content.footer.txt | 1 - .../editlogentry.iepalert.content.footer.txt | 1 - .../editstudtest.iepalert.content.footer.txt | 1 - ...transportation.iepalert.content.footer.txt | 1 - .../more2.iepalert.leftnav.footer.txt | 15 -- ...newtransaction.iepalert.content.footer.txt | 1 - .../studentpages/SpecialServices.html | 209 ------------------ .../truanciesedit.iepalert.content.footer.txt | 1 - plugin/web_root/teachers/alerts/iepalert.html | 14 -- .../teachers/alerts/sped-alert.json.html | 123 ----------- ...ormstudentview.iepalert.content.footer.txt | 1 - ...sFromGradebook.iepalert.content.footer.txt | 1 - .../asmtdescr.iepalert.content.footer.txt | 2 - .../attendance.iepalert.content.footer.txt | 2 - ...ttendancedates.iepalert.content.footer.txt | 2 - ...ndancedatesall.iepalert.content.footer.txt | 2 - .../categorydescr.iepalert.content.footer.txt | 2 - .../cumulative.iepalert.content.footer.txt | 2 - .../demo.iepalert.content.footer.txt | 2 - .../iep-viewer.iepalert.content.footer.txt | 2 - .../logentry.iepalert.content.footer.txt | 2 - .../modifycomment.iepalert.content.footer.txt | 2 - .../netaccess.iepalert.content.footer.txt | 2 - .../photo.iepalert.content.footer.txt | 2 - .../planprogress.iepalert.content.footer.txt | 2 - .../printreport.iepalert.content.footer.txt | 2 - ...intstatereport.iepalert.content.footer.txt | 2 - .../profile.iepalert.content.footer.txt | 2 - .../quicklookup.iepalert.content.footer.txt | 2 - ...ecommendptedit.iepalert.content.footer.txt | 2 - ...ecommendptlist.iepalert.content.footer.txt | 2 - .../schedule.iepalert.content.footer.txt | 2 - .../scores.iepalert.content.footer.txt | 2 - ...tandardsdetail.iepalert.content.footer.txt | 2 - ...andardsfgentry.iepalert.content.footer.txt | 2 - ...tandardsscores.iepalert.content.footer.txt | 2 - ...eachercomments.iepalert.content.footer.txt | 2 - .../termgrades.iepalert.content.footer.txt | 2 - plugin/web_root/wildcards/alert-content.txt | 168 -------------- plugin/web_root/wildcards/alert.txt | 44 ---- ...student_end_css.iepalert.student.alert.txt | 2 - .../wildcards/title_student_end_popup.txt | 50 ----- .../iep-alert.permission_mappings.xml | 6 + src/plugin.xml | 2 +- src/queries_root/iep-alert.named_queries.xml | 3 +- .../scripts/iep-alert/js/alert-content.js | 3 +- src/web_root/scripts/iep-alert/js/alert.js | 4 +- .../scripts/iep-alert/js/attendance-alert.js | 32 +++ .../teachers/alerts/cc-alert.json.html | 50 +++++ .../teachers/alerts/sped-alert.json.html | 2 +- ...assattendance.iep-alert.content.footer.txt | 27 +++ 60 files changed, 232 insertions(+), 764 deletions(-) create mode 100644 .babelrc delete mode 100644 plugin/plugin.xml delete mode 100644 plugin/user_schema_root/u_sped.xml delete mode 100644 plugin/web_root/admin/alerts/iepalert.html delete mode 100644 plugin/web_root/admin/json/alert.json.html delete mode 100644 plugin/web_root/admin/students/asmtdescr.iepalert.content.footer.txt delete mode 100644 plugin/web_root/admin/students/attendancedates.iepalert.content.footer.txt delete mode 100644 plugin/web_root/admin/students/editlogentry.iepalert.content.footer.txt delete mode 100644 plugin/web_root/admin/students/editstudtest.iepalert.content.footer.txt delete mode 100644 plugin/web_root/admin/students/edittransportation.iepalert.content.footer.txt delete mode 100644 plugin/web_root/admin/students/more2.iepalert.leftnav.footer.txt delete mode 100644 plugin/web_root/admin/students/newtransaction.iepalert.content.footer.txt delete mode 100644 plugin/web_root/admin/students/studentpages/SpecialServices.html delete mode 100644 plugin/web_root/admin/students/truanciesedit.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/alerts/iepalert.html delete mode 100644 plugin/web_root/teachers/alerts/sped-alert.json.html delete mode 100644 plugin/web_root/teachers/informstudentview.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/standardGradesFromGradebook.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/asmtdescr.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/attendance.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/attendancedates.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/attendancedatesall.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/categorydescr.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/cumulative.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/demo.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/iep-viewer.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/logentry.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/modifycomment.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/netaccess.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/photo.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/planprogress.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/printreport.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/printstatereport.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/profile.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/quicklookup.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/recommendptedit.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/recommendptlist.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/schedule.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/scores.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/standardsdetail.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/standardsfgentry.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/standardsscores.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/teachercomments.iepalert.content.footer.txt delete mode 100644 plugin/web_root/teachers/studentpages/termgrades.iepalert.content.footer.txt delete mode 100644 plugin/web_root/wildcards/alert-content.txt delete mode 100644 plugin/web_root/wildcards/alert.txt delete mode 100644 plugin/web_root/wildcards/title_student_end_css.iepalert.student.alert.txt delete mode 100644 plugin/web_root/wildcards/title_student_end_popup.txt create mode 100644 src/permissions_root/iep-alert.permission_mappings.xml create mode 100644 src/web_root/scripts/iep-alert/js/attendance-alert.js create mode 100644 src/web_root/teachers/alerts/cc-alert.json.html create mode 100644 src/web_root/teachers/classattendance.iep-alert.content.footer.txt diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..d2896b9 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-es2015-modules-amd"] +} diff --git a/.eslintrc b/.eslintrc index bde9bd2..110cb89 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,10 @@ { "ecmaFeatures": { "modules": true, - "templateStrings": true + "templateStrings": true, + "arrowFunctions": true, + "blockBindings": true, + "forOf": true }, "globals": { "window": true diff --git a/gulpfile.js b/gulpfile.js index 2059c09..9e62d7f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,3 +1,88 @@ -var gulp = require("gulp"); +var gulp = require('gulp'); +var plugins = require('gulp-load-plugins')(); +var config = require('./config.json'); -require("../tasks")(gulp); \ No newline at end of file +var minimist = require('minimist'); +var del = require('del'); +var lazypipe = require('lazypipe'); +var runSequence = require('run-sequence'); + +var knownOptions = { + string: ['env'], + default: { + env: process.env.NODE_ENV || 'pstest2', + 'use-babel': true, + } +}; + +var options = minimist(process.argv.slice(2), knownOptions); + +gulp.task('deploy', function() { + return gulp.src([ + 'dist/web_root/scripts/**', + 'dist/web_root/images/**' + ], { + base: 'dist/web_root' + }) + .pipe(plugins.debug()) + .pipe(deploy()); +}); + +gulp.task('build-then-deploy', function(callback) { + return runSequence('build', 'deploy', callback); +}); + +gulp.task('build', ['build-static', 'babel']); + +gulp.task('build-static', function() { + return gulp.src([ + 'src/**', + '!src/**/*.js', + '!./src/web_root/scripts/**/*', + '!./src/web_root/scripts' + ]) + .pipe(plugins.debug()) + .pipe(gulp.dest('dist')); +}); + +gulp.task('package', function() { + return gulp.src('dist/**') + .pipe(plugins.debug()) + .pipe(plugins.zip('plugin.zip')) + .pipe(gulp.dest('./')); +}); + +gulp.task('babel', function() { + return gulp.src([ + './src/**/*.js' + ], { + base: './src/web_root' + }) + .pipe(preprocess()) + .pipe(plugins.debug()) + .pipe(plugins.if(options['use-babel'], plugins.babel())) + .pipe(gulp.dest('dist/web_root')); +}); + +var deploy = lazypipe() + .pipe(function() { + var env = options.env; + return plugins.if(config.hasOwnProperty(env), plugins.sftp(config[env].deploy_credentials)) + }); + +var preprocess = lazypipe() + .pipe(function() { + var env = options.env; + return plugins.if(config.hasOwnProperty(env), plugins.preprocess({ + context: { + SAMS_URL: config[env].sams_url, + API_URL: config[env].api_url + } + })); + }); + +gulp.task('lint', function() { + return gulp.src('src/**/*.js') + .pipe(plugins.eslint()) + .pipe(plugins.eslint.format()); +}); diff --git a/package.json b/package.json index 005ae45..cfed902 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,20 @@ "bugs": { "url": "https://github.com/IronCountySchoolDistrict/iep-alert/issues" }, - "homepage": "https://github.com/IronCountySchoolDistrict/iep-alert#readme" + "homepage": "https://github.com/IronCountySchoolDistrict/iep-alert#readme", + "devDependencies": { + "babel": "^6.*", + "babel-plugin-transform-es2015-modules-amd": "^6.0.15", + "eslint": "^1.7.3", + "gulp": "^3.9.0", + "gulp-babel": "^6.*", + "gulp-debug": "^2.1.2", + "gulp-if": "^2.0.0", + "gulp-preprocess": "^1.2.0", + "gulp-sftp": "^0.1.5", + "gulp-zip": "^3.0.2", + "preprocessor": "^1.4.0", + "requirejs-babel": "0.0.8", + "run-sequence": "^1.1.4" + } } diff --git a/plugin/plugin.xml b/plugin/plugin.xml deleted file mode 100644 index 7874896..0000000 --- a/plugin/plugin.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/plugin/user_schema_root/u_sped.xml b/plugin/user_schema_root/u_sped.xml deleted file mode 100644 index 80def79..0000000 --- a/plugin/user_schema_root/u_sped.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - U_Sped - - - - - - - - - - - - - - - - - - - - - diff --git a/plugin/web_root/admin/alerts/iepalert.html b/plugin/web_root/admin/alerts/iepalert.html deleted file mode 100644 index c45d986..0000000 --- a/plugin/web_root/admin/alerts/iepalert.html +++ /dev/null @@ -1,13 +0,0 @@ -~[wc:alert-content] - - diff --git a/plugin/web_root/admin/json/alert.json.html b/plugin/web_root/admin/json/alert.json.html deleted file mode 100644 index 07912d5..0000000 --- a/plugin/web_root/admin/json/alert.json.html +++ /dev/null @@ -1,19 +0,0 @@ -{ - "disability": "~([Students.U_sped]disability;js)", - "behavior_plan": ~(decode;~([Students.U_Sped]behavior_plan;js);1;true;false), - "highlight_text": ~(decode;~([Students.U_Sped]highlight_text;js);1;true;false), - "provide_paper_notes": ~(decode;~([Students.U_Sped]provide_paper_notes;js);1;true;false), - "resource_room": ~(decode;~([Students.U_Sped]resource_room;js);1;true;false), - "extended_time_oral": ~(decode;~([Students.U_Sped]extended_time_oral;js);1;true;false), - "extended_time_limit_testing": "~([Students.U_Sped]extended_time_limit_testing;js)", - "extended_time_limit_asmt": "~([Students.U_Sped]extended_time_limit_asmt;js)", - "use_calculator": ~(decode;~([Students.U_Sped]use_calculator;js);1;true;false), - "read_orally": ~(decode;~([Students.U_Sped]read_orally;js);1;true;false), - "reduce_exam_length": ~(decode;~([Students.U_Sped]reduce_exam_length;js);1;true;false), - "dont_check_spelling": ~(decode;~([Students.U_Sped]dont_check_spelling;js);1;true;false), - "books_on_tape": ~(decode;~([Students.U_Sped]books_on_tape;js);1;true;false), - "minimize_work": ~(decode;~([Students.U_Sped]minimize_work;js);1;true;false), - "oral_presentation": ~(decode;~([Students.U_Sped]oral_presentation;js);1;true;false), - "additional_adaptations": "~([Students.U_Sped]additional_adaptations;js)", - "caseload": "~([Students.U_Sped]caseload;js)" -} \ No newline at end of file diff --git a/plugin/web_root/admin/students/asmtdescr.iepalert.content.footer.txt b/plugin/web_root/admin/students/asmtdescr.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/admin/students/asmtdescr.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/admin/students/attendancedates.iepalert.content.footer.txt b/plugin/web_root/admin/students/attendancedates.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/admin/students/attendancedates.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/admin/students/editlogentry.iepalert.content.footer.txt b/plugin/web_root/admin/students/editlogentry.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/admin/students/editlogentry.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/admin/students/editstudtest.iepalert.content.footer.txt b/plugin/web_root/admin/students/editstudtest.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/admin/students/editstudtest.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/admin/students/edittransportation.iepalert.content.footer.txt b/plugin/web_root/admin/students/edittransportation.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/admin/students/edittransportation.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/admin/students/more2.iepalert.leftnav.footer.txt b/plugin/web_root/admin/students/more2.iepalert.leftnav.footer.txt deleted file mode 100644 index 56f3df4..0000000 --- a/plugin/web_root/admin/students/more2.iepalert.leftnav.footer.txt +++ /dev/null @@ -1,15 +0,0 @@ - - - \ No newline at end of file diff --git a/plugin/web_root/admin/students/newtransaction.iepalert.content.footer.txt b/plugin/web_root/admin/students/newtransaction.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/admin/students/newtransaction.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/admin/students/studentpages/SpecialServices.html b/plugin/web_root/admin/students/studentpages/SpecialServices.html deleted file mode 100644 index 9b5f21d..0000000 --- a/plugin/web_root/admin/students/studentpages/SpecialServices.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - Special Services - ~[wc:commonscripts] - - - - - - - -
- - ~[wc:admin_header_frame_css]Start Page > Student Selection > Special Services - ~[wc:admin_navigation_frame_css] - ~[wc:title_student_begin_css]Special Services~[wc:title_student_end_css] -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
General Information
Caseload Manager:
Disability: - -
Behavioral Plan:Yes
Classroom Adaptations (Assume none if left unchecked.)
Highlight text:Yes
Provide paper notes for the student:Yes
Resource room available for assistance:Yes
Give extended time limits for oral responses:Yes
Extended time limit for testing (minutes): - -
Extended time limit for assignments (days): - -
Use of calculator and/or math fact sheet:Yes
Read assignments/tests orally:Yes
Essays done orally or with limited writing:Yes -
Reduce length of exam:Yes
Don't check spelling unless specifically stated:Yes
Books on tape (if available):Yes
Minimize written work:Yes
Oral presentations may be given to teacher or in a small group setting:Yes
Additional Classroom Adaptations: - - 4000 characters remaining -
- - -
~[submitbutton]
-
-
- ~[wc:admin_footer_css] - -
- - - - diff --git a/plugin/web_root/admin/students/truanciesedit.iepalert.content.footer.txt b/plugin/web_root/admin/students/truanciesedit.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/admin/students/truanciesedit.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/alerts/iepalert.html b/plugin/web_root/teachers/alerts/iepalert.html deleted file mode 100644 index aa478ce..0000000 --- a/plugin/web_root/teachers/alerts/iepalert.html +++ /dev/null @@ -1,14 +0,0 @@ -~[wc:alert-content] - - - diff --git a/plugin/web_root/teachers/alerts/sped-alert.json.html b/plugin/web_root/teachers/alerts/sped-alert.json.html deleted file mode 100644 index 7d944db..0000000 --- a/plugin/web_root/teachers/alerts/sped-alert.json.html +++ /dev/null @@ -1,123 +0,0 @@ -~[tlist_sql; -SELECT - STUDENTSDCID, - replace(replace(replace(replace(replace(replace(replace(ADDITIONAL_ADAPTATIONS, '\', '\\'), '"','\"'), CHR(9),'\t'),CHR(8),'\b'),CHR(13),'\r'),CHR(12),'\f'),CHR(10),'\n') as ADDITIONAL_ADAPTATIONS, - CASE BEHAVIOR_PLAN - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS BEHAVIOR_PLAN, - CASE BOOKS_ON_TAPE - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS BOOKS_ON_TAPE, - CASE DONT_CHECK_SPELLING - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS DONT_CHECK_SPELLING, - CASE ESSAYS_ORAL_LIMIT_WRITING - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS ESSAYS_ORAL_LIMIT_WRITING, - EXTENDED_TIME_LIMIT_ASMT, - EXTENDED_TIME_LIMIT_TESTING, - CASE EXTENDED_TIME_ORAL - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS EXTENDED_TIME_ORAL, - CASE HIGHLIGHT_TEXT - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS HIGHLIGHT_TEXT, - CASE MINIMIZE_WORK - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS MINIMIZE_WORK, - CASE ORAL_PRESENTATION - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS ORAL_PRESENTATION, - CASE PROVIDE_PAPER_NOTES - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS PROVIDE_PAPER_NOTES, - CASE READ_ORALLY - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS READ_ORALLY, - CASE REDUCE_EXAM_LENGTH - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS REDUCE_EXAM_LENGTH, - CASE RESOURCE_ROOM - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS RESOURCE_ROOM, - CASE USE_CALCULATOR - WHEN 1 - THEN 'true' - WHEN 0 - THEN 'false' - ELSE 'false' - END AS USE_CALCULATOR, - CASELOAD, - DISABILITY -FROM u_sped_students2 -WHERE studentsdcid=~[gpv:studentsdcid];nonemessage={}] - { - "studentsdcid": "~(studentsdcid;json)", - "additional_adaptations": "~(additional_adaptations;js)", - "behavior_plan": "~(behavior_plan;json)", - "books_on_tape": "~(books_on_tape;json)", - "dont_check_spelling": "~(dont_check_spelling;json)", - "essays_oral_limit_writing": "~(essays_oral_limit_writing;json)", - "extended_time_limit_asmt": "~(extended_time_limit_asmt;json)", - "extended_time_limit_testing": "~(extended_time_limit_testing;json)", - "extended_time_oral": "~(extended_time_oral;json)", - "highlight_text": "~(highlight_text;json)", - "minimize_work": "~(minimize_work;json)", - "oral_presentation": "~(oral_presentation;json)", - "provide_paper_notes": "~(provide_paper_notes;json)", - "read_orally": "~(read_orally;json)", - "reduce_exam_length": "~(reduce_exam_length;json)", - "resource_room": "~(resource_room;json)", - "use_calculator": "~(use_calculator;json)", - "caseload": "~(caseload;json)", - "disability": "~(disability;json)" - } -[/tlist_sql] diff --git a/plugin/web_root/teachers/informstudentview.iepalert.content.footer.txt b/plugin/web_root/teachers/informstudentview.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/teachers/informstudentview.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/standardGradesFromGradebook.iepalert.content.footer.txt b/plugin/web_root/teachers/standardGradesFromGradebook.iepalert.content.footer.txt deleted file mode 100644 index 9e61dc4..0000000 --- a/plugin/web_root/teachers/standardGradesFromGradebook.iepalert.content.footer.txt +++ /dev/null @@ -1 +0,0 @@ -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/asmtdescr.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/asmtdescr.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/asmtdescr.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/attendance.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/attendance.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/attendance.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/attendancedates.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/attendancedates.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/attendancedates.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/attendancedatesall.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/attendancedatesall.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/attendancedatesall.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/categorydescr.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/categorydescr.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/categorydescr.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/cumulative.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/cumulative.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/cumulative.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/demo.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/demo.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/demo.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/iep-viewer.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/iep-viewer.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/iep-viewer.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/logentry.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/logentry.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/logentry.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/modifycomment.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/modifycomment.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/modifycomment.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/netaccess.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/netaccess.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/netaccess.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/photo.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/photo.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/photo.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/planprogress.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/planprogress.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/planprogress.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/printreport.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/printreport.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/printreport.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/printstatereport.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/printstatereport.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/printstatereport.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/profile.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/profile.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/profile.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/quicklookup.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/quicklookup.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/quicklookup.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/recommendptedit.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/recommendptedit.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/recommendptedit.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/recommendptlist.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/recommendptlist.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/recommendptlist.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/schedule.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/schedule.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/schedule.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/scores.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/scores.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/scores.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/standardsdetail.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/standardsdetail.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/standardsdetail.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/standardsfgentry.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/standardsfgentry.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/standardsfgentry.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/standardsscores.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/standardsscores.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/standardsscores.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/teachercomments.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/teachercomments.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/teachercomments.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/teachers/studentpages/termgrades.iepalert.content.footer.txt b/plugin/web_root/teachers/studentpages/termgrades.iepalert.content.footer.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/teachers/studentpages/termgrades.iepalert.content.footer.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/wildcards/alert-content.txt b/plugin/web_root/wildcards/alert-content.txt deleted file mode 100644 index 564e4f3..0000000 --- a/plugin/web_root/wildcards/alert-content.txt +++ /dev/null @@ -1,168 +0,0 @@ - - - - - diff --git a/plugin/web_root/wildcards/alert.txt b/plugin/web_root/wildcards/alert.txt deleted file mode 100644 index 6d98d0f..0000000 --- a/plugin/web_root/wildcards/alert.txt +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - diff --git a/plugin/web_root/wildcards/title_student_end_css.iepalert.student.alert.txt b/plugin/web_root/wildcards/title_student_end_css.iepalert.student.alert.txt deleted file mode 100644 index a3583fe..0000000 --- a/plugin/web_root/wildcards/title_student_end_css.iepalert.student.alert.txt +++ /dev/null @@ -1,2 +0,0 @@ - -~[wc:alert] \ No newline at end of file diff --git a/plugin/web_root/wildcards/title_student_end_popup.txt b/plugin/web_root/wildcards/title_student_end_popup.txt deleted file mode 100644 index d73ae54..0000000 --- a/plugin/web_root/wildcards/title_student_end_popup.txt +++ /dev/null @@ -1,50 +0,0 @@ - - - - - ~[studentalert] - - - - - - - - - - - - - ~(studentname)   ~([students]grade_level)   ~([students]student_number)     - ~([students]track)     ~(studschoolabbr)     ~[enrollmentstatus] - - - - - - - - diff --git a/src/permissions_root/iep-alert.permission_mappings.xml b/src/permissions_root/iep-alert.permission_mappings.xml new file mode 100644 index 0000000..1361ba9 --- /dev/null +++ b/src/permissions_root/iep-alert.permission_mappings.xml @@ -0,0 +1,6 @@ + + + + /ws/schema/query/org.irondistrict.iep.queries.alert + + diff --git a/src/plugin.xml b/src/plugin.xml index 263ba62..16d5b27 100644 --- a/src/plugin.xml +++ b/src/plugin.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" description="A custom alert for students with an IEP" name="IEP Alert" - version="1.0.0" + version="1.1.0" xsi:schemaLocation="http://plugin.powerschool.pearson.com plugin.xsd"> diff --git a/src/queries_root/iep-alert.named_queries.xml b/src/queries_root/iep-alert.named_queries.xml index 1ef6138..0a572cf 100644 --- a/src/queries_root/iep-alert.named_queries.xml +++ b/src/queries_root/iep-alert.named_queries.xml @@ -1,3 +1,4 @@ + @@ -51,7 +52,7 @@ LEFT OUTER JOIN students ON cc.studentid = students.id LEFT OUTER JOIN u_sped_students2 ON students.dcid = u_sped_students2.studentsdcid WHERE cc.id = :ccid - ]]> + ]]> diff --git a/src/web_root/scripts/iep-alert/js/alert-content.js b/src/web_root/scripts/iep-alert/js/alert-content.js index 21c66d2..bf68ac1 100644 --- a/src/web_root/scripts/iep-alert/js/alert-content.js +++ b/src/web_root/scripts/iep-alert/js/alert-content.js @@ -1,8 +1,9 @@ -/* global psData, require */ +/* global psData, require, getPortal */ import $ from 'jquery'; import _ from 'underscore'; export default function() { + var alertUrl; if (getPortal() === 'admin') { alertUrl = `/ws/schema/table/U_SPED_STUDENTS2/${psData.studentdcid}?projection=*`; } else { diff --git a/src/web_root/scripts/iep-alert/js/alert.js b/src/web_root/scripts/iep-alert/js/alert.js index fed073c..8a59a8d 100644 --- a/src/web_root/scripts/iep-alert/js/alert.js +++ b/src/web_root/scripts/iep-alert/js/alert.js @@ -13,9 +13,7 @@ export var fetchAlert = function() { fetch(alertUrl, { credentials: 'include' }) - .then(function(response) { - return response.json(); - }) + .then(response => {return response.json()}) .then(function(alertResp) { var alert; if (getPortal() === 'admin') { diff --git a/src/web_root/scripts/iep-alert/js/attendance-alert.js b/src/web_root/scripts/iep-alert/js/attendance-alert.js new file mode 100644 index 0000000..9fcf92b --- /dev/null +++ b/src/web_root/scripts/iep-alert/js/attendance-alert.js @@ -0,0 +1,32 @@ +/*global require, $, _, psData*/ +'use strict'; +import $ from 'jquery'; +import _ from 'underscore'; +import * as Promise from 'bluebird'; + +export var fetchAlert = function() { + var studentRows = $('.studentrow'); + var ids = $.map(studentRows, function(row) { + return $(row).attr('id').slice(5); + }); + var promises = $.map(ids, function(id) { + return fetch(`/teachers/alerts/cc-alert.json.html?ccid=${id}`, { + credentials: 'include' + }).then(r => { + return r.json() + }); + }); + Promise.all(promises).then(function(results) { + results.forEach(function(alert, index) { + var alertTemplate = $('#alert-template').html(); + var renderedTemplate = _.template(alertTemplate, { + studentfrn: '001' + alert.studentsdcid + }); + if (alert.caseload) { + var alertsTd = $(studentRows[index]).find('td').eq(1); + console.log(renderedTemplate); + alertsTd.append(renderedTemplate); + } + }); + }); +}; diff --git a/src/web_root/teachers/alerts/cc-alert.json.html b/src/web_root/teachers/alerts/cc-alert.json.html new file mode 100644 index 0000000..42be7ef --- /dev/null +++ b/src/web_root/teachers/alerts/cc-alert.json.html @@ -0,0 +1,50 @@ +~[tlist_sql; + SELECT + cc.id, + students.dcid, + replace(replace(replace(replace(replace(replace(replace(u_sped_students2.additional_adaptations, '\', '\\'), '"','\"'), CHR(9),'\t'),CHR(8),'\b'),CHR(13),'\r'),CHR(12),'\f'),CHR(10),'\n') as ADDITIONAL_ADAPTATIONS, + u_sped_students2.behavior_plan, + u_sped_students2.books_on_tape, + u_sped_students2.caseload, + u_sped_students2.disability, + u_sped_students2.dont_check_spelling, + u_sped_students2.essays_oral_limit_writing, + u_sped_students2.extended_time_limit_asmt, + u_sped_students2.extended_time_limit_testing, + u_sped_students2.extended_time_oral, + u_sped_students2.highlight_text, + u_sped_students2.minimize_work, + u_sped_students2.oral_presentation, + u_sped_students2.provide_paper_notes, + u_sped_students2.read_orally, + u_sped_students2.reduce_exam_length, + u_sped_students2.resource_room, + u_sped_students2.use_calculator + FROM cc + LEFT OUTER JOIN students ON cc.studentid = students.id + LEFT OUTER JOIN u_sped_students2 ON students.dcid = u_sped_students2.studentsdcid + WHERE cc.id = ~[gpv:ccid] +] + { + "ccid": "~(ccid;json)", + "studentsdcid": "~(studentsdcid)", + "additional_adaptations": "~(additional_adaptations;json)", + "behavior_plan": "~(behavior_plan;json)", + "books_on_tape": "~(books_on_tape;json)", + "caseload": "~(caseload;json)", + "disability": "~(disability;json)", + "dont_check_spelling": "~(dont_check_spelling;json)", + "essays_oral_limit_writing": "~(essays_oral_limit_writing;json)", + "extended_time_limit_asmt": "~(extended_time_limit_asmt;json)", + "extended_time_limit_testing": "~(extended_time_limit_testing;json)", + "extended_time_oral": "~(extended_time_oral;json)", + "highlight_text": "~(highlight_text;json)", + "minimize_work": "~(minimize_work;json)", + "oral_presentation": "~(oral_presentation;json)", + "provide_paper_notes": "~(provide_paper_notes;json)", + "read_orally": "~(read_orally;json)", + "reduce_exam_length": "~(reduce_exam_length;json)", + "resource_room": "~(resource_room;json)", + "use_calculator": "~(use_calculator;json)" + } +[/tlist_sql] diff --git a/src/web_root/teachers/alerts/sped-alert.json.html b/src/web_root/teachers/alerts/sped-alert.json.html index 7d944db..ec11211 100644 --- a/src/web_root/teachers/alerts/sped-alert.json.html +++ b/src/web_root/teachers/alerts/sped-alert.json.html @@ -101,7 +101,7 @@ WHERE studentsdcid=~[gpv:studentsdcid];nonemessage={}] { "studentsdcid": "~(studentsdcid;json)", - "additional_adaptations": "~(additional_adaptations;js)", + "additional_adaptations": "~(additional_adaptations)", "behavior_plan": "~(behavior_plan;json)", "books_on_tape": "~(books_on_tape;json)", "dont_check_spelling": "~(dont_check_spelling;json)", diff --git a/src/web_root/teachers/classattendance.iep-alert.content.footer.txt b/src/web_root/teachers/classattendance.iep-alert.content.footer.txt new file mode 100644 index 0000000..671517c --- /dev/null +++ b/src/web_root/teachers/classattendance.iep-alert.content.footer.txt @@ -0,0 +1,27 @@ + + + + + +