adjust header to work with trash empty button
This commit is contained in:
@@ -13,14 +13,25 @@
|
|||||||
</div>
|
</div>
|
||||||
{% if button_text and button_url %}
|
{% if button_text and button_url %}
|
||||||
<div>
|
<div>
|
||||||
<button onclick="window.location.href='{{ button_url }}'"
|
{% if button_url == "#" %}
|
||||||
class="btn {{ button_class if button_class else '' }}"
|
<button id="emptyTrashBtn"
|
||||||
style="{{ 'background-color: #16767b; color: white;' if not button_class else '' }}{{ '; ' + button_style if button_style else '' }}">
|
class="btn {{ button_class if button_class else '' }}"
|
||||||
{% if button_icon %}
|
style="{{ 'background-color: #16767b; color: white;' if not button_class else '' }}{{ '; ' + button_style if button_style else '' }}">
|
||||||
<i class="fas {{ button_icon }} me-1"></i>
|
{% if button_icon %}
|
||||||
{% endif %}
|
<i class="fas {{ button_icon }} me-1"></i>
|
||||||
{{ button_text }}
|
{% endif %}
|
||||||
</button>
|
{{ button_text }}
|
||||||
|
</button>
|
||||||
|
{% else %}
|
||||||
|
<button onclick="window.location.href='{{ button_url }}'"
|
||||||
|
class="btn {{ button_class if button_class else '' }}"
|
||||||
|
style="{{ 'background-color: #16767b; color: white;' if not button_class else '' }}{{ '; ' + button_style if button_style else '' }}">
|
||||||
|
{% if button_icon %}
|
||||||
|
<i class="fas {{ button_icon }} me-1"></i>
|
||||||
|
{% endif %}
|
||||||
|
{{ button_text }}
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
<form method="POST" enctype="multipart/form-data" class="bg-white rounded-lg shadow overflow-hidden">
|
<form method="POST" enctype="multipart/form-data" class="bg-white rounded-lg shadow overflow-hidden">
|
||||||
<!-- Profile Picture Section -->
|
<!-- Profile Picture Section -->
|
||||||
<div class="p-4 border-b border-gray-200">
|
<div class="p-4 border-b border-gray-200">
|
||||||
<h2 class="text-lg font-medium text-gray-900 mb-3">Profile Picture</h2>
|
|
||||||
<div class="flex flex-col items-center">
|
<div class="flex flex-col items-center">
|
||||||
<div class="relative group flex flex-col items-center">
|
<div class="relative group flex flex-col items-center">
|
||||||
<label for="profile_picture" class="cursor-pointer">
|
<label for="profile_picture" class="cursor-pointer">
|
||||||
|
|||||||
@@ -32,10 +32,21 @@
|
|||||||
{% block extra_js %}
|
{% block extra_js %}
|
||||||
<script src="{{ url_for('static', filename='js/file-grid.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/file-grid.js') }}"></script>
|
||||||
<script>
|
<script>
|
||||||
// Update the empty trash button click handler
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
document.querySelector('a[href="#"]').addEventListener('click', function(e) {
|
// Add event listener for the empty trash button
|
||||||
e.preventDefault();
|
const emptyTrashBtn = document.getElementById('emptyTrashBtn');
|
||||||
showEmptyTrashModal();
|
if (emptyTrashBtn) {
|
||||||
|
emptyTrashBtn.addEventListener('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
showEmptyTrashModal();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add event listener for the confirm empty trash button
|
||||||
|
const confirmEmptyTrashBtn = document.getElementById('confirmEmptyTrash');
|
||||||
|
if (confirmEmptyTrashBtn) {
|
||||||
|
confirmEmptyTrashBtn.addEventListener('click', emptyTrash);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user