[Poll] Restructured templates, added misssing poll related css

This commit is contained in:
Daniel
2020-11-23 15:06:23 +00:00
committed by Hugo Sales
parent 168b7d313a
commit 696ebe60e0
15 changed files with 122 additions and 197 deletions

View File

@@ -56,17 +56,16 @@ class ShowPoll
$user = Common::ensureLoggedIn();
$poll = Poll::getFromId((int) $id);
if ($poll == null) {
throw new NotFoundException('Poll does not exist');
}
$note = Note::getFromId($poll->getNoteId());
if (!$note->isVisibleTo($user)) {
if ($note == null || !$note->isVisibleTo($user)) {
throw new NoSuchNoteException();
}
if ($poll == null) {
throw new NotFoundException('Poll does not exist');
}
return ['_template' => 'Poll/showpoll.html.twig', 'poll' => $poll];
}
}