initial version

This commit is contained in:
Flatlogic Bot 2025-12-17 18:33:17 +00:00
parent 6a975a9056
commit fdc5b48be6
16 changed files with 286 additions and 190 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

14
core/forms.py Normal file
View File

@ -0,0 +1,14 @@
from django import forms
from .models import Project
class ProjectForm(forms.ModelForm):
class Meta:
model = Project
fields = ['name', 'client', 'start_date', 'end_date', 'status']
widgets = {
'name': forms.TextInput(attrs={'class': 'form-control'}),
'client': forms.TextInput(attrs={'class': 'form-control'}),
'start_date': forms.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
'end_date': forms.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
'status': forms.Select(attrs={'class': 'form-select'}),
}

View File

@ -0,0 +1,25 @@
# Generated by Django 5.2.7 on 2025-12-17 18:30
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Project',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200, verbose_name='Nazwa projektu')),
('client', models.CharField(max_length=200, verbose_name='Kontrahent')),
('start_date', models.DateField(verbose_name='Data rozpoczęcia')),
('end_date', models.DateField(verbose_name='Data zakończenia')),
('status', models.CharField(choices=[('planowany', 'Planowany'), ('realizowany', 'Realizowany'), ('zakonczony', 'Zakończony')], default='planowany', max_length=20, verbose_name='Status')),
],
),
]

View File

@ -1,3 +1,17 @@
from django.db import models from django.db import models
# Create your models here. class Project(models.Model):
STATUS_CHOICES = [
('planowany', 'Planowany'),
('realizowany', 'Realizowany'),
('zakonczony', 'Zakończony'),
]
name = models.CharField(max_length=200, verbose_name="Nazwa projektu")
client = models.CharField(max_length=200, verbose_name="Kontrahent")
start_date = models.DateField(verbose_name="Data rozpoczęcia")
end_date = models.DateField(verbose_name="Data zakończenia")
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='planowany', verbose_name="Status")
def __str__(self):
return self.name

View File

@ -14,7 +14,10 @@
<meta property="twitter:image" content="{{ project_image_url }}"> <meta property="twitter:image" content="{{ project_image_url }}">
{% endif %} {% endif %}
{% load static %} {% load static %}
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}"> <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">
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>

View File

@ -0,0 +1,28 @@
{% extends 'base.html' %}
{% load static %}
{% block title %}Dodaj Nowy Projekt - webFirma{% endblock %}
{% block content %}
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card shadow-sm">
<div class="card-header bg-primary text-white">
<h1 class="h3 mb-0">Dodaj Nowy Projekt</h1>
</div>
<div class="card-body">
<form method="post" novalidate>
{% csrf_token %}
{{ form.as_p }}
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{% url 'index' %}" class="btn btn-secondary me-md-2">Anuluj</a>
<button type="submit" class="btn btn-primary">Zapisz Projekt</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -1,145 +1,58 @@
{% extends "base.html" %} {% extends 'base.html' %}
{% load static %}
{% block title %}{{ project_name }}{% endblock %} {% block title %}Pulpit - webFirma{% endblock %}
{% 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>
{% endblock %}
{% block content %} {% block content %}
<main> <header class="hero-section text-white text-center">
<div class="card"> <div class="container">
<h1>Analyzing your requirements and generating your app…</h1> <h1 class="display-4">Witaj w webFirma</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes"> <p class="lead">Kompleksowe zarządzanie firmą w jednym miejscu.</p>
<span class="sr-only">Loading…</span>
</div> </div>
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p> </header>
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
<p class="runtime"> <div class="container mt-5">
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code> <section id="projects">
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code> <div class="d-flex justify-content-between align-items-center mb-4">
</p> <h2 class="section-title">Projekty</h2>
</div> <a href="{% url 'add_project' %}" class="btn btn-primary">Dodaj projekt</a>
</main> </div>
<footer>
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC) <div class="card shadow-sm">
</footer> <div class="card-body">
{% if projects %}
<div class="table-responsive">
<table class="table table-hover align-middle">
<thead class="table-light">
<tr>
<th scope="col">Nazwa projektu</th>
<th scope="col">Kontrahent</th>
<th scope="col">Data rozpoczęcia</th>
<th scope="col">Data zakończenia</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
{% for project in projects %}
<tr>
<td>{{ project.name }}</td>
<td>{{ project.client }}</td>
<td>{{ project.start_date|date:"Y-m-d" }}</td>
<td>{{ project.end_date|date:"Y-m-d" }}</td>
<td><span class="badge bg-primary-soft">{{ project.get_status_display }}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center p-4">
<p class="mb-3">Brak projektów do wyświetlenia.</p>
<p>Utwórz swój pierwszy projekt, aby zacząć zarządzać pracą.</p>
</div>
{% endif %}
</div>
</div>
</section>
</div>
{% endblock %} {% endblock %}

