Fix some bugs with the quick edit feature

Fixes a couple of bugs with quick edit:
1. Quick edit didn't work if you chose not to display the subject in topics.
2. Missing span caused a JS error when saving changes via quick edit.

Also cleaned up the code a tad bit. Thanks to @emnauele45 for the fixes.