Unverified Commit ebe89efe authored by carlos1270's avatar carlos1270 Committed by GitHub
Browse files

Merge pull request #77 from carlos1270/master

Layout
parents b8e96d8a e5084be3
...@@ -199,7 +199,7 @@ class EventoController extends Controller ...@@ -199,7 +199,7 @@ class EventoController extends Controller
// Mail::to($user->email) // Mail::to($user->email)
// ->send(new EventoCriado($user, $subject)); // ->send(new EventoCriado($user, $subject));
return redirect()->route('coord.home'); return redirect()->route('admin.editais')->with(['mensagem' => 'Edital criado com sucesso!']);
} }
public function armazenarAnexosTemp(Request $request){ public function armazenarAnexosTemp(Request $request){
...@@ -403,7 +403,8 @@ class EventoController extends Controller ...@@ -403,7 +403,8 @@ class EventoController extends Controller
$evento->update(); $evento->update();
$eventos = Evento::orderBy('nome')->get(); $eventos = Evento::orderBy('nome')->get();
return view('administrador.editais',['eventos'=>$eventos]);
return redirect( route('admin.editais') )->with(['mensagem' => 'Edital salvo com sucesso!', 'eventos'=>$eventos]);
} }
/** /**
......
...@@ -6,6 +6,7 @@ use Illuminate\Http\Request; ...@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
use Auth; use Auth;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use App\Evento;
class HomeController extends Controller class HomeController extends Controller
{ {
...@@ -29,7 +30,9 @@ class HomeController extends Controller ...@@ -29,7 +30,9 @@ class HomeController extends Controller
$eventos = \App\Evento::all(); $eventos = \App\Evento::all();
if(Auth::user()->administradors != null){ if(Auth::user()->administradors != null){
return view('administrador.index'); $eventos = Evento::orderBy('nome')->get();
return view('administrador.editais')->with(['eventos' => $eventos]);
} }
else if (Auth::user()->AdministradorResponsavel != null) { else if (Auth::user()->AdministradorResponsavel != null) {
return view('administradorResponsavel.index'); return view('administradorResponsavel.index');
......
...@@ -152,12 +152,17 @@ body{ ...@@ -152,12 +152,17 @@ body{
font-weight: bolder; font-weight: bolder;
} }
.botao-entrar { .btn-login {
background-color: rgb(0, 140, 255); background-color: rgb(0, 140, 255);
text-align: center; text-align: center;
border-radius: 3px; border-radius: 3px;
padding-left: 42%; width: 100%;
padding-right: 42%; font-weight: 700;
color: white;
}
.btn-login:hover {
color: black;
} }
.position-image { .position-image {
...@@ -473,3 +478,17 @@ button.close { ...@@ -473,3 +478,17 @@ button.close {
.background-red { .background-red {
background-color: rgb(235, 0, 0); background-color: rgb(235, 0, 0);
} }
.btn-cadastro {
color: white;
background-color: rgb(172, 79, 235);
text-align: center;
border-radius: 3px;
width: 100%;
font-weight: 700;
margin-bottom: 0px;
}
.btn-cadastro:hover {
color: black;
}
\ No newline at end of file
...@@ -28,6 +28,17 @@ ...@@ -28,6 +28,17 @@
</div> </div>
</div> </div>
<hr> <hr>
@if(session('mensagem'))
<div class="row">
<div class="col-md-12" style="margin-top: 30px;">
<div class="alert alert-success">
<p>{{session('mensagem')}}</p>
</div>
</div>
</div>
@endif
<div class="row">
<div class="col-md-12">
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
...@@ -110,6 +121,8 @@ ...@@ -110,6 +121,8 @@
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div>
</div>
</div> </div>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="container"> <div class="container">
<div class="row justify-content-center titulo-menu"> <div class="row justify-content-center titulo-menu">
<h4>Página Principal - Administrador</h4> <h4>Perfil de Administrador</h4>
</div> </div>
<div class="row justify-content-center d-flex align-items-center"> <div class="row justify-content-center d-flex align-items-center">
......
...@@ -99,14 +99,16 @@ ...@@ -99,14 +99,16 @@
@guest @guest
<a href="{{ route('coord.home') }}" class="btn navbar-text negrito" style="color: rgb(0, 140, 255);">Editais</a> <a href="{{ route('coord.home') }}" class="btn navbar-text negrito" style="color: rgb(0, 140, 255);">Editais</a>
<a href="#" class="btn dropdown-toggle negrito" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="color: rgb(0, 140, 255);">Login</a> <a href="#" class="btn dropdown-toggle negrito" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="color: rgb(0, 140, 255);">Login</a>
<div class="dropdown-menu dropdown-menu-right negrito" aria-labelledby="dropdownMenuLink" style="right: 15%; width: 300px; height: 380px;"> <div id="dropdown-login" class="dropdown-menu dropdown-menu-right negrito" aria-labelledby="dropdownMenuLink" style="right: 15%; width: 300px; height: auto;">
<div class="">
<form method="POST" action="{{ route('login') }}"> <form method="POST" action="{{ route('login') }}">
@csrf @csrf
<div style="padding: 20px;"> <div style="padding: 20px;">
<div style="color: rgb(0, 140, 255); position: relative; top: 5px; text-align: center; font-size: 20px;"> <div style="color: rgb(0, 140, 255); margin: 5px; text-align: center; font-size: 20px;">
Entrar Entrar
</div> </div>
<div style="position: relative; top: 30px; left: 1px;"> <div style="margin-top: 30px;">
<label for="email" class="col-form-label negrito" style="color: rgb(0, 140, 255);">{{ __('Endereço de E-mail') }}</label> <label for="email" class="col-form-label negrito" style="color: rgb(0, 140, 255);">{{ __('Endereço de E-mail') }}</label>
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
...@@ -126,7 +128,7 @@ ...@@ -126,7 +128,7 @@
</span> </span>
@enderror @enderror
</div> </div>
<div style="position: relative; top: 40px;"> <div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}> <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
...@@ -135,19 +137,34 @@ ...@@ -135,19 +137,34 @@
</label> </label>
</div> </div>
</div> </div>
<div style="position: relative; top: 50px;"> <div style="margin-top: 10px; margin-bottom: 10px;">
<button class="btn botao-entrar" style="color: white;"> <button class="btn btn-login">
{{__('Entrar')}} {{__('Entrar')}}
</button> </button>
<br>
<a href="{{ route('password.request') }}" style="font-weight: normal; color: rgb(44, 96, 209);">{{ __('Esqueceu sua senha?')}}</a> <a href="{{ route('password.request') }}" style="font-weight: normal; color: rgb(44, 96, 209);">{{ __('Esqueceu sua senha?')}}</a>
</div> </div>
<div style="margin-top: 10px; margin-bottom: 10px;">
<label for="password" class="col-form-label negrito" style="color: rgb(0, 140, 255);">{{ __('Crie sua conta!') }}</label>
<br>
<a href="{{ route('register') }}">
<button type="button" class="btn btn-cadastro">
{{__('Cadastre-se')}}
</button>
</a>
</div>
</div> </div>
</form> </form>
</div> </div>
</div>
<a href="{{ route('register') }}" class="btn navbar-text btn-azul-destaque negrito" style="color: rgb(0, 140, 255);">{{ __('Cadastre-se') }}</a> <a href="{{ route('register') }}" class="btn navbar-text btn-azul-destaque negrito" style="color: rgb(0, 140, 255);">{{ __('Cadastre-se') }}</a>
@else
@if(Auth::user()->administradors != null)
<a href="{{route('admin.editais')}}" class="btn navbar-text negrito " style="color: rgb(0, 140, 255);">Home</a>
@else @else
<a href="{{route('coord.home')}}" class="btn navbar-text negrito " style="color: rgb(0, 140, 255);">Home</a> <a href="{{route('coord.home')}}" class="btn navbar-text negrito " style="color: rgb(0, 140, 255);">Home</a>
@endif
<a id="navbarDropdown" class="btn navbar-text negrito dropdown-toggle" style="color: rgb(0, 140, 255);" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre> <a id="navbarDropdown" class="btn navbar-text negrito dropdown-toggle" style="color: rgb(0, 140, 255);" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }} <span class="caret"></span> {{ Auth::user()->name }} <span class="caret"></span>
</a> </a>
...@@ -310,4 +327,16 @@ ...@@ -310,4 +327,16 @@
</div> </div>
</div> </div>
</body> </body>
<script>
$(document).ready(function() {
$("#dropdown-login").on('click', function(event){
event.stopPropagation();
});
});
@if(old('email') != null)
$(document).ready(function() {
$('#dropdownMenuLink').click();
});
@endif
</script>
</html> </html>
\ No newline at end of file
...@@ -65,14 +65,14 @@ ...@@ -65,14 +65,14 @@
</a> </a>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;"> <a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;">
Editar projeto Editar
</a> </a>
<a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center">
Visualizar projeto Visualizar projeto
</a> </a>
<!-- Button trigger modal --> <!-- Button trigger modal -->
<button type="button" class="dropdown-item" data-toggle="modal" data-target="#modal{{$projeto->id}}" style="text-align: center"> <button type="button" class="dropdown-item" data-toggle="modal" data-target="#modal{{$projeto->id}}" style="text-align: center">
Excluir projeto <img src="{{asset('img/icons/logo_lixeira.png')}}" alt=""> Deletar
</button> </button>
</div> </div>
</div> </div>
......
...@@ -6,10 +6,30 @@ ...@@ -6,10 +6,30 @@
<div class="container" > <div class="container" >
<div class="row" > <div class="row" >
<div class="col-sm-12"> <div class="col-sm-1" style="text-align: left; flaot:left;">
<h3>Editais</h3> <a href="{{ route('proponente.index') }}" class="btn btn-secondary" style="position:relative; float: right;">Voltar</a>
</div>
<div class="col-sm-7" style="text-align: center;">
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-8">
<h4 class="titulo-table">Editais</h4>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="row">
<div class="col-sm-2">
<button class="btn" onclick="buscarEdital(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 edital" onkeyup="buscarEdital(this)">
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<hr> <hr>
...@@ -24,7 +44,7 @@ ...@@ -24,7 +44,7 @@
<th scope="col">Opção</th> <th scope="col">Opção</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody id="eventos">
@foreach ($eventos as $evento) @foreach ($eventos as $evento)
<tr> <tr>
<td> <td>
...@@ -50,6 +70,7 @@ ...@@ -50,6 +70,7 @@
Projetos submetidos Projetos submetidos
</a> </a>
@if($evento->inicioSubmissao <= $hoje && $hoje <= $evento->fimSubmissao) @if($evento->inicioSubmissao <= $hoje && $hoje <= $evento->fimSubmissao)
<hr class="dropdown-hr">
<a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="dropdown-item" style="text-align: center">
Criar projeto Criar projeto
</a> </a>
...@@ -80,6 +101,22 @@ ...@@ -80,6 +101,22 @@
@section('javascript') @section('javascript')
<script> <script>
function buscarEdital(input) {
var editais = document.getElementById('eventos').children;
if(input.value.length > 2) {
for(var i = 0; i < editais.length; i++) {
var nomeEvento = editais[i].children[0].children[0].textContent;
if(nomeEvento.substr(0).indexOf(input.value) >= 0) {
editais[i].style.display = "";
} else {
editais[i].style.display = "none";
}
}
} else {
for(var i = 0; i < editais.length; i++) {
editais[i].style.display = "";
}
}
}
</script> </script>
@endsection @endsection
...@@ -13,8 +13,29 @@ ...@@ -13,8 +13,29 @@
@endif @endif
<div class="container" > <div class="container" >
<div class="row" > <div class="row" >
<div class="col-sm-12"> <div class="col-sm-1">
<h3>Meus Projetos</h3> <a href="{{ route('proponente.index') }}" class="btn btn-secondary" style="position:relative; float: right;">Voltar</a>
</div>
<div class="col-sm-7" style="text-align: center">
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-8">
<h4 class="titulo-table">Meus Projetos</h4>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="row">
<div class="col-sm-2">
<button class="btn" onclick="buscarEdital(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 edital" onkeyup="buscarEdital(this)">
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -51,12 +72,13 @@ ...@@ -51,12 +72,13 @@
<div class="dropdown-menu"> <div class="dropdown-menu">
@if($projeto->evento->inicioSubmissao <= $hoje && $hoje <= $projeto->evento->fimSubmissao) @if($projeto->evento->inicioSubmissao <= $hoje && $hoje <= $projeto->evento->fimSubmissao)
<a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;"> <a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;">
Editar projeto Editar
</a> </a>
<hr class="dropdown-hr">
@else @else
@endif @endif
<a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center">
Visualizar projeto Visualizar
</a> </a>
{{-- <a href="" class="dropdown-item" style="text-align: center"> {{-- <a href="" class="dropdown-item" style="text-align: center">
Recorrer Recorrer
...@@ -65,9 +87,10 @@ ...@@ -65,9 +87,10 @@
Resultado Resultado
</a> --}} </a> --}}
@if($projeto->status == 'Submetido') @if($projeto->status == 'Submetido')
<hr class="dropdown-hr">
<!-- Button trigger modal --> <!-- Button trigger modal -->
<button type="button" class="dropdown-item" style="text-align: center" data-toggle="modal" data-target="#modal{{$projeto->id}}"> <button type="button" class="dropdown-item dropdown-item-delete" style="text-align: center" data-toggle="modal" data-target="#modal{{$projeto->id}}">
Excluir projeto <img src="{{asset('img/icons/logo_lixeira.png')}}" alt=""> Deletar
</button> </button>
@endif @endif
......
...@@ -21,17 +21,15 @@ ...@@ -21,17 +21,15 @@
@endif @endif
<div class="container" > <div class="container" >
<div class="row" > <div class="row" >
<div class="col-sm-9">
<h3>Projetos do edital {{ $edital->nome }}</h3>
<h6 style="color: rgb(4, 78, 4);">Submissão irá até o dia {{ date('d-m-Y', strtotime($edital->fimSubmissao)) }}</h6>
</div>
<div class="col-sm-1"> <div class="col-sm-1">
<a href="{{ route('proponente.editais') }}" class="btn btn-primary" style="position:relative; float: right;">Voltar</a> <a href="{{ route('proponente.editais') }}" class="btn btn-secondary" style="position:relative; float: right;">Voltar</a>
</div>
<div class="col-sm-9" style="text-align: center">
<h4 class="titulo-table">Projetos do edital {{ $edital->nome }}</h4>
<h6 class="titulo-table">Submissão irá até o dia <span style="color: rgb(0, 0, 0);">{{ date('d/m/Y', strtotime($edital->fimSubmissao)) }}</span></h6>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<a @if($edital->inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao) href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-info" @else href="#" data-toggle="tooltip" data-placement="top" title="O periodo de submissão foi encerrado." @endif style="position:relative; float: right;">Criar projeto</a> <a @if($edital->inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao) href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-info" @else href="#" data-toggle="tooltip" data-placement="top" title="O periodo de submissão foi encerrado." @endif style="position:relative; float: right;">Criar projeto</a>
</div> </div>
</div> </div>
</div> </div>
...@@ -45,7 +43,7 @@ ...@@ -45,7 +43,7 @@
<th scope="col">Opção</th> <th scope="col">Opção</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody id="projetos">
@foreach ($projetos as $projeto) @foreach ($projetos as $projeto)
@if ($projeto->proponente_id === Auth()->user()->proponentes->id) @if ($projeto->proponente_id === Auth()->user()->proponentes->id)
<tr> <tr>
...@@ -68,13 +66,15 @@ ...@@ -68,13 +66,15 @@
<div class="dropdown-menu"> <div class="dropdown-menu">
@if($edital->inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao) @if($edital->inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao)
<a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;"> <a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;">
Editar projeto Editar
</a> </a>
<hr class="dropdown-hr">
@else @else
@endif @endif
<a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center">
Visualizar projeto Visualizar
</a> </a>
<hr class="dropdown-hr">
{{-- <a href="" class="dropdown-item" style="text-align: center"> {{-- <a href="" class="dropdown-item" style="text-align: center">
Recorrer Recorrer
</a> </a>
...@@ -82,8 +82,8 @@ ...@@ -82,8 +82,8 @@
Resultado Resultado
</a> --}} </a> --}}
<!-- Button trigger modal --> <!-- Button trigger modal -->
<button type="button" class="dropdown-item" data-toggle="modal" data-target="#modal{{$projeto->id}}" style="text-align: center"> <button type="button" class="dropdown-item dropdown-item-delete" data-toggle="modal" data-target="#modal{{$projeto->id}}" style="text-align: center">
Excluir projeto <img src="{{asset('img/icons/logo_lixeira.png')}}" alt=""> Deletar
</button> </button>
</div> </div>
</div> </div>
...@@ -120,7 +120,22 @@ ...@@ -120,7 +120,22 @@
@section('javascript') @section('javascript')
<script> <script>
function buscarEdital(input) {
var editais = document.getElementById('projetos').children;
if(input.value.length > 2) {
for(var i = 0; i < editais.length; i++) {
var nomeEvento = editais[i].children[0].textContent;
if(nomeEvento.substr(0).indexOf(input.value) >= 0) {
editais[i].style.display = "";
} else {
editais[i].style.display = "none";
}
}
} else {
for(var i = 0; i < editais.length; i++) {
editais[i].style.display = "";
}
}
}
</script> </script>
@endsection @endsection
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment