refactor guthub api
[pharext/pharext.org] / app / views / github / index.phtml
1 <?php $this->layout("layout") ?>
2
3 <div class="page-header">
4 <h1>
5 Github Repositories
6 <small>Manage your pharext webhook</small>
7 </h1>
8 </div>
9
10 <table class="table table-hover">
11 <thead>
12 <tr>
13 <th>Repo</th>
14 <th class="text-center">Fork</th>
15 <th class="text-right">Last Pushed</th>
16 <th class="text-center">Hook</th>
17 </tr>
18 </thead>
19 <tbody>
20 <?php foreach ($repos as $repo) : ?>
21 <tr class="<?= $this->check($repo) ? "success" : "" ?>">
22 <th>
23 <a href="<?= $baseUrl->mod("./github/repo/".$repo->full_name) ?>">
24 <big class="text-primary" title="<?= $this->e($repo->description) ?>"><?= $this->e($repo->name) ?></big>
25 </a>
26 <br>
27 <small><?= $this->e($this->shorten($repo->description)) ?></small>
28 </th>
29 <td class="text-center"><?php if ($repo->fork) : ?>
30 <span title="fork" class="octicon octicon-repo-forked" aria-hidden="true"></span>
31 <?php endif; ?>
32 </td>
33 <td class="text-right"><time datetime="<?= $this->e($repo->pushed_at) ?>"><?= $this->e($this->utc($repo->pushed_at)->format("Y-m-d H:i T")) ?></time></td>
34 <td class="text-center">
35 <form class="form-inline" style="display: inline-block" method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/add") ?>">
36 <input type="hidden" name="returnback" value="1">
37 <button type="submit" class="btn btn-primary <?= $this->check($repo) ? "disabled":"" ?>">
38 <span class="glyphicon glyphicon-plus" title="Add pharext hook"></span>
39 </button>
40 </form>
41 <form class="form-inline" style="display: inline-block" method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/del") ?>">
42 <input type="hidden" name="returnback" value="1">
43 <button type="submit" class="btn btn-danger <?= $this->check($repo) ? "":"disabled" ?>">
44 <span class="glyphicon glyphicon-remove" title="Remove hook"></span>
45 </button>
46 </form>
47 </div>
48 </td>
49 </tr>
50 <?php endforeach; ?>
51 </tbody>
52 </table>
53
54 <nav>
55 <ul class="pager">
56 <li class="<?= $links->getFirst() ?"":"disabled" ?>"><a href="?page=<?= $links->getPage("first") ?>" title="First Page"><span class="glyphicon glyphicon-fast-backward"></span></a></li>
57 <li class="<?= $links->getPrev() ?"":"disabled" ?>"><a href="?page=<?= $links->getPage("prev") ?>" rel="prev" title="Previous Page"><span class="glyphicon glyphicon-chevron-left"></span> Previous</a></li>
58 <li class="<?= $links->getNext() ?"":"disabled" ?>"><a href="?page=<?= $links->getPage("next") ?>" rel="next" title="Next Page">Next <span class="glyphicon glyphicon-chevron-right"></span></a></li>
59 <li class="<?= $links->getLast() ?"":"disabled" ?>"><a href="?page=<?= $links->getPage("last") ?>" title="Last Page"><span class="glyphicon glyphicon-fast-forward"></span></a></li>
60 </ul>
61 </nav>