Skip to content
Snippets Groups Projects
Commit 03b01bd4 authored by Alexander Kohler's avatar Alexander Kohler
Browse files

Projekt-Ansichten um Kürzel-Anzeige erweitert

- Kürzel-Badges in Projekt-Details und Listen hinzugefügt
- Verbesserte Benutzeroberfläche für Projekt-Aktionen
- Fallback-Behandlung für leere Datumsfelder
parent 18750ed4
No related branches found
No related tags found
1 merge request!4merge dev to main
......@@ -9,9 +9,12 @@
<div>
<!-- Main project name as page heading -->
<h1 class="mb-1">{{ .Data.Project.Name }}</h1>
<!-- Subheading with project ID badge and date range -->
<!-- Subheading with project ID, shortcut badges and date range -->
<p class="text-muted mb-0">
<span class="badge bg-secondary me-2">{{ .Data.Project.ProjectID }}</span>
{{ if .Data.Project.Shortcut }}
<span class="badge bg-primary me-2">{{ .Data.Project.Shortcut }}</span>
{{ end }}
{{ .Data.Project.StartDate.Format "02.01.2006" }} - {{ .Data.Project.EndDate.Format "02.01.2006" }}
</p>
</div>
......@@ -95,6 +98,12 @@
<dt class="col-sm-3">Projekt-ID:</dt>
<dd class="col-sm-9">{{ .Data.Project.ProjectID }}</dd>
<!-- Project shortcut field -->
{{ if .Data.Project.Shortcut }}
<dt class="col-sm-3">Kürzel:</dt>
<dd class="col-sm-9"><span class="badge bg-primary">{{ .Data.Project.Shortcut }}</span></dd>
{{ end }}
<!-- Project name field -->
<dt class="col-sm-3">Name:</dt>
<dd class="col-sm-9">{{ .Data.Project.Name }}</dd>
......
......@@ -23,38 +23,34 @@
<!-- Bootstrap card component with shadow for visual depth -->
<div class="card h-100 shadow-sm project-card">
<!-- Card header with project ID and actions dropdown -->
<!-- Card header with project ID, shortcut and actions dropdown -->
<div class="card-header d-flex justify-content-between align-items-center">
<!-- Display human-readable project ID (e.g., PRJ-2025-001) -->
<h6 class="mb-0 text-muted">{{ .ProjectID }}</h6>
<!-- Display human-readable project ID and shortcut -->
<div>
<h6 class="mb-0 text-muted">{{ .ProjectID }}</h6>
{{ if .Shortcut }}
<small class="badge bg-primary">{{ .Shortcut }}</small>
{{ end }}
</div>
<!-- Bootstrap dropdown for project actions (edit, delete) -->
<div class="dropdown">
<button class="btn btn-sm btn-outline-secondary dropdown-toggle"
type="button"
data-bs-toggle="dropdown">
<!-- Project action buttons (edit, delete) -->
<div class="btn-group" role="group">
<!-- Edit button using HTMX for seamless navigation -->
<a class="btn btn-sm btn-outline-primary"
href="/project/{{ .ID.Hex }}/edit"
hx-boost="true"
hx-target="body"
title="Bearbeiten">
✏️
</a>
<!-- Delete button triggers modal for confirmation -->
<button class="btn btn-sm btn-outline-danger"
type="button"
data-bs-toggle="modal"
data-bs-target="#deleteModal-{{ .ID.Hex }}"
title="Löschen">
🗑️
</button>
<ul class="dropdown-menu">
<li>
<!-- Edit link using HTMX for seamless navigation -->
<a class="dropdown-item"
href="/project/{{ .ID.Hex }}/edit"
hx-boost="true"
hx-target="body">
✏️ Bearbeiten
</a>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<!-- Delete button triggers modal for confirmation -->
<button class="dropdown-item text-danger"
data-bs-toggle="modal"
data-bs-target="#deleteModal-{{ .ID.Hex }}">
🗑️ Löschen
</button>
</li>
</ul>
</div>
</div>
......@@ -82,10 +78,10 @@
<!-- Project timeline showing start and end dates -->
<div class="d-flex justify-content-between text-small text-muted">
<span>
📅 {{ .StartDate.Format "02.01.2006" }}
📅 {{ if .StartDate.IsZero }}Nicht festgelegt{{ else }}{{ .StartDate.Format "02.01.2006" }}{{ end }}
</span>
<span>
🏁 {{ .EndDate.Format "02.01.2006" }}
🏁 {{ if .EndDate.IsZero }}Nicht festgelegt{{ else }}{{ .EndDate.Format "02.01.2006" }}{{ end }}
</span>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment