add a function on chooseTemplateButton to switch pages in stackedWidget. Also modified UI.