Best not mention Spartan on this Altera forum. However, I think we can overlook that...
You're code, whilst it could be improved, looks fundamentally there even if it doesn't employ best practice. I think it should do roughly what's been asked of you. So, a couple of questions back to you.
What isn't it doing? Anything? Nothing?
Have you constrained the I/O to the correct pins on the device?
Are any of the input or output signals active low - e.g. does the button generate a logic LOW on the pin when it's pressed (rather than a logic HIGH as your code is expecting).
Have you simulated any of this?
You don't need the 'temp' variable. Anything unnecessary should be removed to keep any code clear, simple and uncluttered.
Cheers,
Alex