flush
[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 <div class="row">
123 <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/" . ($this->check($repo) ? "upd" : "add")) ?>">
124 <div class="col-md-12">
125 <div class="checkbox">
126 <label for="hook-tag">
127 <input id="hook-tag" type="checkbox" name="tag" value="1">
128 Automatically create a release when I push a tag.
129 </label>
130 </div>
131 <div class="checkbox">
132 <label for="hook-release">
133 <input id="hook-release" type="checkbox" name="release" value="1">
134 Automatically upload a PHARext package as an asset to a release.
135 </label>
136 </div>
137 </div>
138 <?php if ($this->check($repo)) : ?>
139 <div class="col-md-6">
140 <button type="submit" class="btn btn-lg btn-block btn-info">
141 <span class="glyphicon glyphicon-ok-circle"></span>
142 Update Hook
143 </button>
144 </div>
145 <?php else : ?>
146 <div class="col-md-12">
147 <button type="submit" class="btn btn-lg btn-block btn-success">
148 <span class="octicon octicon-plug"></span>
149 Enable Hook
150 </button>
151 </div>
152 <?php endif; ?>
153 </form>
154 <!-- column wrapping! -->
155 <?php if ($this->check($repo)) : ?>
156 <div class="col-md-6">
157 <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/del") ?>">
158 <button class="btn btn-lg btn-block btn-danger">
159 <span class="glyphicon glyphicon-remove-circle"></span>
160 Remove Hook
161 </button>
162 </form>
163 </div>
164 <?php endif; ?>
165 </div>
166 </div>
167 </div>
168
169 <h2>Release History</h2>
170 <?php if (empty($repo->tags) || !count((array) $repo->tags)) : ?>
171 <div class="alert alert-warning" role="alert">
172 <p class="text-danger">No releases or tags found.</p>
173 </div>
174 <?php endif; ?>
175
176 <?php foreach ($repo->tags as $name => $v) : ?>
177 <div class="panel panel-<?= empty($v->release) ? "info": "primary" ?>">
178 <div class="panel-heading">
179 <h3 class="panel-title">
180 <?php if (empty($v->release)) : ?>
181 <?= $this->e($v->tag->name) ?>
182 <span class="label label-default pull-right">Tag</span>
183 <?php else : ?>
184 <?= $this->e($v->release->name) ?>
185 <span class="label label-info pull-right">Release</span>
186 <?php endif; ?>
187 </h3>
188 </div>
189 <div class="panel-body">
190 <?php if (!empty($v->release)) : ?>
191 <p><?= $this->md($v->release->body) ?></p>
192 <?php endif; ?>
193 <ul class="list-inline">
194 <li>
195 <span class="octicon octicon-tag" title="Tag"></span>
196 <span class="label label-default"><?= $this->e($v->tag->name) ?></span>
197 </li>
198
199 <?php if (!empty($v->release)) : ?>
200 <li>
201 <span class="octicon octicon-git-branch" title="Branch"></span>
202 <span class="label label-default"><?= $this->e($v->release->target_commitish) ?></span>
203 </li>
204 <li>
205 <span class="octicon octicon-clock" title="Date"></span>
206 <span class="label label-default">
207 <time datetime="<?= $v->release->published_at ?>">
208 <?= $this->utc($v->release->published_at)->format("Y-m-d H:i T") ?>
209 </time>
210 </span>
211 <?php endif; ?>
212 </ul>
213 </div>
214 </div>
215 <?php endforeach; ?>
216
217 <?php endif; ?>