added code to disable the second tab until the user has connected to a db and the templates field is filled.