views: fix base url to omit scheme for when we connect through a https gateway
[pharext/pharext.org] / app / views / github / repo.phtml
index 2245aa9d777e57554d8b14d21c6fed34e24468f4..21d640c317d8881f111b0a6525a7682ec9f3ad42 100644 (file)
@@ -1,4 +1,4 @@
-<?php $this->layout("layout", ["title" => "Github: {$repo->name}"]) ?>
+<?php $this->layout("layout", ["title" => "Github: ". (isset($repo) ? $repo->name : $name)]) ?>
 
 <div class="page-header">
        <h1>
 
        <div class="col-sm-6">
                <div class="row">
-                       <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/" . (!empty($hook) ? "upd" : "add")) ?>">
+                       <form method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/" . (!empty($hook) ? "upd" : "add")) ?>">
                                <div class="col-sm-6">
                                        <h4>PHARext Options:</h4>
                                        <div class="checkbox">
                        <!-- column wrapping! -->
                        <?php if ($this->check($repo)) : ?>
                        <div class="col-sm-6">
-                               <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/hook/del") ?>"> 
+                               <form method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/hook/del") ?>">
                                <button class="btn btn-lg btn-block btn-danger">
                                        <span class="glyphicon glyphicon-remove-circle"></span>
                                        Remove Hook
                <?php if (!empty($v->release)) : ?>
                        <p><?= $this->md($v->release->body) ?></p>
                <?php endif; ?>
-               <ul class="list-inline">
-                       <li>
-                               <span class="octicon octicon-tag" title="Tag"></span>
-                               <span class="label label-default"><?= $this->e($v->tag->name) ?></span>
-                       </li>
+                               <ul class="list-inline">
+                                       <li>
+                                               <span class="octicon octicon-tag" title="Tag"></span>
+                                               <span class="label label-default"><?= $this->e($v->tag->name) ?></span>
+                                       </li>
 
-                       <?php if (!empty($v->release)) : ?>
-                       <li>
-                               <span class="octicon octicon-git-branch" title="Branch"></span>
-                               <span class="label label-default"><?= $this->e($v->release->target_commitish) ?></span>
-                       </li>
-                       <li>
-                               <span class="octicon octicon-clock" title="Date"></span>
-                               <span class="label label-default">
-                                       <time datetime="<?= $v->release->published_at ?>">
-                                               <?= $this->utc($v->release->published_at)->format("Y-m-d H:i T") ?>
-                                       </time>
-                               </span>
-                       <?php endif; ?>
-               </ul>
+                                       <?php if (!empty($v->release)) : ?>
+                                       <li>
+                                               <span class="octicon octicon-git-branch" title="Branch"></span>
+                                               <span class="label label-default"><?= $this->e($v->release->target_commitish) ?></span>
+                                       </li>
+                                       <li>
+                                               <span class="octicon octicon-clock" title="Date"></span>
+                                               <span class="label label-default">
+                                                       <time datetime="<?= $v->release->published_at ?>">
+                                                               <?= $this->utc($v->release->published_at)->format("Y-m-d H:i T") ?>
+                                                       </time>
+                                               </span>
+                                       <?php endif; ?>
+                               </ul>
                        </div>
                        <div class="col-sm-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) ?>">
+                       <?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 else: ?>
+                               <form class="form-inline pull-right" method="post" action="<?= $baseUrl->mod(":./github/repo/". $repo->full_name ."/release") ?>">
+                                       <input type="hidden" name="tag" value="<?= $this->e($v->tag->name) ?>">
+                                       <div class="checkbox">
+                                               <label for="hook-zend">
+                                                       <input id="hook-zend" type="checkbox" name="zend" value="1" <?= (!empty($hook) && !empty($hook->config->zend)) ? "checked":""?>>
+                                                       Mark as a ZendExtension.
+                                               </label>
+                                       </div>
+                                       <div class="checkbox <?= empty($repo->package_xml) ? "disabled text-muted":"" ?>">
+                                               <label for="hook-pecl">
+                                                       <input id="hook-pecl" type="checkbox" name="pecl" value="1" <?= (!empty($hook) && !empty($hook->config->pecl)) ? "checked":""?> <?= empty($repo->package_xml) ? "disabled":"" ?>>
+                                                       Use PECL package XML file.
+                                               </label>
+                                       </div>
+                                       <button class="btn btn-warning">
                                                <span class="octicon octicon-package"></span>
-                                               <?= $this->e($asset->name) ?>
-                                       </a>
-                               </li>
-                               <?php endif; ?>
-                               <?php endforeach; ?>
-                       </ul>
-               <?php endif; ?>
+                                               Release PHARext package
+                                       </button>
+                               </form>
+                       <?php endif; ?>
+                       
                        </div>
                </div>
        </div>