xmrmemes/resources/views/meme-create.blade.php

58 lines
2.9 KiB
PHP
Raw Normal View History

2021-07-16 02:35:54 -04:00
@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
2021-07-16 02:35:54 -04:00
<div class="card-body">
<div class="alert alert-primary text-center" role="alert">
You must have created this meme yourself. Do not post memes created by others.
</div>
2021-07-16 02:35:54 -04:00
<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