learning-unlimited/ESP-Website — pull request #901 by benjaminjkraft (2014-01-06 19:46:16+00:00)
Title: Class flags

This is the initial version of what I've been working on for the last couple of weeks. It's a system to allow admins to flag certain classes (for example, as "needs safety review"), and then see which classes have some set of flags. I haven't yet written all the interfaces I'd like to, but it's now in a fully usable state, so I'd like to get this version out now, and I'll add the other interfaces when I have time.

The basic workflows are the following:
* Create flag types in the admin panel. You can select a color, or it will select one for you.
* When setting up a program, select the flags you'd like to use. (This is so when inevitably we end up with several similarly-named flags we don't get confused.)
* From the manage-side editclass interface, or from the manageclass interface, you can view, add, and remove flags. It stores the flag's type, a comment, and the creation and last modification date and user.
* From a new program module interface, /manage///classflags/, you can build a query out of those flags (e.g. "flags A and B and none of (C and D)", and get as a result a list of classes.
* The counts of teachers and classes with a given flag are on the dashboard; the former are also in the comm panel and everywhere else Program.teachers() gets used.

Things I'd like to do that aren't yet included are:
* Show flags in the dashboard list of classes and the Ajax acheduler. (This would only show the flags marked as such to reduce clutter.)
* A printable of "all classes by flag" or similar, for the admin binder. Possibly also a printable for "all classes matching a given query" (from the /manage///classflags/ interface).
* Add some other filters to the /manage///classflags/ interface, such as the class status.