forked from rDrama/rDrama
122 lines
6.4 KiB
HTML
122 lines
6.4 KiB
HTML
{% extends "submit_navbar.html" %}
|
|
{% block pagetitle %}Submit Emojis{% endblock %}
|
|
{% block pagetype %}message{% endblock %}
|
|
{% block content %}
|
|
<h2 class="mt-3 mt-md-5">Submit Emoji</h2>
|
|
<div class="settings-section rounded">
|
|
<div class="d-lg-flex">
|
|
<div class="body w-lg-100">
|
|
<form action="/submit/emojis" 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">
|
|
|
|
<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">
|
|
<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>
|
|
|
|
<label class="mt-3" for="kind">Kind</label>
|
|
<div class="input-group">
|
|
<select autocomplete="off" id='kind' class="form-control" name="kind" required>
|
|
{% if not kind %}
|
|
<option hidden disabled selected value>-- select an option --</option>
|
|
{% endif %}
|
|
{% for entry in EMOJI_KINDS %}
|
|
<option value="{{entry}}" {% if entry == kind %}selected{% endif %}>
|
|
{{entry}}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<label class="mt-3" for="name">Emoji Name</label>
|
|
<input autocomplete="off" type="text" id="name" class="form-control" name="name" maxlength="30" pattern='[a-zA-Z0-9]{1,30}' placeholder="Required" value="{{name}}" required>
|
|
|
|
<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>
|
|
|
|
<label class="mt-3" for="tags">Tags (must be separated by spaces)</label>
|
|
<input autocomplete="off" type="text" id="tags" class="form-control" name="tags" maxlength="200" pattern='[a-zA-Z0-9: ]{1,200}' placeholder="Required" value="{{tags}}" required>
|
|
|
|
{% if FEATURES['NSFW_MARKING'] %}
|
|
<div class="custom-control custom-checkbox mt-4 pt-1 ml-1">
|
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="emoji-nsfw" name="nsfw">
|
|
<label class="custom-control-label" for="emoji-nsfw">NSFW</label>
|
|
</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 Emoji">
|
|
</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 emoji in emojis %}
|
|
<div id="{{emoji.name}}-emoji" 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/emojis/{{emoji.name}}.webp?s={{range(1, 10000000)|random}}" style="max-width:50%;border:5px white solid">
|
|
|
|
<div><label class="mt-3" for="{{emoji.name}}-kind">Kind</label></div>
|
|
<div class="input-group">
|
|
<select autocomplete="off" id='{{emoji.name}}-kind' class="form-control" required {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}disabled readonly{% endif %}>
|
|
{% for entry in EMOJI_KINDS %}
|
|
<option value="{{entry}}" {% if emoji.kind == entry %}selected{% endif %}>
|
|
{{entry}}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div><label class="mt-3" for="{{emoji.name}}-submitter">Submitter</label></div>
|
|
<input autocomplete="off" type="text" id="{{emoji.name}}-submitter" class="form-control" maxlength="30" value="{{emoji.submitter}}" readonly>
|
|
|
|
<label class="mt-3" for="{{emoji.name}}-author">Author</label>
|
|
<input autocomplete="off" type="text" id="{{emoji.name}}-author" class="form-control" maxlength="30" value="{{emoji.author}}" pattern='[a-zA-Z0-9_\- ]{1,30}|\?{3}' placeholder="Required" required {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %}>
|
|
|
|
<label class="mt-3" for="{{emoji.name}}-name">Emoji Name</label>
|
|
<input autocomplete="off" type="text" id="{{emoji.name}}-name" class="form-control" maxlength="30" value="{{emoji.name}}" pattern='emoji[a-z0-9]{1,24}' placeholder="Required" required {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %}>
|
|
|
|
<label class="mt-3" for="{{emoji.name}}-tags">Tags</label>
|
|
<input autocomplete="off" type="text" id="{{emoji.name}}-tags" class="form-control" maxlength="200" value="{{emoji.tags}}" pattern='[a-z0-9: ]{1,200}' placeholder="Required" required {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %}>
|
|
|
|
<div class="custom-control custom-checkbox mt-4 pt-1 ml-1">
|
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="{{emoji.name}}-nsfw" {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %} {% if emoji.nsfw %}checked{% endif %}>
|
|
<label class="custom-control-label" for="{{emoji.name}}-nsfw">NSFW</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == emoji.submitter_id %}
|
|
<div class="d-flex my-4 mx-3">
|
|
<input autocomplete="off" type="text" id="{{emoji.name}}-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_emoji(this, '{{emoji.name}}')">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_emoji(this, '{{emoji.name}}')">Approve</button>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script defer src="{{'js/submit_emojis.js' | asset}}"></script>
|
|
{% endblock %}
|