ldc-supportweb/resources/views/ticket/create.blade.php
2020-11-18 10:23:51 +01:00

65 lines
3.3 KiB
PHP

@extends('layout.app')
@section('tickets', 'active')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Créer un ticket<a href="{{ route('home') }}" class="float-right btn btn-sm btn-primary">Retour</a></div>
<div class="card-body">
<form method="POST" action="{{ route('store-ticket') }}" enctype="multipart/form-data">
@method('PUT')
@csrf
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{!! $error !!}</li>
@endforeach
</ul>
</div>
@endif
<div class="form-row">
<div class="form-group col-md-6">
<label for="project" class="col-form-label">Projet</label>
<select class="custom-select" name="project_id" id="project" @if (Auth::user()->role !== 1) disabled @endif>
@foreach($projects as $project)
@if (Auth::user()->role === 1)
<option value="{{ $project->id }}" @if (old('project_id') == $project->id)selected @endif>{{ $project->name }}</option>
@elseif ($project->id === Auth::user()->project_id)
<option value="{{ $project->id }}" selected>{{ $project->name }}</option>
@endif
@endforeach
</select>
</div>
<div class="form-group col-md-6">
<label for="type" class="col-form-label">Type</label>
<select class="custom-select" name="type" id="type">
<option value="0" @if (old('type') == 0)selected @endif>Bug</option>
<option value="1" @if (old('type') == 1)selected @endif>Évolution</option>
</select>
</div>
</div>
<div class="form-group">
<label for="text" class="col-form-label text-md-right">Description</label>
<textarea class="form-control" name="text" id="text" placeholder="Description du ticket *">{{ old('text') }}</textarea>
</div>
<div class="form-group">
<input type="file" name="file_ticket" accept="image/png, image/jpeg, image/jpg, .pdf">
</div>
<div class="form-group text-center">
<input type="submit" class="btn btn-primary" value="Enregistrer">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection