diff options
author | Malf Furious <m@lfurio.us> | 2018-10-22 03:15:18 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-10-22 03:15:18 -0400 |
commit | 9f0045366490199d2fcd562f8ddc4fc3503b3126 (patch) | |
tree | 3b873f6600872857fd859219efb3cd06cd886843 | |
parent | 176f65e60daa2a777aa03744c4df477cc812523d (diff) | |
download | scrott-9f0045366490199d2fcd562f8ddc4fc3503b3126.tar.gz scrott-9f0045366490199d2fcd562f8ddc4fc3503b3126.zip |
issue: Add start of issue modal view
-rw-r--r-- | app/view/issue.php | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/app/view/issue.php b/app/view/issue.php new file mode 100644 index 0000000..9447e62 --- /dev/null +++ b/app/view/issue.php @@ -0,0 +1,118 @@ +<?php + +/* + * SCROTT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * For more information, please refer to UNLICENSE + */ + +namespace issue_v; + +require_once "class/issue.class.php"; + +?> +<?php function userPanel(?\user $u, string $style, string $role, string $ts) : void { ?> + + <div class="<?=$style?>"> + <?php if (!$u) { ?> + <p class="text-center"> + <span class="glyphicon glyphicon-ban-circle"></span> + <?=$role?> + </p> + <?php } else { ?> + <table> + <tbody> + <tr> + <td><?=\datalsts\objHeadCircle($u, 30)?> </td> + + <td> + <?=$u->getDisplayName()?> + + <small> + <?=$role?> + <br /> + <?=$ts?> + </small> + </td> + </tr> + </tbody> + </table> + <?php } ?> + </div> + +<?php } ?> +<?php function issue(\issue $i) : void { ?> + + <?php $m = $i->getOPMesg(); ?> + + <div id="issueModal-<?=$i->guid?>" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog modal-lg" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span> + </button> + + <h4 class="modal-title"> + <span class="glyphicon glyphicon-inbox"></span> + <?=$i->name?> + <small>#<?=$i->numb?></small> + </h4> + </div> + + <div class="modal-body"> + <div class="row"> + <div class="col-md-8"> + <p><?=$m->renderMesg()?></p> + </div> + + <div class="col-md-4"> + <?php $closer = $i->getCloser(); ?> + <?php $assigns = $i->getAssignees(); ?> + <?php $owner = $i->getOwner(); ?> + <?php $author = $m->getAuthor(); ?> + <?php $members = $i->getMembers(); ?> + + <?php if ($closer) { ?> + <?=userPanel($closer, "alert alert-success", "closed", $i->closed)?> + <?php } ?> + + <?php if (count($assigns) == 0) { ?> + <?=userPanel(NULL, "alert alert-danger", "unassigned", "")?> + <?php } ?> + + <?php foreach ($assigns as $assign) { ?> + <?php if ($assign->signedoff != "") { ?> + <?=userPanel($assign->assignee, "alert alert-success", "signed off", $assign->signedoff)?> + <?php } else { ?> + <?=userPanel($assign->assignee, "alert alert-warning", "assigned", $assign->assigned)?> + <?php } ?> + <?php } ?> + + <?=userPanel($owner, "alert alert-info", "opened", $i->created)?> + + <?php if ($author->guid != $owner->guid) { ?> + <?=userPanel($author, "alert alert-info", "authored", $m->created)?> + <?php } ?> + + <?php if (count($members) != 0) { ?> + <hr /> + <?php } ?> + + <?php foreach ($members as $m) { ?> + <?=userPanel($m, "well", "cc'd", "")?> + <?php } ?> + </div> + </div> + </div> + </div> + </div> + </div> + +<?php } ?> |