Fix bug in TopicDetailView

Previously, all topic elements were included in the view at all times.
Now only the elements that actually belong to the topic in question are
included.