Skip to content
Browse files

display output of ApiGen

  • Loading branch information...
1 parent 14f916a commit 91df69dd3b78d95ae920c91700ed6af6ec61c170 @juzna committed
Showing with 20 additions and 0 deletions.
  1. +10 −0 app/presenters/HomepagePresenter.php
  2. +10 −0 app/templates/Homepage/result.latte
View
10 app/presenters/HomepagePresenter.php
@@ -11,10 +11,20 @@ protected function startup() {
$this->session->start();
}
+ // list of repos
public function renderDefault() {
$this->template->repos = $this->db->table('repo');
}
+ // result of doc generating
+ public function renderResult($repoId) {
+ if(!$repo = $this->db->table('repo')->get((int) $repoId)) throw new \Nette\Application\BadRequestException("Repo not found");
+
+ $this->template->repo = $repo;
+ $this->template->result = $this->db->table('result')->get($repo->apigenResultId);
+ }
+
+
protected function createComponentAddRepoForm() {
$frm = new Form;
$frm->addProtection();
View
10 app/templates/Homepage/result.latte
@@ -0,0 +1,10 @@
+{block #content}
+<h1>Status of {$repo->name} ({$repo->dir})</h1>
+
+{if $result}
+ <strong>Command</strong>: <span>{$result->cmd}</span><br>
+ <pre>{$result->output}</pre>
+{else}
+ <p class="error">No result found for this repository</p>
+{/if}
+

0 comments on commit 91df69d

Please sign in to comment.
Something went wrong with that request. Please try again.