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

61 lines
3.1 KiB
PHP
Raw Permalink 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">
2021-08-11 15:32:08 -04:00
<strong>Do not post memes created by others or you will be banned.</strong>
</div>
2021-08-11 16:52:20 -04:00
<div class="alert alert-primary text-center" role="alert">
<strong>Old memes are no longer allowed due to people cheating.</strong>
</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