foreach template the buttons