mobile updates
This commit is contained in:
@ -17,6 +17,7 @@ use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
use TheTempusProject\Plugins\Wip as Plugin;
|
||||
use DateTime;
|
||||
|
||||
class Projects extends DatabaseModel {
|
||||
public $tableName = 'projects';
|
||||
@ -25,6 +26,7 @@ class Projects extends DatabaseModel {
|
||||
[ 'description', 'text', '' ],
|
||||
[ 'progress', 'int', '3' ],
|
||||
[ 'startDate', 'varchar', '32' ],
|
||||
[ 'endDate', 'varchar', '32' ],
|
||||
];
|
||||
public $plugin;
|
||||
|
||||
@ -73,7 +75,20 @@ class Projects extends DatabaseModel {
|
||||
$instance = $postArray;
|
||||
$end = true;
|
||||
}
|
||||
$instance->prettyStart = $instance->startDate;
|
||||
if ( ! empty( $instance->startDate ) ) {
|
||||
$startDate = DateTime::createFromFormat( 'Y-m', $instance->startDate );
|
||||
$startDateFormatted = $startDate->format('F Y');
|
||||
$instance->prettyStart = $startDateFormatted;
|
||||
} else {
|
||||
$instance->prettyStart = 'TBD';
|
||||
}
|
||||
if ( ! empty( $instance->endDate ) ) {
|
||||
$endDate = DateTime::createFromFormat( 'Y-m', $instance->endDate );
|
||||
$endDateFormatted = $endDate->format('F Y');
|
||||
$instance->prettyEnd = $endDateFormatted;
|
||||
} else {
|
||||
$instance->prettyEnd = 'TBD';
|
||||
}
|
||||
$out[] = $instance;
|
||||
if ( !empty( $end ) ) {
|
||||
$out = $out[0];
|
||||
@ -82,4 +97,4 @@ class Projects extends DatabaseModel {
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,24 +1,29 @@
|
||||
<div class="col-8 mx-auto p-3 rounded shadow-sm my-4 context-main-bg">
|
||||
<h1 class="text-center">Work in Progress</h1>
|
||||
<hr>
|
||||
{LOOP}
|
||||
<div class="wip-project">
|
||||
<h3 class="wip-project-title atb-green">{title}</h3>
|
||||
<small class=""><b>Started: </b><i>{prettyStart}</i></small>
|
||||
<div class="progress mt-2">
|
||||
<div class="progress-bar atb-green-bg" role="progressbar" style="width: {progress}%" aria-valuenow="{progress}" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
<div class="m-2 m-lg-4">
|
||||
<div class="col-12 mx-5 col-sm-10 col-lg-8 mx-auto p-4 rounded shadow-sm context-main-bg">
|
||||
<h1 class="text-center">Work in Progress</h1>
|
||||
<hr>
|
||||
{LOOP}
|
||||
<div class="wip-project">
|
||||
<h3 class="wip-project-title text-center text-md-start text-primary">{title}</h3>
|
||||
<div class="d-flex justify-content-between">
|
||||
<small><span class="text-muted">Started: </span><i class="">{prettyStart}</i></small>
|
||||
<small><span class="text-muted">Finished: </span><i class="">{prettyEnd}</i></small>
|
||||
</div>
|
||||
<div class="progress mt-2">
|
||||
<div class="progress-bar" role="progressbar" style="width: {progress}%" aria-valuenow="{progress}" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<div class="well my-3">
|
||||
{description}
|
||||
</div>
|
||||
</div>
|
||||
<div class="well my-3">
|
||||
{description}
|
||||
<div class="col-6 offset-3 my-2">
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 offset-3 my-2">
|
||||
<hr>
|
||||
</div>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="wip-project">
|
||||
<p>None Found</p>
|
||||
</div>
|
||||
{/ALT}
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="wip-project">
|
||||
<p>None Found</p>
|
||||
</div>
|
||||
{/ALT}
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user