You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
179 lines
6.1 KiB
179 lines
6.1 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Praktikumsuhr</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
|
|
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script>
|
|
<%= csrf_meta_tags %>
|
|
<%= csp_meta_tag %>
|
|
<!-- Bootstrap CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<!-- Flatpickr Theme -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/themes/material_blue.css">
|
|
|
|
<!-- Custom Styles (optional) -->
|
|
|
|
<!-- JS: Bootstrap Bundle (inkl. Popper) -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" defer></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.5.0/chart.min.js" integrity="sha512-n/G+dROKbKL3GVngGWmWfwK0yPctjZQM752diVYnXZtD/48agpUKLIn0xDQL9ydZ91x6BiOmTIFwWjjFi2kEFg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
const modalElement = document.getElementById('deleteConfirmModal');
|
|
const modalInstance = bootstrap.Modal.getOrCreateInstance(modalElement);
|
|
|
|
document.querySelectorAll('.open-delete-modal').forEach(button => {
|
|
button.addEventListener('click', function (e) {
|
|
e.preventDefault();
|
|
const targetUrl = this.getAttribute('href');
|
|
document.getElementById('modal-delete-form').setAttribute('action', targetUrl);
|
|
|
|
// Entferne diese Zeile:
|
|
// modalElement.removeAttribute("aria-hidden");
|
|
|
|
modalInstance.show();
|
|
});
|
|
});
|
|
|
|
// Event-Handler für korrektes Zurücksetzen nach Schließen
|
|
modalElement.addEventListener('hidden.bs.modal', function () {
|
|
document.body.classList.remove('modal-open');
|
|
const backdrops = document.querySelectorAll('.modal-backdrop');
|
|
backdrops.forEach(b => b.parentNode.removeChild(b));
|
|
});
|
|
|
|
|
|
|
|
});
|
|
function clearNotice(){
|
|
$("#notice").animate({opacity:'0'}, 1500);
|
|
}
|
|
$(document).ready(ready);
|
|
$(document).on('page:load', ready);
|
|
|
|
var ready = function() {
|
|
setTimeout(clearNotice, 1000); //Flash fade
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
|
|
|
|
<style>
|
|
@media (min-width: 1400px) {
|
|
.container,
|
|
.container-lg,
|
|
.container-md,
|
|
.container-sm,
|
|
.container-xl,
|
|
.container-xxl {
|
|
max-width: 1820px !important;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<!-- 🔒 Modal zur Bestätigung -->
|
|
<div class="modal fade" id="deleteConfirmModal" tabindex="-1" aria-labelledby="deleteConfirmModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Löschen bestätigen</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Schließen"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
Bist du sicher, dass du diesen Eintrag löschen möchtest?
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
|
<form id="modal-delete-form" method="post">
|
|
<input type="hidden" name="_method" value="delete">
|
|
<%= hidden_field_tag :authenticity_token, form_authenticity_token %>
|
|
<button type="submit" class="btn btn-danger">Löschen</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-4">
|
|
<div class="container">
|
|
<%= link_to "⏱️ Praktikumsuhr", root_path, class: "navbar-brand" %>
|
|
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
|
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
|
|
<% if user_signed_in? %>
|
|
<li class="nav-item">
|
|
<%= link_to "Einträge", entries_path, class: "nav-link" %>
|
|
</li>
|
|
<li class="nav-item">
|
|
<%= link_to "Monatsreport", monthly_report_entries_path, class: "nav-link" %>
|
|
</li>
|
|
<li class="nav-item">
|
|
<%= link_to "Profil", edit_user_registration_path, class: "nav-link" %>
|
|
</li>
|
|
|
|
<% if current_user.is_admin? %>
|
|
<li class="nav-item">
|
|
<%= link_to "Admin", admin_root_url, class: "nav-link" %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if current_user.is_admin? %>
|
|
<li class="nav-item">
|
|
<%= link_to "Database", db_dump_path, class: "nav-link" %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% if current_user.is_admin? %>
|
|
<li class="nav-item">
|
|
<%= link_to "PGHero", pghero_path, class: "nav-link" %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<li class="nav-item">
|
|
<%= link_to "Abmelden", destroy_user_session_path, method: :delete, data: { turbo: false }, class: "nav-link" %>
|
|
</li>
|
|
<% else %>
|
|
<li class="nav-item">
|
|
<%= link_to "Anmelden", new_user_session_path, class: "nav-link" %>
|
|
</li>
|
|
<li class="nav-item">
|
|
<%= link_to "Registrieren", new_user_registration_path, class: "nav-link" %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container" id="notice">
|
|
<% if notice %>
|
|
<div class="alert alert-success"><%= notice %></div>
|
|
<% end %>
|
|
<% if alert %>
|
|
<div class="alert alert-danger"><%= alert %></div>
|
|
<% end %>
|
|
|
|
<%= yield %>
|
|
</div>
|
|
|
|
|
|
<footer class="text-center mt-5">
|
|
<%= link_to "Impressum & Datenschutz", impressum_path, class: "text-muted" %>
|
|
</footer>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|
|
|