1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
@extends('layouts.app')
@section('content')
<div class="container" style="margin-top: 100px;">
<div class="row justify-content-center">
<div class="col-sm-12">
<div class="row" >
<div class="col-sm-4">
<div class="row">
<div class="col-sm-2">
<button class="btn" onclick="buscarProjeto(this.parentElement.parentElement.children[1].children[0])">
<img src="{{asset('img/icons/logo_lupa.png')}}" alt="">
</button>
</div>
<div class="col-sm-10">
<input type="text" class="form-control form-control-edit" placeholder="Digite o nome do projeto" onkeyup="buscarProjeto(this)">
</div>
</div>
</div>
<div class="col-sm-1">
</div>
<div class="col-sm-5" style="float: center;">
<h4 class="titulo-table">Resultados</h4>
</div>
</div>
<hr>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-12">
<table class="table table-bordered" style="display: block; white-space: nowrap; border-radius:10px; margin-bottom:0px">
<thead>
<tr>
<th scope="col" style="width: 100%;">Nome do projeto</th>
<th scope="col">Proponente</th>
<th scope="col">Área</th>
<th scope="col">N. Planos</th>
<th scope="col">Avaliador Externo</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody id="projetos">
@foreach($trabalhos as $trabalho)
<tr>
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">
{{$trabalho->titulo}}
</td>
<td>
{{$trabalho->proponente->user->name}}
</td>
<td>
{{$trabalho->area->nome}}
</td>
<td>
{{$trabalho->participantes->count()}}
</td>
<td>
@if($trabalho->avaliadors->count() > 0)
@foreach($trabalho->avaliadors as $avaliador)
{{$avaliador->user->name}}<br>
@endforeach
@endif
</td>
@if($trabalho->avaliadors->count() > 0)
<td>
@foreach($trabalho->avaliadors as $avaliador)
{{$avaliador->pivot->recomendacao}}<br>
@endforeach
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@section('javascript')
<script>
function buscarProjeto(input) {
var projetos = document.getElementById('projetos').children;
if(input.value.length > 2) {
for(var i = 0; i < projetos.length; i++) {
var nomeProjeto = projetos[i].innerText;
if(nomeProjeto.substr(0).indexOf(input.value) >= 0) {
projetos[i].style.display = "";
} else {
projetos[i].style.display = "none";
}
}
} else {
for(var i = 0; i < projetos.length; i++) {
projetos[i].style.display = "";
}
}
}
</script>
@endsection