better button layout and code placement for edit course materials page