Browse Source

change ruby version

main
Christoph Marzell 1 month ago
parent
commit
8b0f80cdf6
  1. 6
      Dockerfile
  2. 2
      Gemfile
  3. 5
      Gemfile.lock
  4. 4
      app/assets/javascript/application.js
  5. 26
      app/views/entries/index.html.erb
  6. 79
      app/views/layouts/application.html.erb

6
Dockerfile

@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.0.7
ARG RUBY_VERSION=3.2.9
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
# Rails app lives here
@ -19,7 +19,7 @@ FROM base as build
# Install packages needed to build gems
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config zip
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config zip libyaml-dev
# Install application gems
COPY Gemfile Gemfile.lock ./
@ -47,7 +47,7 @@ FROM base
# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl libvips postgresql-client zip && \
apt-get install --no-install-recommends -y curl libvips postgresql-client-17 libyaml-dev zip && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Copy built artifacts: gems, application

2
Gemfile

@ -1,6 +1,6 @@
source "https://rubygems.org"
ruby "3.0.7"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.5", ">= 7.1.5.2"

5
Gemfile.lock

@ -149,7 +149,7 @@ GEM
net-smtp
marcel (1.1.0)
mini_mime (1.1.5)
minitest (5.26.0)
minitest (5.26.1)
msgpack (1.8.0)
mutex_m (0.3.0)
net-imap (0.4.22)
@ -281,8 +281,5 @@ DEPENDENCIES
tzinfo-data
web-console
RUBY VERSION
ruby 3.0.7p220
BUNDLED WITH
2.5.23

4
app/assets/javascript/application.js

@ -1,6 +1,4 @@
//= require rails-ujs
//= require turbolinks
//= require_tree .
import "@hotwired/turbo-rails"
import * as ActiveStorage from "@rails/activestorage"

26
app/views/entries/index.html.erb

@ -162,28 +162,7 @@
</div>
</div>
<!-- 🔒 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>
<!-- JS für Modal -->
<script>
@ -255,4 +234,5 @@
});
});
});
</script>
</script>

79
app/views/layouts/application.html.erb

@ -6,41 +6,75 @@
<%= 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">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
<!-- Flatpickr Theme -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/themes/material_blue.css">
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<!-- Flatpickr JS -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<!-- Custom Styles (optional) -->
<!-- JS: Flatpickr Init -->
<script defer>
document.addEventListener("DOMContentLoaded", function () {
flatpickr(".flatpickr", {
<!-- JS: Bootstrap Bundle (inkl. Popper) -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" defer></script>
dateFormat: "d.m.Y",
allowInput: true
<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));
});
});
</script>
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
</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>
<script defer>
document.addEventListener("DOMContentLoaded", function () {
flatpickr(".flatpickr", {
altInput: true,
altFormat: "d.m.Y",
dateFormat: "Y-m-d"
});
});
</script>
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-4">
<div class="container">
<%= link_to "⏱️ Praktikumsuhr", root_path, class: "navbar-brand" %>
@ -96,6 +130,9 @@
<footer class="text-center mt-5">
<%= link_to "Impressum & Datenschutz", impressum_path, class: "text-muted" %>
</footer>
</body>
</html>
Loading…
Cancel
Save