webhook create&delete
[pharext/pharext.org] / app / views / github / repo.phtml
1 <?php $this->layout("layout") ?>
2
3 <div class="page-header">
4 <h1>
5 <?php if (isset($repo)) : ?>
6 <?php if ($repo->fork) : ?>
7 <span title="fork" class="mega-octicon octicon-repo-forked" aria-hidden="true"></span>
8 <?php elseif ($repo->private) : ?>
9 <span title="fork" class="mega-octicon octicon-key" aria-hidden="true"></span>
10 <?php else : ?>
11 <span title="repo" class="mega-octicon octicon-repo" aria-hidden="true"></span>
12 <?php endif; ?>
13 <?= $this->e($repo->name) ?>
14 <?php elseif (isset($name)) : ?>
15 <?= $this->e($name) ?>
16 <?php else : ?>
17 Unknown Repository
18 <?php endif; ?>
19 - <small>Github</small>
20 </h1>
21 </div>
22
23 <?php if (isset($exception)) : ?>
24 <?= $this->fetch("alert") ?>
25 <?php elseif (isset($repo)) : ?>
26
27 <div class="row">
28 <div class="col-md-6">
29 <div class="well">
30 <p><?= $this->e($repo->description) ?></p>
31 </div>
32 </div>
33 <div class="col-md-6">
34 <div class="row text-center">
35 <div class="col-md-4">
36 <span title="Number of watchers" class="mega-octicon octicon-eye" aria-hidden="true"></span>
37 <br>
38 <span class="label label-success">
39 <?= $repo->watchers_count ?> Watchers
40 </span>
41 </div>
42 <div class="col-md-4">
43 <span title="Number of stars" class="mega-octicon octicon-star" aria-hidden="true"></span>
44 <br>
45 <span class="label label-primary">
46 <?= $repo->stargazers_count ?> Stars
47 </span>
48 </div>
49 <div class="col-md-4">
50 <span title="Number of forks" class="mega-octicon octicon-repo-forked" aria-hidden="true"></span>
51 <br>
52 <span class="label label-default">
53 <?= $repo->forks_count ?> Forks
54 </span>
55 </div>
56 </div>
57 </div>
58 </div>
59
60 <div class="row">
61 <div class="col-md-6">
62 <div class="row">
63 <div class="col-md-8">
64 <p>Has a <code>config*.m4</code> file?</p>
65 </div>
66 <div class="col-md-4 text-center">
67 <p>
68 <?php if (!empty($repo->config_m4)) : ?>
69 <span class="label label-info">YES</span>
70 <?php else : ?>
71 <span class="label label-warning">NO</span>
72 <?php endif; ?>
73 </p>
74 </div>
75 </div>
76
77 <div class="row">
78 <div class="col-md-8">
79 <p>Has a <code>package*.xml</code> file?</p>
80 </div>
81 <div class="col-md-4 text-center">
82 <p>
83 <?php if (!empty($repo->package_xml)) : ?>
84 <span class="label label-info">YES</span>
85 <?php else : ?>
86 <span class="label label-warning">NO</span>
87 <?php endif; ?>
88 </p>
89 </div>
90 </div>
91
92 <div class="row">
93 <div class="col-md-8">
94 <p>Has a <code>pharext_package.php</code> file?</p>
95 </div>
96 <div class="col-md-4 text-center">
97 <p>
98 <?php if (!empty($repo->pharext_package_php)) : ?>
99 <span class="label label-info">YES</span>
100 <?php else : ?>
101 <span class="label label-warning">NO</span>
102 <?php endif; ?>
103 </p>
104 </div>
105 </div>
106
107 <div class="row">
108 <div class="col-md-8">
109 <p>Is the <code>pharext</code> hook enabled?</p>
110 </div>
111 <div class="col-md-4 text-center">
112 <?php if ($this->check($repo)) : ?>
113 <span class="label label-info">YES</span>
114 <?php else : ?>
115 <span class="label label-warning">NO</span>
116 <?php endif; ?>
117 </div>
118 </div>
119 </div>
120
121 <div class="col-md-6">
122
123 <div class="row text-center">
124 <div class="col-md-6">
125 <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/add") ?>">
126 <button type="submit" class="btn btn-lg btn-block btn-success <?= $this->check($repo) ? "disabled":"" ?>">Enable Hook</button>
127 </form>
128 </div>
129 <div class="col-md-6">
130 <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/del") ?>">
131 <button class="btn btn-lg btn-block btn-danger <?= $this->check($repo) ? "":"disabled" ?>">Disable Hook</button>
132 </form>
133 </div>
134 </div>
135 </form>
136 </div>
137 </div>
138
139 <h2>Release History</h2>
140 <?php if (empty($repo->tags) || !count((array) $repo->tags)) : ?>
141 <div class="alert alert-warning" role="alert">
142 <p class="text-danger">No releases or tags found.</p>
143 </div>
144 <?php endif; ?>
145
146 <?php foreach ($repo->tags as $name => $v) : ?>
147 <div class="panel panel-<?= empty($v->release) ? "info": "primary" ?>">
148 <div class="panel-heading">
149 <h3 class="panel-title">
150 <?php if (empty($v->release)) : ?>
151 <?= $this->e($v->tag->name) ?>
152 <span class="label label-default pull-right">Tag</span>
153 <?php else : ?>
154 <?= $this->e($v->release->name) ?>
155 <span class="label label-info pull-right">Release</span>
156 <?php endif; ?>
157 </h3>
158 </div>
159 <div class="panel-body">
160 <?php if (!empty($v->release)) : ?>
161 <p><?= $this->md($v->release->body) ?></p>
162 <?php endif; ?>
163 <ul class="list-inline">
164 <li>
165 <span class="octicon octicon-tag" title="Tag"></span>
166 <span class="label label-default"><?= $this->e($v->tag->name) ?></span>
167 </li>
168
169 <?php if (!empty($v->release)) : ?>
170 <li>
171 <span class="octicon octicon-git-branch" title="Branch"></span>
172 <span class="label label-default"><?= $this->e($v->release->target_commitish) ?></span>
173 </li>
174 <li>
175 <span class="octicon octicon-clock" title="Date"></span>
176 <span class="label label-default">
177 <time datetime="<?= $v->release->published_at ?>">
178 <?= $this->utc($v->release->published_at)->format("Y-m-d H:i T") ?>
179 </time>
180 </span>
181 <?php endif; ?>
182 </ul>
183 </div>
184 </div>
185 <?php endforeach; ?>
186
187 <?php endif; ?>