Cleaned up some stuffs in profile and upload

This commit is contained in:
Michał Gdula 2022-10-02 10:38:29 +00:00
parent 956758fa25
commit 7f2e01a7f1
3 changed files with 55 additions and 55 deletions

2
.gitignore vendored
View file

@ -3,3 +3,5 @@ images/
# CSS map, I don't think its needed for upload... I think?
*.map
.idea/

View file

@ -34,11 +34,7 @@
echo "<img src='images/pfp/".$user['pfp_path']."'>";
$pfp_colour = $make_stuff->get_image_colour("images/pfp/".$user['pfp_path']);
if (!empty($pfp_colour)) {
$pfp_colour = $pfp_colour;
} else {
$pfp_colour = "var(--bg-3)";
}
if (empty($pfp_colour)) $pfp_colour = "var(--bg-3)";
?>
<style>
.profile-root {
@ -58,7 +54,9 @@
<h2>
<?php
echo $user['username'];
if ($user_info->is_admin($conn, $user['id'])) echo "<span style='color: var(--accent); font-size: 16px; margin-left: 0.5rem;'>Admin</span>";
if ($user_info->is_admin($conn, $user['id'])) {
echo "<span style='color: var(--accent); font-size: 16px; margin-left: 0.5rem;'>Admin</span>";
}
?>
</h2>
<div class="profile-info">

View file

@ -50,11 +50,13 @@
</div>
<script>
$("#uploadSubmit").submit(function(event) {
$('#uploadSubmit').submit(function(event) {
event.preventDefault();
// Check if image avalible
// Check if image available
var file = $("#image").val();
if (file != "") {
if (file == "") {
sniffleAdd('Gwha!', 'Pls provide image', 'var(--warning)', 'assets/icons/file-search.svg');
} else {
// Make form
var formData = new FormData();
@ -89,8 +91,6 @@
$("#alt").val("");
$("#tags").val("");
$("#submit").val("");
} else {
sniffleAdd('Gwha!', 'Pls provide image', 'var(--warning)', 'assets/icons/file-search.svg');
}
});
</script>