show already uploaded asset
[pharext/pharext.org] / app / views / github / repo.phtml
index d32183068e95ff43e214e3daa57dfe250f1e8064..80b5c8c1dc7021d1853d5cf2cefd327ac96848b7 100644 (file)
        </h1>
 </div>
 
-<?php if (isset($exception)) : ?>
-       <?= $this->fetch("alert") ?>
-<?php elseif (isset($repo)) : ?>
-
 <div class="row">
        <div class="col-md-6">
                <div class="well">
                                <div class="col-md-12">
                                                <div class="checkbox">
                                                        <label for="hook-tag">
-                                                               <input id="hook-tag" type="checkbox" name="tag" value="1">
+                                                               <input id="hook-tag" type="checkbox" name="tag" value="1" <?= ($hook = $this->check($repo)) && in_array("create", $hook->events) ? "checked":"" ?>>
                                                                Automatically create a release when I push a tag.
                                                        </label>
                                                </div>
                                                <div class="checkbox">
                                                        <label for="hook-release">
-                                                               <input id="hook-release" type="checkbox" name="release" value="1">
+                                                               <input id="hook-release" type="checkbox" name="release" value="1" <?= ($hook = $this->check($repo)) && in_array("release", $hook->events) ? "checked":"" ?>>
                                                                Automatically upload a PHARext package as an asset to a release.
                                                        </label>
                                                </div>
                </h3>
        </div>
        <div class="panel-body">
+               <div class="row">
+                       <div class="col-md-8">
                <?php if (!empty($v->release)) : ?>
                        <p><?= $this->md($v->release->body) ?></p>
                <?php endif; ?>
                                </span>
                        <?php endif; ?>
                </ul>
+                       </div>
+                       <div class="col-md-4">
+               <?php if (!empty($v->release->assets)) : ?>
+                       <ul class="list-inline pull-right">
+                               <?php foreach ($v->release->assets as $asset) : ?>
+                               <?php if (fnmatch("*.ext.phar", $asset->name)) : ?>
+                               <li>
+                                       <a class="btn btn-success" href="<?= $this->e($asset->browser_download_url) ?>">
+                                               <span class="octicon octicon-package"></span>
+                                               <?= $this->e($asset->name) ?>
+                                       </a>
+                               </li>
+                               <?php endif; ?>
+                               <?php endforeach; ?>
+                       </ul>
+               <?php endif; ?>
+                       </div>
+               </div>
        </div>
 </div>
 <?php endforeach; ?>
 
-<?php endif; ?>