Closed Rowbotronics closed 5 years ago
I can easily fix the validation. I thought it was already doing that, but must not be.
I am not sure I agree with having the name default to the currently selected template though. To me that would result in an easily/accidental overwrite if you are trying to clone a template.
The other issue is that the web page does not know the actual file at the present time. With the directory structure there, it made for long ugly names. The full path is only known by the server. I could modify webpage to have a hidden field to hold the name if you really feel it is necessary.
We also talked about saving them in the database. So I figure all of that will change anyway once we do that anyway.
that would result in an easily/accidental overwrite if you are trying to clone a template.
Well, we often need to edit templates, so being able to easily overwrite them would be good. We could just copy the standard file saving scheme that everyone is familiar with: 'save' to overwrite the current template, 'save as' to specify a new template name. Needing to type in the exact template name to save edits to a template is quite tedious and error prone.
The other issue is that the web page does not know the actual file at the present time. With the directory structure there, it made for long ugly names.
If we're not going to present the directory structure to the user we might as well get rid of it. Let's just save all the templates in the same folder for now.
We also talked about saving them in the database. So I figure all of that will change anyway once we do that anyway.
Yeah, that is the plan, but I'm not sure if it will make it into the initial version. If any of the file specific stuff is too much of a pain to change for a short term fix I would say leave it. The UI elements shouldn't have to change, though, so I think it would be worthwhile to make those changes if we can.
The server throws a TypeError when attempting to save a template with no name entered. This should be handled more gracefully.
The input in the save dialog should also be populated with the name of the currently loaded template, rather than being blank.