xmrmemes/resources/views/meme-create.blade.php
2021-08-11 13:52:20 -07:00

61 lines
3.1 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Submit Meme') }}</div>
@if ($errors->any())
<div class="alert alert-danger mt-3 mb-0">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="card-body">
<div class="alert alert-primary text-center" role="alert">
<strong>Do not post memes created by others or you will be banned.</strong>
</div>
<div class="alert alert-primary text-center" role="alert">
<strong>Old memes are no longer allowed due to people cheating.</strong>
</div>
<form method="POST" action="{{ route('meme-create') }}" enctype="multipart/form-data">
@csrf
<div class="form-row">
<div class="form-group w-100">
<label>Meme Title</label>
<input type="text" name="title" class="form-control" required>
</div>
<div class="form-group w-100">
<label>Meme Caption (Optional)</label>
<input type="text" name="caption" class="form-control">
</div>
<div class="form-group w-100">
<label>Upload (JPEG, JPG, PNG, GIF)</label>
<div class="input-group mb-3">
<div class="custom-file">
<input type="file" name="image" class="custom-file-input" id="inputGroupFile02">
<label class="custom-file-label" for="inputGroupFile02" aria-describedby="inputGroupFileAddon02">Choose file</label>
</div>
</div>
<script type="text/javascript">
document.querySelector('.custom-file-input').addEventListener('change',function(e){
var fileName = document.getElementById("inputGroupFile02").files[0].name;
var nextSibling = e.target.nextElementSibling
nextSibling.innerText = fileName
})
</script>
</div>
</div>
<button type="submit" class="btn btn-primary btn-lg w-100">Submit Meme</button>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection