Open justinnoah opened 9 years ago
I agree, the generic forms have not worked out well. I would prefer to see forms written for specific use cases, customized to that use case. The site add/edit forms are probably the first thing that need refactoring - especially as we move to a workflow where sites must be added before they can be tracked - we want site installers to start with adding the site to OC before installing the instance on the platform.
The site form should really only have fields for: Name, baseurl, directory, and moodle version. Location should also appear, but should default to 'platform' (some sites may exist in other locations now, but will be moved to the platform later). The 'dev' field I believe was intended to distinguish dev and test sites from production sites, but I don't believe it is used anywhere.
To finish, javascript needs to be written for form validation and the post action needs to be taken care of on the Flask side. On the template, where objects are parsed, that should be a new API end point where a list of names and corresponding IDs are returned for a given object type and that data should be used to fill out the available {{category}} selection box.
For proper handling of form validation on the Flask side, see: https://flask-wtf.readthedocs.org/en/latest/form.html
Currently our forms are very generic and we have issues like #130 and #145. We should use this issue as a discussion on how we want to proceed with the forms. I'm in favor of a less generic route.