webhook create&delete
[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 <?php if (isset($exception)) : ?>
11 <?= $this->fetch("alert") ?>
12 <?php elseif (isset($repos)) : ?>
13
14 <table class="table table-hover">
15 <thead>
16 <tr>
17 <th>Repo</th>
18 <th class="text-center">Fork</th>
19 <th class="text-right">Last Pushed</th>
20 <th class="text-center">Hook</th>
21 </tr>
22 </thead>
23 <tbody>
24 <?php foreach ($repos as $repo) : ?>
25 <tr class="<?= $this->check($repo) ? "success" : "" ?>">
26 <th>
27 <a href="<?= $baseUrl->mod("./github/repo/".$repo->full_name) ?>">
28 <big class="text-primary" title="<?= $this->e($repo->description) ?>"><?= $this->e($repo->name) ?></big>
29 </a>
30 <br>
31 <small><?= $this->e($this->shorten($repo->description)) ?></small>
32 </th>
33 <td class="text-center"><?php if ($repo->fork) : ?>
34 <span title="fork" class="octicon octicon-repo-forked" aria-hidden="true"></span>
35 <?php endif; ?>
36 </td>
37 <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>
38 <td class="text-center">
39 <form class="form-inline" style="display: inline-block" method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/add") ?>">
40 <input type="hidden" name="returnback" value="1">
41 <button type="submit" class="btn btn-primary <?= $this->check($repo) ? "disabled":"" ?>">
42 <span class="glyphicon glyphicon-plus" title="Add pharext hook"></span>
43 </button>
44 </form>
45 <form class="form-inline" style="display: inline-block" method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/del") ?>">
46 <input type="hidden" name="returnback" value="1">
47 <button type="submit" class="btn btn-danger <?= $this->check($repo) ? "":"disabled" ?>">
48 <span class="glyphicon glyphicon-remove" title="Remove hook"></span>
49 </button>
50 </form>
51 </div>
52 </td>
53 </tr>
54 <?php endforeach; ?>
55 </tbody>
56 </table>
57
58 <nav>
59 <ul class="pager">
60 <?php
61 $first= $this->link("first");
62 $prev = $this->link("prev");
63 $next = $this->link("next");
64 $last = $this->link("last");
65 ?>
66 <li class="<?= $first ?"":"disabled" ?>"><a href="?page=<?= $first ?>" title="First Page"><span class="glyphicon glyphicon-fast-backward"></span></a></li>
67 <li class="<?= $prev ?"":"disabled" ?>"><a href="?page=<?= $prev ?>" rel="prev" title="Previous Page"><span class="glyphicon glyphicon-chevron-left"></span> Previous</a></li>
68 <li class="<?= $next ?"":"disabled" ?>"><a href="?page=<?= $next ?>" rel="next" title="Next Page">Next <span class="glyphicon glyphicon-chevron-right"></span></a></li>
69 <li class="<?= $last ?"":"disabled" ?>"><a href="?page=<?= $last ?>" title="Last Page"><span class="glyphicon glyphicon-fast-forward"></span></a></li>
70 </ul>
71 </nav>
72 <?php endif; ?>