diff options
author | Malf Furious <m@lfurio.us> | 2018-11-05 03:32:06 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-11-05 03:32:06 -0500 |
commit | 434ebff8466ead8f9bb4c0f00037a107cbf842c4 (patch) | |
tree | 183133c4c4f6ccb7c1e0829c771b02a34eb92901 /app | |
parent | 81ba021468e38de09ac292115bb2f15c9d4deec0 (diff) | |
download | scrott-434ebff8466ead8f9bb4c0f00037a107cbf842c4.tar.gz scrott-434ebff8466ead8f9bb4c0f00037a107cbf842c4.zip |
Add pad closed issues view
This view is routable from app/<pad_guid>/closed. It is a separate view
for displaying the closed issues of a pad. index.php as well as the pad
model code is also updated to support this view.
This view currently *does not* support paging. This will very likely be
added in the future.
Signed-off-by: Malf Furious <m@lfurio.us>
Diffstat (limited to 'app')
-rw-r--r-- | app/index.php | 5 | ||||
-rw-r--r-- | app/model/pad.php | 2 | ||||
-rw-r--r-- | app/view/pad_closed.php | 64 |
3 files changed, 70 insertions, 1 deletions
diff --git a/app/index.php b/app/index.php index 21f3036..4607351 100644 --- a/app/index.php +++ b/app/index.php @@ -111,7 +111,10 @@ function main(array $argv) : void $obj = new pad($argv[0]); setPageObj($obj); setPageName($obj->name); - require "view/pad.php"; + if (isset($argv[1]) && $argv[1] == "closed") + require "view/pad_closed.php"; + else + require "view/pad.php"; break; } } diff --git a/app/model/pad.php b/app/model/pad.php index d7cfb23..0090c27 100644 --- a/app/model/pad.php +++ b/app/model/pad.php @@ -26,4 +26,6 @@ foreach ($stages as $s) $issues = array_merge($issues, $i); } +$closed_issues = $pad->getClosedIssues_ordByClosed(); + ?> diff --git a/app/view/pad_closed.php b/app/view/pad_closed.php new file mode 100644 index 0000000..19864cd --- /dev/null +++ b/app/view/pad_closed.php @@ -0,0 +1,64 @@ +<?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 + */ + +require_once "model/pad.php"; +require_once "view/stdpage.php"; +require_once "view/datalsts.php"; +require_once "view/issue.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( getPageName() )?> + </head> + + <body> + <?php foreach ($closed_issues as $i) { ?> + <?=issue_v\issue($i)?> + <?php } ?> + + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <div class="well well-lg"> + <div class="row"> + <div class="col-md-12"> + <h1> + <span class="glyphicon glyphicon-edit"></span> + <?=$pad->name?> + + <a href="<?=ar()?>/<?=$pad->guid?>" class="btn btn-default"> + View open issues + </a> + </h1> + </div> + </div> + </div> + + <div class="panel panel-default"> + <table class="table table-hover"> + <?php foreach ($closed_issues as $i) { ?> + <?=datalsts\issueListItem($i)?> + <?php } ?> + </table> + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> |