Refactor views/admin/template.php

Signed-off-by: Kenji Suzuki <kenji.uui@gmail.com>