feat: enhance web interface layout and fix logo import circular dependency

- Improve web interface layout for better user-friendliness and mobile responsiveness
  * Update CSS variables for consistent spacing and component sizing
  * Enhance card layouts with improved padding, borders, and shadows
  * Optimize button and form element dimensions for better touch targets
  * Add hover effects and animations for improved user interaction
  * Implement responsive grid system with mobile-first approach

- Refactor mobile JavaScript to prevent duplicate initialization
  * Consolidate mobile enhancements into dedicated utility classes
  * Add initialization guards to prevent double loading
  * Implement MobileUtils and MobileNavigation classes
  * Remove duplicate event listeners and mobile enhancements

- Fix circular import issue in logo handling
  * Replace problematic 'from app import app' with Flask's current_app
  * Add error handling for cases where current_app is unavailable
  * Improve logo path resolution with fallback mechanisms
  * Fix settings model to use proper Flask context

- Clean up template code and remove duplication
  * Remove duplicate mobile enhancements from base template
  * Clean up dashboard template JavaScript
  * Centralize all mobile functionality in mobile.js
  * Add proper error handling and debugging

- Update CSS variables and spacing system
  * Introduce --section-spacing and --card-spacing variables
  * Add mobile-specific spacing variables
  * Improve border-radius and shadow consistency
  * Enhance typography and visual hierarchy

This commit resolves the double loading issue and logo import errors while
significantly improving the overall user experience and mobile responsiveness
of the web interface.
This commit is contained in:
Dries Peeters
2025-08-30 10:09:06 +02:00
parent 84e19ca205
commit d230a41e8a
84 changed files with 11792 additions and 2271 deletions

96
.github/workflows/docker-publish.yml vendored Normal file
View File

@@ -0,0 +1,96 @@
name: Build and Publish TimeTracker Docker Image
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
release:
types: [ published ]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: drytrix/timetracker
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- name: amd64
platform: linux/amd64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check files and create combined Dockerfile
run: |
echo "--- Checking available files ---"
pwd
ls -la
echo "--- Checking if requirements.txt exists ---"
if [ -f requirements.txt ]; then
echo "requirements.txt found:"
cat requirements.txt
else
echo "requirements.txt NOT found!"
echo "Available .txt files:"
find . -name "*.txt" -type f
fi
echo "--- Creating combined Dockerfile ---"
cp Dockerfile Dockerfile.final
echo "Combined Dockerfile created successfully"
- name: Build and push Docker image
run: |
IMAGE_ID=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Extract version from ref
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ "${GITHUB_REF}" == refs/heads/* ]]; then
VERSION=${GITHUB_REF#refs/heads/}
else
VERSION=unknown
fi
# Replace any slashes with dashes (for feature branches etc.)
VERSION=${VERSION//\//-}
echo "Image ID: $IMAGE_ID"
echo "Version: $VERSION"
# Build the Docker image
docker build -f Dockerfile.final -t $IMAGE_ID:$VERSION .
# Always push versioned tag on releases/tags
if [ "${{ github.event_name }}" != "pull_request" ]; then
echo ${{ secrets.GITHUB_TOKEN }} | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
docker push $IMAGE_ID:$VERSION
# If this is a release, also push as latest
if [ "${{ github.event_name }}" == "release" ]; then
docker tag $IMAGE_ID:$VERSION $IMAGE_ID:latest
docker push $IMAGE_ID:latest
fi
fi