public function renderStats($id)
 {
     $course = $this->courseRegistry->course;
     if (!$this->user->isAllowed('course', 'viewStats')) {
         throw new \Nette\Application\BadRequestException('Forbidden', 403);
     }
     $this->template->course = $course;
     $this->template->reviewStats = $this->courseRepository->getReviewStats($course);
     $this->template->submittedReviews = $this->courseRepository->getSubmittedReviewsStats($course);
     $this->template->problems = $this->courseRepository->getProblemReviewsStats($course);
 }
 public function renderHtml($id, $toFile = FALSE)
 {
     $messages = $this->messageRepository->findLatest($this->courseRepository->find($id));
     $content = '';
     foreach ($messages as $message) {
         $content .= '<div class="message">' . Markdown::defaultTransform('[**' . $message->user->name . '**](' . $this->link('User:default', $message->user->id) . ') ' . $message->text) . '</div>';
     }
     if ($toFile) {
         $this->generatedFilesStorage->save($content, $id, 'html', '/chat/');
         echo $content;
         $this->terminate();
     } else {
         echo $content;
     }
     $this->terminate();
 }
 public function renderDefault()
 {
     $this->deliver(array_reverse($this->courseRepository->findAll()));
 }