- <td class="text-right">
- <a class="btn btn-primary <?= $this->check($repo) ? "disabled":"" ?>"
- href="<?= $baseUrl->mod("./github/repo/".$repo->full_name) ?>">
- <span class="glyphicon glyphicon-plus" title="Add pharext hook"></span></a>
- <a class="btn btn-danger <?= !$this->check($repo) ? "disabled":"" ?>"
- href="<?= $baseUrl->mod(["path" => "github/repo", "query" => "hook=del&repo=". urlencode($repo->full_name)]) ?>">
- <span class="glyphicon glyphicon-remove" title="Remove hook"></span></a>
+ <td class="text-center">
+ <?php if ($this->check($repo)) : ?>
+ <form class="form" style="display: inline-block" method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/del") ?>">
+ <input type="hidden" name="returnback" value="1">
+ <button type="submit" class="btn btn-block btn-danger">
+ <span class="glyphicon glyphicon-remove"></span>
+ Remove Hook
+ </button>
+ </form>
+ <?php else : ?>
+ <form class="form-inline" style="display: inline-block" method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/add") ?>">
+ <div class="checkbox">
+ <label for="hook-tag">
+ <input id="hook-tag" type="checkbox" name="tag" value="1" checked>
+ Release
+ </label>
+ </div>
+ <div class="checkbox">
+ <label for="hook-release">
+ <input id="hook-release" type="checkbox" name="release" value="1" checked>
+ Upload
+ </label>
+ </div>
+ <input type="hidden" name="returnback" value="1">
+ <button type="submit" class="btn btn-block btn-primary">
+ <span class="glyphicon glyphicon-plus"></span>
+ Enable Hook
+ </button>
+ </form>
+ <?php endif; ?>
+ </div>