View File

@ -1,7 +1,7 @@
from django.urls import path from django.urls import path
from .views import index, add_project
from .views import home
urlpatterns = [ urlpatterns = [
path("", home, name="home"), path('', index, name='index'),
path('add-project/', add_project, name='add_project'),
] ]

View File

@ -1,25 +1,17 @@
import os from django.shortcuts import render, redirect
import platform from .models import Project
from .forms import ProjectForm
from django import get_version as django_version def index(request):
from django.shortcuts import render projects = Project.objects.all().order_by('-start_date')
from django.utils import timezone return render(request, 'core/index.html', {'projects': projects})
def add_project(request):
def home(request): if request.method == 'POST':
"""Render the landing screen with loader and environment details.""" form = ProjectForm(request.POST)
host_name = request.get_host().lower() if form.is_valid():
agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" form.save()
now = timezone.now() return redirect('index')
else:
context = { form = ProjectForm()
"project_name": "New Style", return render(request, 'core/add_project.html', {'form': form})
"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)

View File

@ -1,4 +1,66 @@
/* Custom styles for the application */ :root {
body { --bs-primary: #1A237E;
font-family: system-ui, -apple-system, sans-serif; --bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #F5F5F5;
--bs-dark: #212121;
--bs-primary-rgb: 26, 35, 126;
--bs-font-sans-serif: 'Lato', sans-serif;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-family: 'Poppins', sans-serif;
font-weight: 600;
}
body {
background-color: var(--bs-light);
color: var(--bs-dark);
}
.hero-section {
background: linear-gradient(to right, #1A237E, #2962FF);
padding: 4rem 0;
margin-bottom: -1px; /* Overlap to avoid gap */
}
.section-title {
color: var(--bs-primary);
font-weight: 700;
}
.btn-primary {
background-color: #2962FF;
border-color: #2962FF;
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.btn-primary:hover {
background-color: #1A237E;
border-color: #1A237E;
}
.card {
border: none;
}
.card-header.bg-primary {
background-color: var(--bs-primary) !important;
}
.table {
margin-bottom: 0;
}
.table th {
font-weight: 600;
color: var(--bs-dark);
}
.badge.bg-primary-soft {
color: var(--bs-primary);
background-color: rgba(var(--bs-primary-rgb), 0.1);
} }

View File

@ -1,21 +1,66 @@
:root { :root {
--bg-color-start: #6a11cb; --bs-primary: #1A237E;
--bg-color-end: #2575fc; --bs-secondary: #6c757d;
--text-color: #ffffff; --bs-success: #198754;
--card-bg-color: rgba(255, 255, 255, 0.01); --bs-info: #0dcaf0;
--card-border-color: rgba(255, 255, 255, 0.1); --bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #F5F5F5;
--bs-dark: #212121;
--bs-primary-rgb: 26, 35, 126;
--bs-font-sans-serif: 'Lato', sans-serif;
} }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-family: 'Poppins', sans-serif;
font-weight: 600;
}
body { body {
margin: 0; background-color: var(--bs-light);
font-family: 'Inter', sans-serif; color: var(--bs-dark);
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); }
color: var(--text-color);
display: flex; .hero-section {
justify-content: center; background: linear-gradient(to right, #1A237E, #2962FF);
align-items: center; padding: 4rem 0;
min-height: 100vh; margin-bottom: -1px; /* Overlap to avoid gap */
text-align: center; }
overflow: hidden;
position: relative; .section-title {
color: var(--bs-primary);
font-weight: 700;
}
.btn-primary {
background-color: #2962FF;
border-color: #2962FF;
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.btn-primary:hover {
background-color: #1A237E;
border-color: #1A237E;
}
.card {
border: none;
}
.card-header.bg-primary {
background-color: var(--bs-primary) !important;
}
.table {
margin-bottom: 0;
}
.table th {
font-weight: 600;
color: var(--bs-dark);
}
.badge.bg-primary-soft {
color: var(--bs-primary);
background-color: rgba(var(--bs-primary-rgb), 0.1);
} }