moving session.get('id') into template helper function, deleting unneccesary ajax call, setting canPublish in model.