move temolateEdit to template.js