Files
TimeTracker/app/templates/admin/user_form.html
Dries Peeters 3c3faf13d4 feat: Implement Tailwind CSS UI redesign across application
Migrate frontend from custom CSS to Tailwind CSS framework with comprehensive
template updates and improved component structure.

Breaking Changes:
- Remove legacy CSS files (base.css, calendar.css, ui.css, etc.)
- Replace with Tailwind-based styling system

New Features:
- Add Tailwind CSS configuration with PostCSS pipeline
- Create new template components for admin, clients, invoices, projects, reports
- Add form-bridge.css for smooth transition between legacy and Tailwind styles
- Add default avatar SVG asset
- Implement Tailwind-based kanban board template
- Add comprehensive UI quick wins documentation

Infrastructure:
- Add package.json with Tailwind dependencies
- Configure PostCSS and Tailwind build pipeline
- Update .gitignore for Node modules and build artifacts

Testing:
- Add template rendering tests (test_tasks_templates.py)
- Add UI component tests (test_ui_quick_wins.py)

Templates Added:
- Admin: dashboard, settings, system info, user management
- Clients: list and detail views
- Invoices: full CRUD templates with payment recording
- Projects: list, detail, and Tailwind kanban views
- Reports: comprehensive reporting templates
- Timer: manual entry interface

This commit represents the first phase of the UI redesign initiative,
maintaining backward compatibility where needed while establishing the
foundation for modern, responsive interfaces.
2025-10-17 11:51:36 +02:00

42 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-6">
<div>
<h1 class="text-2xl font-bold">{{ 'Edit User' if user else 'Create User' }}</h1>
<p class="text-text-muted-light dark:text-text-muted-dark">
{{ 'Update the details for %s.'|format(user.username) if user else 'Create a new user account.' }}
</p>
</div>
</div>
<div class="bg-card-light dark:bg-card-dark p-6 rounded-lg shadow">
<form method="POST">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="space-y-6">
<div>
<label for="username" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Username</label>
<input type="text" name="username" id="username" value="{{ user.username if user else '' }}" required class="form-input">
</div>
<div>
<label for="role" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Role</label>
<select name="role" id="role" class="form-input">
<option value="user" {% if user and user.role == 'user' %}selected{% endif %}>User</option>
<option value="admin" {% if user and user.role == 'admin' %}selected{% endif %}>Admin</option>
</select>
</div>
{% if user %}
<div class="flex items-center">
<input type="checkbox" name="is_active" id="is_active" {% if user.is_active %}checked{% endif %} class="h-4 w-4 rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
<label for="is_active" class="ml-2 block text-sm text-gray-900 dark:text-gray-300">Active</label>
</div>
{% endif %}
</div>
<div class="mt-8 border-t border-border-light dark:border-border-dark pt-6 flex justify-end">
<a href="{{ url_for('admin.list_users') }}" class="bg-gray-200 dark:bg-gray-700 px-4 py-2 rounded-lg mr-4">Cancel</a>
<button type="submit" class="bg-primary text-white px-4 py-2 rounded-lg">Save</button>
</div>
</form>
</div>
{% endblock %}