mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2024-12-28 18:36:21 +00:00
Gwa Gwa
This commit is contained in:
parent
d33585afca
commit
e2bf5ed4e2
|
@ -53,7 +53,7 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
|
||||
<form id="modifyGroup">
|
||||
<form id="modifyGroup" action="/api/group/modify" method="post">
|
||||
<input type="text" name="group" placeholder="group id" value="{{ group.id }}">
|
||||
<input type="text" name="image" placeholder="image id">
|
||||
<input type="text" name="action" placeholder="add/remove" value="add">
|
||||
|
@ -83,32 +83,3 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
// /api/group/modify
|
||||
|
||||
modForm = document.querySelector('#modifyGroup');
|
||||
|
||||
modForm.addEventListener('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
const formData = new FormData();
|
||||
|
||||
formData.append('group', modForm.group.value);
|
||||
formData.append('image', modForm.image.value);
|
||||
formData.append('action', modForm.action.value);
|
||||
|
||||
$.ajax({
|
||||
url: '/api/group/modify',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (data) {
|
||||
addNotification('Image added to group', 1);
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -28,6 +28,10 @@
|
|||
{% assets "js_pre" %}
|
||||
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
|
||||
{% assets "js_post" %}
|
||||
<script type="text/javascript" src="{{ ASSET_URL }}" defer></script>
|
||||
{% endassets %}
|
||||
|
||||
{% assets "styles" %}
|
||||
<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css" defer>
|
||||
|
@ -150,11 +154,7 @@
|
|||
{% for message in get_flashed_messages() %}
|
||||
addNotification('{{ message[0] }}', {{ message[1] }});
|
||||
{% endfor %}
|
||||
</>
|
||||
|
||||
{% assets "js_post" %}
|
||||
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
</script>
|
||||
|
||||
{% block script %}{% endblock %}
|
||||
</body>
|
||||
|
|
Loading…
Reference in a new issue