MarseyWorld/files/templates/submit_art.html

106 lines
5.0 KiB
HTML

{% extends "submit_navbar.html" %}
{% block pagetitle %}Submit {{kind}}{% if kind == 'Sidebar' %} Images{% else %}s{% endif %}{% endblock %}
{% block pagetype %}message{% endblock %}
{% block content %}
<h2 class="mt-3 mt-md-5">Submit {{kind}} {% if kind == 'Sidebar' %}Image{% endif %}</h2>
<div class="settings-section rounded">
<div class="d-lg-flex">
<div class="body w-lg-100">
<form action="/submit/art" method="post" enctype="multipart/form-data" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRReload(this)">
<input hidden name="formkey" value="{{v|formkey}}" class="notranslate" translate="no">
<input hidden name="kind" value="{{kind.lower()}}" class="notranslate" translate="no">
<div id="image-upload-block">
<div><label class="mt-3">Image</label></div>
<img loading="lazy" id="image-preview" class="d-none" style="max-width:50%;border:5px white solid" data-nonce="{{g.nonce}}" data-onclick="expandImage()">
<label class="btn btn-secondary m-0" for="file-upload">
<div>Select Image</div>
<input autocomplete="off" id="file-upload" accept="image/*" type="file" name="image" {% if g.is_tor %}disabled{% endif %} hidden>
</label>
</div>
{% if kind == 'Banner' %}
<div class="mt-3 text-danger font-weight-bold">
Please make sure your image is 2000x200 px and under 2 MB
</div>
{% endif %}
<label class="mt-3" for="author">Author</label>
<input autocomplete="off" type="text" id="author" class="form-control" name="author" maxlength="30" pattern='[a-zA-Z0-9_\- ]{1,30}|\?{3}' placeholder="Required" value="{{username}}" required>
{% if SITE_NAME == 'WPD' %}
<label class='mt-3' for="hole">Hole</label>
<div class="input-group">
<input list="holes" autocomplete="off" id="hole" class="form-control" name="hole" placeholder="Optional">
<datalist id="holes">
{% for h in HOLES() %}
<option value="{{h}}"></option>
{% endfor %}
</datalist>
</div>
{% endif %}
<div class="footer mt-5">
<div class="d-flex">
<input id="submit-btn" disabled type="submit" class="btn btn-primary ml-auto" value="Submit {{kind}}">
</div>
</div>
</form>
</div>
</div>
</div>
<h2 class="mt-5 mx-1">Pending Approval</h2>
<div class="mt-5">
<div class="col px-0">
<div class="settings">
{% for entry in entries %}
<div id="{{entry.id}}-art" class="settings-section rounded">
<div class="d-lg-flex">
<div class="body w-lg-100">
<input hidden value="{{v|formkey}}" class="notranslate" translate="no">
<div><label class="mt-3">Image</label></div>
<img loading="lazy" src="{{SITE_FULL_IMAGES}}/asset_submissions/art/{{entry.id}}.webp?s={{range(1, 10000000)|random}}" style="max-width:100%;max-height:50vh;border:5px white solid" data-nonce="{{g.nonce}}" data-onclick="expandImage()">
<div><label class="mt-3" for="{{entry.id}}-submitter">Submitter</label></div>
<input autocomplete="off" type="text" id="{{entry.id}}-submitter" class="form-control" maxlength="30" value="{{entry.submitter}}" readonly>
<label class="mt-3" for="{{entry.id}}-author">Author</label>
<input autocomplete="off" type="text" id="{{entry.id}}-author" class="form-control" maxlength="30" value="{{entry.author}}" pattern='[a-zA-Z0-9_\- ]{1,30}|\?{3}' placeholder="Required" required {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %}>
{% if SITE_NAME == 'WPD' %}
<label class='mt-3' for="hole">Hole</label>
<div class="input-group">
<input list="holes" autocomplete="off" id="{{entry.id}}-hole" class="form-control" placeholder="Optional" {% if entry.hole %}value="{{entry.hole}}"{% endif %} {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %}>
<datalist id="holes">
{% for h in HOLES() %}
<option value="{{h}}"></option>
{% endfor %}
</datalist>
</div>
{% else %}
<input hidden id="{{entry.id}}-hole">
{% endif %}
</div>
</div>
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == entry.submitter_id %}
<div class="d-flex my-4 mx-3">
<input autocomplete="off" type="text" id="{{entry.id}}-comment" class="form-control mr-4" placeholder="Comment..." maxlength="500" {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}hidden{% endif %}>
<button type="button" class="btn btn-danger ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_art(this, '{{entry.id}}')">Remove</button>
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
<button type="button" class="btn btn-success ml-3 mr-1" data-nonce="{{g.nonce}}" data-onclick="approve_art(this, '{{entry.id}}')">Approve</button>
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
</div>
</div>
<script defer src="{{'js/submit_art.js' | asset}}"></script>
{% endblock %}