-
Notifications
You must be signed in to change notification settings - Fork 2
Admin interface
There's an admin interface located at /admin
(that is, if the site is located at http://example.com
, then the admin interface is at http://example.com/admin
). All the admin interface pages are password protected.
The admin interface credentials are all stored in conf/application.conf
, in the list of users
. You must reload the application after making changes to the configuration file in order for changes to be recognized. Since passwords are stored plain text, they should be unique to the application (ie, not shared with any other services).
Important |
---|
You must use a unique and private application secret! Failure to do so could allow for session hijacking. The application secret is defined in application.conf and must be kept secret. See here for tools to generate the secret. |
The admin interface allows you to add, edit, and remove locations. All the fields of locations are modifiable. When you log in, you'll see a list of all locations. This list is searchable and sortable. Due to the large number of locations, the list is currently a bit sluggish.
Note that for location coordinates, you must use decimal format. That is, a single number representing the number of degrees is used. Positive numbers are north and east, negative numbers are south and west. For example, the city of Saskatoon has coordinates 52.1333° N, 106.6833° W (according to google). We'd use the coordinates 52.1333 and -106.6833.
Note that the reinspection priority of the latest inspection is the inverse of rating. Low reinspection priority = good rating (the reinspection priority of other inspections are unused).
The violations must be listed by ID (as a comma separated list). This rudimentary interface is the result of time limitations (the admin interface was a stretch goal). Violations are:
- Refrigeration/Cooling/Thawing (must be 4°C/40°F or lower)
- Cooking/Reheating/Hot Holding (must be 60°C/140°F or higher)
- Storage/Preparation of Foods
- Hand Washing Facilities/Practices
- Food Handler Illness/Hygiene/Habits
- Food Protection
- Cleaning/Sanitizing of Equipment/Utensils
- Food Received from Approved Source
- Water Received from Approved Source
- Food Protection
- Accurate Thermometer Available to Monitor Food Temperatures
- Construction/Storage/Cleaning of Equipment/Utensils
- Garbage Storage and/or Removal
- Insect/Rodent Control
- Construction/Maintenance and/or Cleaning of Premises
- Plumbing/Lighting/Ventilation
In order for changes to the name, address, and coordinates (as well as adding and removing locations) to appear in the multi-map, you must clear the cache (as the data displayed in the multi-map is otherwise permanently cached). To do so, simply access /cache/clear
. To pre-populate the cache (so the next user who accesses the multi-map won't have to wait for it to be rebuilt), simply access /cache
.
The admin interface clashes with the CSV parser. To use the CSV parser, you'd end up trashing and recreating the database. This means that any changes you had previously made with the admin interface would be lost. This means the typical way to proceed is to make all changes either in the admin interface or with the CSV parser (using its translation system). The admin interface is more versatile (the CSV parser's translation system can only specify alternative names, addresses, and cities), so is the ideal choice.
The reason that the CSV parser existed is because we used to be able to retrieve data from the source website via CSV files that could be extracted from that site. The source website has since been taken down and the only reason to use the CSV parser is for the translation system. Since the admin interface replaces that, we can consider the CSV parser officially depreciated.
Thus, you'd build up the database once (which uses data that was processed by the CSV parser) and then use the admin interface for all future modifications.