completed

This commit is contained in:
Ske087
2025-01-25 20:03:47 +02:00
parent 014a47594e
commit fda07c701d
9 changed files with 163 additions and 42 deletions

View File

@@ -15,12 +15,33 @@
.dark-mode label, .dark-mode th, .dark-mode td {
color: #ffffff;
}
.popup-message {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.8);
color: white;
padding: 20px;
border-radius: 10px;
display: none;
z-index: 1000;
}
.logo {
max-height: 100px;
margin-right: 20px;
}
</style>
</head>
<body class="{{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="container py-5">
<h1 class="text-center mb-4">Upload Content</h1>
<form method="POST" enctype="multipart/form-data">
<div class="d-flex justify-content-start align-items-center mb-4">
{% if logo_exists %}
<img src="{{ url_for('static', filename='uploads/logo.png') }}" alt="Logo" class="logo">
{% endif %}
<h1 class="mb-0">Upload Content</h1>
</div>
<form id="upload-form" action="{{ url_for('upload_content') }}" method="post" enctype="multipart/form-data" onsubmit="showPopupMessage('Content uploaded successfully!')">
<input type="hidden" name="return_url" value="{{ return_url }}">
<div class="mb-3">
<label for="target_type" class="form-label">Target Type:</label>
@@ -55,6 +76,8 @@
<select name="media_type" id="media_type" class="form-select" required>
<option value="image">Image</option>
<option value="video">Video</option>
<option value="pdf">PDF</option>
<option value="ppt">PPT/PPTX</option>
</select>
</div>
<div class="mb-3">
@@ -70,6 +93,9 @@
<a href="{{ return_url }}" class="btn btn-secondary mt-3">Back</a>
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary mt-3">Back to Dashboard</a>
</div>
<div id="popup-message" class="popup-message"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.getElementById('files').addEventListener('change', function(event) {
@@ -87,6 +113,16 @@
videoElement.src = URL.createObjectURL(videoFile);
}
});
function showPopupMessage(message) {
const popup = document.getElementById('popup-message');
popup.textContent = message;
popup.style.display = 'block';
setTimeout(() => {
popup.style.display = 'none';
document.getElementById('upload-form').submit();
}, 5000); // Display time set to 5 seconds
}
</script>
</body>
</html>