Merge branch '1.2'
Conflicts: composer.lock resources/views/partials/incidents.blade.php
This commit is contained in:
@@ -62,7 +62,13 @@ class StatusPageController extends Controller
|
||||
$allIncidents = Incident::notScheduled()->where('visible', '>=', $incidentVisiblity)->whereBetween('created_at', [
|
||||
$startDate->copy()->subDays($daysToShow)->format('Y-m-d').' 00:00:00',
|
||||
$startDate->format('Y-m-d').' 23:59:59',
|
||||
])->orderBy('created_at', 'desc')->get()->groupBy(function (Incident $incident) use ($dateTimeZone) {
|
||||
])->orderBy('scheduled_at', 'desc')->orderBy('created_at', 'desc')->get()->groupBy(function (Incident $incident) use ($dateTimeZone) {
|
||||
// If it's scheduled, get the scheduled at date.
|
||||
if ($incident->is_scheduled) {
|
||||
return (new Date($incident->scheduled_at))
|
||||
->setTimezone($dateTimeZone)->toDateString();
|
||||
}
|
||||
|
||||
return (new Date($incident->created_at))
|
||||
->setTimezone($dateTimeZone)->toDateString();
|
||||
});
|
||||
|
||||
@@ -142,7 +142,7 @@ class Incident extends Model implements HasPresenter
|
||||
*/
|
||||
public function getIsScheduledAttribute()
|
||||
{
|
||||
return $this->getOriginal('scheduled_at');
|
||||
return $this->getOriginal('scheduled_at') !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -129,6 +129,34 @@ class IncidentPresenter extends AbstractPresenter
|
||||
return $this->wrappedObject->scheduled_at->setTimezone($this->setting->get('app_timezone'))->format('d/m/Y H:i');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a formatted timestamp for use within the timeline.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function timestamp_formatted()
|
||||
{
|
||||
if ($this->wrappedObject->is_scheduled) {
|
||||
return $this->scheduled_at_formatted;
|
||||
} else {
|
||||
return $this->created_at_formatted;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the iso timestamp for use within the timeline.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function timestamp_iso()
|
||||
{
|
||||
if ($this->wrappedObject->is_scheduled) {
|
||||
return $this->scheduled_at_iso;
|
||||
} else {
|
||||
return $this->created_at_iso;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the status with an icon.
|
||||
*
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^5.5.9",
|
||||
"laravel/framework": "~5.1.10",
|
||||
"laravel/framework": "5.1.12",
|
||||
"alt-three/emoji": "^1.2",
|
||||
"alt-three/validator": "^1.2",
|
||||
"barryvdh/laravel-cors": "^0.5",
|
||||
|
||||
2
composer.lock
generated
2
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "70ca29984807ed324db890c91c3a1492",
|
||||
"hash": "05f03078291036582d00ac77cb0c77e2",
|
||||
"packages": [
|
||||
{
|
||||
"name": "alt-three/emoji",
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
<br>
|
||||
<small class="date">
|
||||
@if($with_link)
|
||||
<a href="{{ route('incident', ['id' => $incident->id]) }}"><abbr class="timeago" data-toggle="tooltip" data-placement="right" title="{{ $incident->created_at_formatted }}" data-timeago="{{ $incident->created_at_iso }}"></abbr></a>
|
||||
<a href="{{ route('incident', ['id' => $incident->id]) }}"><abbr class="timeago" data-toggle="tooltip" data-placement="right" title="{{ $incident->timestamp_formatted }}" data-timeago="{{ $incident->timestamp_iso }}"></abbr></a>
|
||||
@else
|
||||
<abbr class="timeago" data-toggle="tooltip" data-placement="right" title="{{ $incident->created_at_formatted }}" data-timeago="{{ $incident->created_at_iso }}"></abbr>
|
||||
<abbr class="timeago" data-toggle="tooltip" data-placement="right" title="{{ $incident->timestamp_formatted }}" data-timeago="{{ $incident->timestamp_iso }}"></abbr>
|
||||
@endif
|
||||
</small>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user