osuosl / orvsd_central

5 stars 2 forks source link

Build better forms #150

Open justinnoah opened 9 years ago

justinnoah commented 9 years ago

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.

Kennric commented 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.

justinnoah commented 9 years ago

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