refactor show element function

remove ajax calls to static pages
create partials used for pages & .js