Name-Link Check

Did a little work on the admin section to fix something that has annoyed me for a little while and also make what I am inputting a little more thoroughly checked. I have added some new jquery functions into the add and edit film pages. Now when you add a film the submit button will not appear until you have a valid link (that isn't a duplicate already in the db) on the form.

What I have done is to write a function that takes the name you have imputed and pull out the characters I don't want to use in url's along with removing spaces and adding in -'s instead. This is also converted to lower case and passed over to the link section of the form. Once this happens it runs the function to check if that is already used as a link. If not you get the ok, the submit button appears, if not then your told you need to change it and the submit button either disappears or is still not shown.

This way I no longer have to re-write in (in lowercase) the film name and make it all lovely as a url as it is done for me and also runs the check. This means if it does bring back that you need to change it, you can make a change pretty easily. This will come in handy for re-makes as those films will contain the same name, and to make the link unique just add in the year of the film as well.

I have also rolled this out to the update film page so we have the same checks going on to make sure I keep a set standard throughout the checking. I will also be rolling this out to the list create and update pages as well as a new addition for lists where you can set them as "done", which means they wont show up in the add to list section for films. This will be useful for lists that are time critical much like my films I saw in 2015 one. There is no point adding films after then so no need to show it in the list of available lists.

>>back<<