This commit is contained in:
Flatlogic Bot 2025-12-12 12:28:22 +00:00
parent 0e6d9a4bf4
commit 2c5b417266
14 changed files with 395 additions and 183 deletions

View File

@ -1,3 +1,9 @@
from django.contrib import admin
from .models import Task
# Register your models here.
@admin.register(Task)
class TaskAdmin(admin.ModelAdmin):
list_display = ('title', 'user', 'priority', 'status', 'due_date', 'created_at')
list_filter = ('status', 'priority', 'user')
search_fields = ('title', 'description')
date_hierarchy = 'due_date'

View File

@ -0,0 +1,31 @@
# Generated by Django 5.2.7 on 2025-12-12 12:21
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('description', models.TextField(blank=True, null=True)),
('priority', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High')], default='medium', max_length=10)),
('status', models.CharField(choices=[('pending', 'Pending'), ('in_progress', 'In Progress'), ('completed', 'Completed'), ('missed', 'Missed')], default='pending', max_length=20)),
('due_date', models.DateField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to=settings.AUTH_USER_MODEL)),
],
),
]

View File

@ -1,3 +1,28 @@
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Task(models.Model):
PRIORITY_CHOICES = [
('low', 'Low'),
('medium', 'Medium'),
('high', 'High'),
]
STATUS_CHOICES = [
('pending', 'Pending'),
('in_progress', 'In Progress'),
('completed', 'Completed'),
('missed', 'Missed'),
]
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="tasks")
title = models.CharField(max_length=200)
description = models.TextField(blank=True, null=True)
priority = models.CharField(max_length=10, choices=PRIORITY_CHOICES, default='medium')
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='pending')
due_date = models.DateField(blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def __str__(self):
return self.title

View File

@ -3,7 +3,10 @@
<head>
<meta charset="UTF-8">
<title>{% block title %}Knowledge Base{% endblock %}</title>
<title>{% block title %}Task Manager{% endblock %}</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Poppins:wght@600;700&display=swap" rel="stylesheet">
{% if project_description %}
<meta name="description" content="{{ project_description }}">
<meta property="og:description" content="{{ project_description }}">

View File

@ -1,145 +1,90 @@
{% extends "base.html" %}
{% block title %}{{ project_name }}{% endblock %}
{% load static %}
{% block head %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
}
body::before {
content: '';
position: absolute;
inset: 0;
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path d='M-10 10L110 10M10 -10L10 110' stroke-width='1' stroke='rgba(255,255,255,0.05)'/></svg>");
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% {
background-position: 0% 0%;
}
100% {
background-position: 100% 100%;
}
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2.5rem 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}
h1 {
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
font-weight: 700;
margin: 0 0 1.2rem;
letter-spacing: -0.02em;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
opacity: 0.92;
}
.loader {
margin: 1.5rem auto;
width: 56px;
height: 56px;
border: 4px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.runtime code {
background: rgba(0, 0, 0, 0.25);
padding: 0.15rem 0.45rem;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
footer {
position: absolute;
bottom: 1rem;
width: 100%;
text-align: center;
font-size: 0.85rem;
opacity: 0.75;
}
</style>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css">
{% endblock %}
{% block title %}Dashboard - Task Manager{% endblock %}
{% block content %}
<main>
<div class="card">
<h1>Analyzing your requirements and generating your app…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
<nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
<div class="container">
<a class="navbar-brand" href="#">
<i class="bi bi-check2-square me-2"></i>
Task Manager
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Tasks</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Profile</a>
</li>
<li class="nav-item">
<a class="btn btn-primary ms-2" href="#">Logout</a>
</li>
</ul>
</div>
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
<p class="runtime">
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
</p>
</div>
</nav>
<main class="container mt-5">
<header class="hero-section text-center mb-5">
<h1 class="display-4">Welcome Back, Alex!</h1>
<p class="lead text-muted">Here are your tasks for today. Keep up the great work!</p>
</header>
<div class="row">
<div class="col-12">
<div class="card shadow-sm">
<div class="card-header bg-white d-flex justify-content-between align-items-center">
<h4 class="mb-0">Today's Tasks</h4>
<button class="btn btn-primary"><i class="bi bi-plus-lg me-1"></i> New Task</button>
</div>
<div class="list-group list-group-flush">
{% for task in tasks %}
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between align-items-center">
<div>
<input class="form-check-input me-3" type="checkbox" value="" id="task-{{ task.id }}" {% if task.status == 'completed' %}checked{% endif %}>
<label class="form-check-label stretched-link" for="task-{{ task.id }}">
<span class="task-title">{{ task.title }}</span>
</label>
</div>
<div>
<span class="badge priority-{{ task.priority }}">{{ task.priority|title }}</span>
<span class="badge status-{{ task.status }} ms-1">{{ task.status|title }}</span> <!-- Replaced filter -->
</div>
</div>
{% if task.description %}
<div class="ms-5 mt-1">
<small class="text-muted">{{ task.description }}</small>
</div>
{% endif %}
</div>
{% empty %}
<div class="list-group-item text-center p-4">
<i class="bi bi-sun fs-1 text-muted"></i>
<h5 class="mt-2">All clear!</h5>
<p class="text-muted">You have no tasks for today. Enjoy your day!</p>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</main>
<footer>
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
<footer class="text-center py-4 mt-5">
<p class="text-muted">&copy; 2025 Task Manager. All Rights Reserved.</p>
</footer>
{% endblock %}
{% endblock %}

View File

@ -1,7 +1,7 @@
from django.urls import path
from .views import home
from .views import IndexView
urlpatterns = [
path("", home, name="home"),
path("", IndexView.as_view(), name="home"),
]

View File

@ -1,25 +1,44 @@
import os
import platform
from django import get_version as django_version
from django.shortcuts import render
from django.utils import timezone
from django.views import View
class IndexView(View):
def get(self, request, *args, **kwargs):
# Mock data for demonstration purposes
mock_tasks = [
{
'id': 1,
'title': 'Finish the report for Q4',
'description': 'Complete the financial report and send to management.',
'priority': 'high',
'status': 'in_progress',
},
{
'id': 2,
'title': 'Schedule team meeting',
'description': 'Organize a meeting to discuss the new project timeline.',
'priority': 'medium',
'status': 'pending',
},
{
'id': 3,
'title': 'Book flight to New York',
'description': '',
'priority': 'low',
'status': 'pending',
},
{
'id': 4,
'title': 'Review intern applications',
'description': 'Go through the first batch of applications.',
'priority': 'high',
'status': 'completed',
},
]
context = {
'tasks': mock_tasks
}
return render(request, 'core/index.html', context)
def home(request):
"""Render the landing screen with loader and environment details."""
host_name = request.get_host().lower()
agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic"
now = timezone.now()
context = {
"project_name": "New Style",
"agent_brand": agent_brand,
"django_version": django_version(),
"python_version": platform.python_version(),
"current_time": now,
"host_name": host_name,
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
}
return render(request, "core/index.html", context)
def article_detail(request):
return render(request, 'core/article_detail.html')

View File

@ -1,4 +1,104 @@
/* Custom styles for the application */
/* General Body & Typography */
body {
font-family: system-ui, -apple-system, sans-serif;
font-family: 'Lato', sans-serif;
background-color: #FFFFFF;
color: #343a40;
}
h1, h2, h3, h4, h5, h6, .navbar-brand, .display-4 {
font-family: 'Poppins', sans-serif;
font-weight: 600;
}
/* Navbar */
.navbar-brand i {
color: #5D3FD3;
}
.navbar {
border-bottom: 1px solid #e9ecef;
}
/* Hero Section */
.hero-section h1 {
color: #5D3FD3;
font-weight: 700;
}
/* Buttons */
.btn-primary {
background-color: #5D3FD3;
border-color: #5D3FD3;
}
.btn-primary:hover, .btn-primary:focus {
background-color: #4C33B3;
border-color: #4C33B3;
}
/* Task List */
.card {
border: none;
border-radius: 0.75rem;
}
.card-header {
border-radius: 0.75rem 0.75rem 0 0;
}
.task-title {
font-weight: 500;
}
.form-check-input:checked {
background-color: #5D3FD3;
border-color: #5D3FD3;
}
.form-check-input:checked + .form-check-label .task-title {
text-decoration: line-through;
color: #6c757d;
}
/* Badges */
.badge {
font-size: 0.8rem;
padding: 0.4em 0.7em;
font-weight: 700;
}
.priority-high {
background-color: #ffcdd2;
color: #c62828;
}
.priority-medium {
background-color: #fff9c4;
color: #f57f17;
}
.priority-low {
background-color: #c8e6c9;
color: #2e7d32;
}
.status-completed {
background-color: #e0e0e0;
color: #616161;
}
.status-pending {
background-color: #bbdefb;
color: #1565c0;
}
.status-in_progress {
background-color: #d1c4e9;
color: #4527a0;
}
.status-missed {
background-color: #fce4ec;
color: #ad1457;
}

View File

@ -1,21 +1,104 @@
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
/* General Body & Typography */
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
font-family: 'Lato', sans-serif;
background-color: #FFFFFF;
color: #343a40;
}
h1, h2, h3, h4, h5, h6, .navbar-brand, .display-4 {
font-family: 'Poppins', sans-serif;
font-weight: 600;
}
/* Navbar */
.navbar-brand i {
color: #5D3FD3;
}
.navbar {
border-bottom: 1px solid #e9ecef;
}
/* Hero Section */
.hero-section h1 {
color: #5D3FD3;
font-weight: 700;
}
/* Buttons */
.btn-primary {
background-color: #5D3FD3;
border-color: #5D3FD3;
}
.btn-primary:hover, .btn-primary:focus {
background-color: #4C33B3;
border-color: #4C33B3;
}
/* Task List */
.card {
border: none;
border-radius: 0.75rem;
}
.card-header {
border-radius: 0.75rem 0.75rem 0 0;
}
.task-title {
font-weight: 500;
}
.form-check-input:checked {
background-color: #5D3FD3;
border-color: #5D3FD3;
}
.form-check-input:checked + .form-check-label .task-title {
text-decoration: line-through;
color: #6c757d;
}
/* Badges */
.badge {
font-size: 0.8rem;
padding: 0.4em 0.7em;
font-weight: 700;
}
.priority-high {
background-color: #ffcdd2;
color: #c62828;
}
.priority-medium {
background-color: #fff9c4;
color: #f57f17;
}
.priority-low {
background-color: #c8e6c9;
color: #2e7d32;
}
.status-completed {
background-color: #e0e0e0;
color: #616161;
}
.status-pending {
background-color: #bbdefb;
color: #1565c0;
}
.status-in_progress {
background-color: #d1c4e9;
color: #4527a0;
}
.status-missed {
background-color: #fce4ec;
color: #ad1457;
}