converted new and edit templates to modals