Major changes - Vote system now finished

This commit is contained in:
2020-05-30 00:20:39 +01:00
parent cc8c293cc6
commit d15c0cb12f
32 changed files with 1791 additions and 17 deletions

View File

@@ -0,0 +1,75 @@
@extends('adminlte::page')
@section('title', 'Raspberry Network | Developer Options')
@section('content_header')
<h4>Administration / Developer Tools</h4>
@stop
@section('js')
<x-global-errors></x-global-errors>
@stop
@section('content')
<x-modal id="confirmForceEventDispatch" modal-label="confirmForceEventDispatch" modal-title="Choose an application" include-close-button="true">
<p>Please choose an application to force re-evaluation</p>
<form method="POST" id="forceEval" action="{{route('devToolsForceVoteCount')}}">
@csrf
<select name="application" class="custom-select">
@if(!$applications->isEmpty())
@foreach($applications as $application)
<option value="{{$application->id}}">Application ID {{$application->id}} ({{$application->user->name}})</option>
@endforeach
@else
<option value="null" disabled>There are no valid applications</option>
@endif
</select>
</form>
<x-slot name="modalFooter">
<button type="button" class="btn btn-danger" onclick="document.getElementById('forceEval').submit()">Dispatch event now</button>
</x-slot>
</x-modal>
<div class="row">
<div class="col">
<div class="alert alert-warning">
<i class="fa fa-exclamation-triangle"></i> <b>Warning: Do not use these options if you don't know what you're doing, even if you have access to this page.</b>
</div>
</div>
</div>
<div class="row">
<div class="col">
<x-card id="tools" card-title="Event Management" footer-style="text-center">
<x-slot name="cardHeader">
</x-slot>
<button type="button" class="btn btn-danger" onclick="$('#confirmForceEventDispatch').modal('show')">Force Vote Evaluation</button>
<x-slot name="cardFooter">
</x-slot>
</x-card>
</div>
</div>
@stop

View File

@@ -67,8 +67,6 @@
<td><span class="badge badge-warning">{{($application->applicationStatus == 'STAGE_PEERAPPROVAL') ? 'Peer Review' : 'Unknown'}}</span></td>
<td>
<button type="button" class="btn btn-info btn-sm" onclick="window.location.href='{{route('showUserApp', ['id' => $application->id])}}'"><i class="far fa-clipboard"></i> Review</button>
<button type="button" class="btn btn-success btn-sm"><i class="fas fa-user-check"></i> Vote: Approve</button>
<button type="button" class="btn btn-danger btn-sm"><i class="fas fa-user-times"></i> Vote: Deny</button>
</td>
@endforeach

View File

@@ -22,10 +22,30 @@
<script type="text/javascript" src="/js/app.js"></script>
<x-global-errors></x-global-errors>
@if (!$canVote)
<script>
toastr.info('You cannot vote on this application anymore.', 'Warning')
</script>
@endif
@stop
@section('content')
<x-modal id="notes" modal-label="notes" modal-title="Shared Notepad" include-close-button="true">
<form id="meetingNotes" method="POST" action="{{route('saveNotes', ['applicationID' => $application->id])}}">
@csrf
@method('PATCH')
<textarea name="noteText" rows="5" class="form-control">{{$application->appointment->meetingNotes ?? 'There are no notes yet. Add some!'}}</textarea>
</form>
<p class="text-muted text-sm">Last updated @ {{$application->appointment->updated_at}}</p>
<x-slot name="modalFooter">
<button type="button" class="btn btn-success" onclick="document.getElementById('meetingNotes').submit()"><i class="far fa-paper-plane"></i> Save & Close</button>
</x-slot>
</x-modal>
<x-modal id="denyApplication" modal-label="denyApplicationLabel" modal-title="Please confirm" include-close-button="true">
<p>Are you sure you want to deny this application? Please keep in mind that this user will only be allowed to apply 30 days after their first application.</p>
@@ -246,7 +266,8 @@
</form>
<button class="btn btn-warning mr-3">View Meeting Notes</button>
<button class="btn btn-danger mr-3">Cancel Interview</button>
<!-- Show to users only -->
<button class="btn btn-success mr-3">Accept Meeting</button>
</x-slot>
</x-card>
@@ -270,10 +291,22 @@
<x-slot name="cardFooter">
<button type="button" class="btn btn-sm btn-warning">Vote: Approve Applicant</button>
<button type="button" class="btn btn-sm btn-warning">Vote: Deny Applicant</button>
@if($canVote)
<button type="button" class="btn btn-sm btn-warning ml-5">Meeting Notes</button>
<form class="d-inline-block" method="POST" action="{{route('voteApplication', ['id' => $application->id])}}">
@csrf
<input type="hidden" name="voteType" value="VOTE_APPROVE">
<button type="submit" class="btn btn-sm btn-warning">Vote: Approve Applicant</button>
</form>
<form class="d-inline-block" method="POST" action="{{route('voteApplication', ['id' => $application->id])}}">
@csrf
<input type="hidden" name="voteType" value="VOTE_DENY">
<button type="submit" class="btn btn-sm btn-warning">Vote: Deny Applicant</button>
</form>
@endif
<button type="button" class="btn btn-sm btn-warning {{($canVote) ? 'ml-5' : ''}}" onclick="$('#notes').modal('show')">Meeting Notes</button>
</x-slot>
</x-card>