deleting documents, bug fixes
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
},
|
||||
{{/each}}
|
||||
];
|
||||
const isAdmin = {{IsAdmin}};
|
||||
const isFull = true;
|
||||
</script>
|
||||
<script src="../../scripts/projects.js"></script>
|
||||
<script src="../../scripts/documents-table.js"></script>
|
||||
@@ -231,6 +233,17 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{#if IsAdmin}}
|
||||
<div id="deletedocument-form-popup-bg" class="form-popup-bg not-main" >
|
||||
<div class="form-container">
|
||||
<img src="../../img/xmark.svg" id="btnCloseDeleteForm" class="close-button">
|
||||
<h1>Вы уверены что хотите удалить документ <span style="display: inline; font-weight: bold;" id="deleteDocName"></span>?</h1>
|
||||
|
||||
<button type="button" class="form-button" onclick="confirmDelete();" id="deleteConfirm">Удалить документ</button>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
@@ -411,6 +424,45 @@
|
||||
});
|
||||
});
|
||||
|
||||
{{#if IsAdmin}}
|
||||
|
||||
function deleteDoc(id) {
|
||||
$("#deleteDocName").text($(`#doc-name-${id}`).text())
|
||||
$('#deletedocument-form-popup-bg').addClass('is-visible');
|
||||
$('#deleteConfirm').attr('onclick', `confirmDelete(${id})`);
|
||||
}
|
||||
|
||||
$(document).ready(function($) {
|
||||
|
||||
$('#deletedocument-form-popup-bg').on('click', function(event) {
|
||||
if ($(event.target).is('#deletedocument-form-popup-bg') || $(event.target).is('#btnCloseDeleteForm')) {
|
||||
event.preventDefault();
|
||||
$(this).removeClass('is-visible');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function confirmDelete(id) {
|
||||
$.ajax({
|
||||
url: API_SERVER + "/document?id=" + id,
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
Authorization: getCookie("token"),
|
||||
},
|
||||
success: function(response) {
|
||||
location.reload();
|
||||
},
|
||||
error: function() {
|
||||
alert("Произошла ошибка при запросе к серверу.");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/js-circle-progress/dist/circle-progress.min.js" type="module"></script>
|
||||
<script>
|
||||
const API_SERVER = "{{API_SERVER}}";
|
||||
const isAdmin = {{IsAdmin}};
|
||||
const isFull = false;
|
||||
</script>
|
||||
<script type="module">
|
||||
import { minidenticonSvg } from 'https://cdn.jsdelivr.net/npm/minidenticons@4.2.0/minidenticons.min.js'
|
||||
@@ -304,7 +306,7 @@
|
||||
</div>
|
||||
<div class="header-name">
|
||||
<h1>Оплата проекта</h1>
|
||||
<h2>последние 3 транзакции</h2>
|
||||
<h2>последние 2 транзакции</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -458,7 +458,6 @@
|
||||
location.reload();
|
||||
},
|
||||
error: function() {
|
||||
// Обработка ошибки при запросе к серверу
|
||||
alert("Произошла ошибка при запросе к серверу.");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
<div class="setting-top">
|
||||
<h1>Пароль</h1>
|
||||
<h2>Если хотите изменить пароль, укажите новый ниже</h2>
|
||||
<input oninput="handlePasswordChange(this)" id="password-input" type="password" required>
|
||||
<input oninput="handlePasswordChange(this)" id="password-input" type="password" autocomplete="new-password" required>
|
||||
</div>
|
||||
<div class="setting-bottom">
|
||||
<h2>Используйте минимум 5 символов.</h2>
|
||||
|
||||
Reference in New Issue
Block a user