Base
This commit is contained in:
74
resources/views/proyectos/historia.blade.php
Normal file
74
resources/views/proyectos/historia.blade.php
Normal file
@ -0,0 +1,74 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="row">
|
||||
<div class="col-md-6">
|
||||
Historial Proyecto <a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<a href="{{nUrl('proyectos', 'advance', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
</div>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body"><?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Etapa</th>
|
||||
<th>Estado</th>
|
||||
<th>Fecha</th>
|
||||
<th>Duración</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$estados = [];
|
||||
foreach ($proyecto->estados() as $estado) {
|
||||
$estados[$estado->fecha] []= $estado;
|
||||
}
|
||||
ksort($estados);
|
||||
$ff = null;
|
||||
?>
|
||||
@foreach ($estados as $fecha => $es)
|
||||
<?php
|
||||
$f = \Carbon\Carbon::parse($fecha, config('app.timezone'));
|
||||
usort($es, function($a, $b) {
|
||||
return $a->tipo()->orden - $b->tipo()->orden;
|
||||
});
|
||||
$estado = $es[count($es) - 1];
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
@endif
|
||||
{{$estado->tipo()->etapa()->descripcion}}
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{$estado->tipo()->descripcion}}</td>
|
||||
<td>
|
||||
@if ($f->timestamp > 0)
|
||||
{{$f->format('d M Y')}}
|
||||
@else
|
||||
--
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($ff !== null)
|
||||
{{$f->longAbsoluteDiffForHumans($ff)}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<?php $ff = $f; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
Reference in New Issue
Block a user