mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 19:46:16 +00:00
Add ownership checks to groups
Fix contrast checking Add coloured highlights to images Update top-of-page button icon
This commit is contained in:
parent
feadaba8a1
commit
e192554a0b
8 changed files with 81 additions and 38 deletions
|
@ -14,20 +14,25 @@
|
|||
class="banner-filter"
|
||||
style="background: linear-gradient(to right, rgb({{ images.0.image_colours.0.0 }}, {{ images.0.image_colours.0.1 }}, {{ images.0.image_colours.0.2 }}), transparent)"
|
||||
></span>
|
||||
<div class="banner-content">
|
||||
<p><span id="contrast-check" data-color="rgb({{ images.0.image_colours.0.0 }}, {{ images.0.image_colours.0.1 }}, {{ images.0.image_colours.0.2 }})">{{ group.description }}</span></p>
|
||||
<h1><span id="contrast-check" data-color="rgb({{ images.0.image_colours.0.0 }}, {{ images.0.image_colours.0.1 }}, {{ images.0.image_colours.0.2 }})">{{ group.name }}</span></h1>
|
||||
<p><span id="contrast-check" data-color="rgb({{ images.0.image_colours.0.0 }}, {{ images.0.image_colours.0.1 }}, {{ images.0.image_colours.0.2 }})">{{ images|length }} Images</span></p>
|
||||
</div>
|
||||
{% else %}
|
||||
<img src="{{ url_for('static', filename='images/bg.svg') }}" onload="imgFade(this)" style="opacity:0;"/>
|
||||
<span></span>
|
||||
<div class="banner-content">
|
||||
<p>{{ group.description }}</p>
|
||||
<h1>{{ group.name }}</h1>
|
||||
<p>{{ images|length }} Images</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="banner-content">
|
||||
<p>{{ group.description }}</p>
|
||||
<h1>{{ group.name }}</h1>
|
||||
<p>{{ images|length }} Images</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="/api/group/modify" method="post" enctype="multipart/form-data">
|
||||
<input type="text" name="group_id" placeholder="group id" value="{{ group.id }}">
|
||||
<input type="text" name="images" placeholder="image id">
|
||||
<form id="modifyGroup">
|
||||
<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">
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
@ -36,9 +41,9 @@
|
|||
<div class="gallery-grid">
|
||||
{% for image in images %}
|
||||
<a id="image-{{ image.id }}" class="gallery-item" href="{{ url_for('group.group_post', group_id=group.id, image_id=image.id) }}" style="background-color: rgb({{ image.image_colours.0.0 }}, {{ image.image_colours.0.1 }}, {{ image.image_colours.0.2 }})">
|
||||
<span>
|
||||
<span class="image-filter" style="background: linear-gradient(to top, rgb({{ image.image_colours.0.0 }}, {{ image.image_colours.0.1 }}, {{ image.image_colours.0.2 }}), transparent)">
|
||||
<p></p>
|
||||
<h2><span class="time">{{ image.created_at }}</span></h2>
|
||||
<h2><span id="contrast-check" data-color="rgb({{ image.image_colours.0.0 }}, {{ image.image_colours.0.1 }}, {{ image.image_colours.0.2 }})"><span class="time">{{ image.created_at }}</span></span></h2>
|
||||
</span>
|
||||
<img data-src="{{ image.file_name }}" onload="imgFade(this)" style="opacity:0;" id="lazy-load"/>
|
||||
</a>
|
||||
|
@ -57,5 +62,30 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script></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 %}
|
|
@ -24,7 +24,8 @@
|
|||
<div class="gallery-grid">
|
||||
{% for group in groups %}
|
||||
<a id="group-{{ group.id }}" class="gallery-item" href="{{ url_for('group.group', group_id=group.id) }}">
|
||||
<span>
|
||||
<span class="image-filter">
|
||||
<p></p>
|
||||
<h2>{{ group.name }}</h2>
|
||||
</span>
|
||||
{% if group.thumbnail %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue