From 01e34b8bfc348eca93f79c0de70ae0e5b811b607 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Tue, 16 Dec 2025 09:52:29 +0000 Subject: [PATCH] Beta v1.1.0 --- core/__pycache__/admin.cpython-311.pyc | Bin 212 -> 361 bytes core/__pycache__/models.cpython-311.pyc | Bin 209 -> 2105 bytes core/__pycache__/urls.cpython-311.pyc | Bin 347 -> 476 bytes core/__pycache__/views.cpython-311.pyc | Bin 1364 -> 1390 bytes core/admin.py | 3 +- core/migrations/0001_initial.py | 33 ++++ .../__pycache__/0001_initial.cpython-311.pyc | Bin 0 -> 2388 bytes core/models.py | 22 ++- core/templates/base.html | 5 +- core/templates/core/article_detail.html | 36 +++- core/templates/core/index.html | 176 ++++-------------- core/urls.py | 7 +- core/views.py | 30 ++- static/css/custom.css | 120 +++++++++++- staticfiles/css/custom.css | 129 +++++++++++-- 15 files changed, 376 insertions(+), 185 deletions(-) create mode 100644 core/migrations/0001_initial.py create mode 100644 core/migrations/__pycache__/0001_initial.cpython-311.pyc diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855b12f4883b1ba9de01c54245c53aacd714..adac93c1a8285a283f7a7ae54bd593b26309e46b 100644 GIT binary patch delta 267 zcmcb@_>!r9IWI340}$+%bI6PW(vLwL7+{7nJ_i9A(-~42QW$d>av7r-85vTTQkZj? za+#x;85vR;vshqS7O=ut$aE_6GDZf5)j$jZK>aMi44SMj6+nDV##^k3DY=<>FF^`` zJobR1{G^=JTt7{=iTIWI340}y=Q^((_3NIwQ~V1NnA_$&luOlL@8NMX!j$YqRTWMoKT3TDt` wehE^b$#{!3F(o%M&rg$S;(XDG7ah4cfWnMGTr4|ThEa<90)qk&6|n(D09Qm7z5oCK diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b9d5171b2bb0d207f045e07f9fbbb95a64..86dcd6d6bd67504ad267e84ea376772bf39c120c 100644 GIT binary patch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#s(2&~7U>_U*P$DJoV|3yE1;3{*3jhEB literal 209 zcmZ3^%ge<81S>LrWmp2~#~=<2FhLogg@BCd3@HpLj5!Rsj8Tk?3@J>(44TX@K?*b( zZ?Wa(r=;c-`)M-W;!Md(%uCPLOGzqX21>4E_zY6>OHV%|KQ~psG^sSNq*On(A~m_R zB)>?%JijQrxF9h(RX;huC{-U~j9x+IFAf_ZyEG@&u80Guoe_wOWr4&8W=2NF8w@fR Ku%RM0pb7xTsWln^ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fae1897c89361c99c5e868a26d00799b73f..c8f23fdb3759eb3c2e6e585dc7f71db38edff3a5 100644 GIT binary patch literal 476 zcmZuszfZzI6uxV(rO=?k#f61UqTvQNLr9FBU5rZyN#QO~>91T{L8p%V2l5w4jQ%kt zA%@&U;>1S6#^fF1pz*u+?%vD$-goa!%jFUfn4Vs`AL9L#$q)2>u(=b#Ga!IK5BSiA z5DLVM89NC%zC?pzHiT+-AQ2}@p{*7J5pokRzR(gu9lhO^Sn=47JLyjUR z>93$n6t1}ep(B0}v9RM&zfEZ3xE@E{kWmhpwr>d>pFUOgB;0g^h*9+Vv z_fF6Y8!7W*Ca2=sgG-0;PGHC4h7(0?sl!dd5;G)}1@SA`2sYTB;eO~-oOaS6NiiMK zZkmJ)4?{MHBd1HT90*JKM)bHfntn)9kG5DvG|N@ufw`EOf-ll(thnw890 x>p&}J*7#_AJ2}o#ZH8)dR9he;v+`nf66EJsIkINRnj>qisfS8t%EJ!De_vpifD!-z delta 258 zcmcb^e4D9$IWI340}vcY|CNyiq#uJgFu)3Be6|5HrZc24q%h_%*WY6bv? C{W!+} diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf286a519cf1754ac97038f9f1e4605fbf2..d4c00b6676b038c1d7ad931cbaf8a65c5037c012 100644 GIT binary patch literal 1390 zcmbVLJ#W)M7(Rc*ZW|i+gD+94grPzaP%}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vBo_=xO9-byQAClpGeK>Cq=SgH`KYEcQr*=2(Y)rkjUzh zjLA1SvQQ+`P^St6ILpn`G%nnsi2;SgfYQiw5IK}RL(87&EIXt$O;ehFJ3{zeozK~P zjzsP@E}rS{ZTR|vq4x}skCZe#{eAwOd-P}AZnwt+xT1q-1MUND0MeF+g E9~qmLT>t<8 literal 0 HcmV?d00001 diff --git a/core/models.py b/core/models.py index 71a8362..51219e6 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,23 @@ from django.db import models -# Create your models here. +class Problem(models.Model): + title = models.CharField(max_length=255) + TYPE_CHOICES = [('contest', 'Contest'), ('practice', 'Practice')] + LEVEL_CHOICES = [('easy', 'Easy'), ('medium', 'Medium'), ('hard', 'Hard')] + STATUS_CHOICES = [('draft', 'Draft'), ('published', 'Published')] + + type = models.CharField(max_length=10, choices=TYPE_CHOICES, default='contest') + author = models.CharField(max_length=100) + level = models.CharField(max_length=10, choices=LEVEL_CHOICES, default='easy') + input_and_output_methods = models.TextField(blank=True, help_text="Describe Input and Output methods (IaOM)") + access_code = models.CharField(max_length=50, blank=True, help_text="Optional code to access the problem") + supported_languages = models.CharField(max_length=255, help_text="e.g., Python, C++, Java") + description = models.TextField() + memory_limit = models.IntegerField(help_text="Memory limit in MB") + time_limit = models.IntegerField(help_text="Time limit in seconds") + status = models.CharField(max_length=10, choices=STATUS_CHOICES, default='draft') + point = models.IntegerField(default=100) + created_day = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.title \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..b78403f 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -3,7 +3,7 @@ - {% block title %}Knowledge Base{% endblock %} + {% block title %}Test Management{% endblock %} {% if project_description %} @@ -13,6 +13,9 @@ {% endif %} + + + {% load static %} {% block head %}{% endblock %} diff --git a/core/templates/core/article_detail.html b/core/templates/core/article_detail.html index 8820990..23f0639 100644 --- a/core/templates/core/article_detail.html +++ b/core/templates/core/article_detail.html @@ -1,14 +1,36 @@ {% extends 'base.html' %} +{% load static %} -{% block title %}{{ article.title }}{% endblock %} +{% block title %}{{ problem.title }}{% endblock %} {% block content %}
-

{{ article.title }}

-

Published on {{ article.created_at|date:"F d, Y" }}

-
-
- {{ article.content|safe }} +
+
+

{{ problem.title }}

+
+
+
Author: {{ problem.author }}
+

Level: {{ problem.level|title }}

+

Type: {{ problem.type|title }}

+

Supported Languages: {{ problem.supported_languages }}

+

Memory Limit: {{ problem.memory_limit }} MB

+

Time Limit: {{ problem.time_limit }} seconds

+

Points: {{ problem.point }}

+
+

Description

+

{{ problem.description }}

+
+

Input and Output Methods

+

{{ problem.input_and_output_methods }}

+
+
+ Back to Problems
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..a01f4dd 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,45 @@ -{% extends "base.html" %} +{% extends 'base.html' %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} +{% block title %}Test Dashboard{% endblock %} {% block head %} - - - - + {% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
-
-
- Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC) -
-{% endblock %} \ No newline at end of file + + +
+

Test Management Dashboard

+

Welcome, Admin. Manage and review programming problems.

+
+ +
+

Available Problems

+ {% if problems %} +
+ {% for problem in problems %} +
+

{{ problem.title }}

+
+ Author: {{ problem.author }} + {{ problem.level }} +
+

{{ problem.description|truncatewords:20 }}

+ View Details +
+ {% endfor %} +
+ {% else %} +
+

No problems found. Add a new problem in the admin panel to get started.

+
+ {% endif %} +
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..1b743e1 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,10 @@ from django.urls import path -from .views import home +from .views import index, problem_detail + +app_name = "core" urlpatterns = [ - path("", home, name="home"), + path("", index, name="index"), + path("problem//", problem_detail, name="problem_detail"), ] diff --git a/core/views.py b/core/views.py index c9aed12..e42027b 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,23 @@ import os -import platform -from django import get_version as django_version -from django.shortcuts import render -from django.utils import timezone +from django.shortcuts import render, get_object_or_404 +from .models import Problem -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() - +def index(request): + problems = Problem.objects.filter(status='published') 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, + 'problems': problems, "project_description": os.getenv("PROJECT_DESCRIPTION", ""), "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), } return render(request, "core/index.html", context) + +def problem_detail(request, pk): + problem = get_object_or_404(Problem, pk=pk) + context = { + 'problem': problem, + "project_description": os.getenv("PROJECT_DESCRIPTION", ""), + "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), + } + return render(request, "core/article_detail.html", context) diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..aa0b85e 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,118 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; +:root { + --primary-color: #1a237e; + --secondary-color: #ffab40; + --accent-color: #448aff; + --background-color: #f5f5f5; + --text-color: #212121; + --heading-font: 'Poppins', sans-serif; + --body-font: 'Roboto', sans-serif; } + +body { + font-family: var(--body-font); + background-color: var(--background-color); + color: var(--text-color); + margin: 0; + padding: 0; + line-height: 1.6; +} + +h1, h2, h3, h4, h5, h6 { + font-family: var(--heading-font); + color: var(--primary-color); +} + +.navbar { + background-color: #ffffff; + border-bottom: 1px solid #e0e0e0; + padding: 1rem 2rem; + display: flex; + justify-content: space-between; + align-items: center; +} + +.navbar-brand { + font-family: var(--heading-font); + font-weight: 600; + font-size: 1.5rem; + color: var(--primary-color); + text-decoration: none; +} + +.hero { + background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); + color: #ffffff; + padding: 4rem 2rem; + text-align: center; + border-bottom-left-radius: 30px; + border-bottom-right-radius: 30px; +} + +.hero h1 { + color: #ffffff; + font-size: 2.5rem; + margin-bottom: 0.5rem; +} + +.container { + max-width: 1200px; + margin: 2rem auto; + padding: 0 2rem; +} + +.problem-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 1.5rem; +} + +.problem-card { + background-color: #ffffff; + border-radius: 15px; + box-shadow: 0 4px 6px rgba(0,0,0,0.1); + padding: 1.5rem; + transition: transform 0.3s ease, box-shadow 0.3s ease; +} + +.problem-card:hover { + transform: translateY(-5px); + box-shadow: 0 8px 12px rgba(0,0,0,0.15); +} + +.problem-card h3 { + margin-top: 0; + font-size: 1.25rem; +} + +.problem-meta { + font-size: 0.9rem; + color: #757575; +} + +.problem-meta span { + margin-right: 1rem; +} + +.level-badge { + display: inline-block; + padding: 0.25rem 0.75rem; + border-radius: 12px; + font-size: 0.8rem; + font-weight: 500; + text-transform: capitalize; +} + +.level-easy { + background-color: #e8f5e9; + color: #4caf50; +} + +.level-medium { + background-color: #fff3e0; + color: #ff9800; +} + +.level-hard { + background-color: #ffebee; + color: #f44336; +} \ No newline at end of file diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..aa0b85e 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,118 @@ - :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); + --primary-color: #1a237e; + --secondary-color: #ffab40; + --accent-color: #448aff; + --background-color: #f5f5f5; + --text-color: #212121; + --heading-font: 'Poppins', sans-serif; + --body-font: 'Roboto', sans-serif; } + body { - margin: 0; - font-family: 'Inter', sans-serif; - background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); + font-family: var(--body-font); + background-color: var(--background-color); color: var(--text-color); - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - text-align: center; - overflow: hidden; - position: relative; + margin: 0; + padding: 0; + line-height: 1.6; } + +h1, h2, h3, h4, h5, h6 { + font-family: var(--heading-font); + color: var(--primary-color); +} + +.navbar { + background-color: #ffffff; + border-bottom: 1px solid #e0e0e0; + padding: 1rem 2rem; + display: flex; + justify-content: space-between; + align-items: center; +} + +.navbar-brand { + font-family: var(--heading-font); + font-weight: 600; + font-size: 1.5rem; + color: var(--primary-color); + text-decoration: none; +} + +.hero { + background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); + color: #ffffff; + padding: 4rem 2rem; + text-align: center; + border-bottom-left-radius: 30px; + border-bottom-right-radius: 30px; +} + +.hero h1 { + color: #ffffff; + font-size: 2.5rem; + margin-bottom: 0.5rem; +} + +.container { + max-width: 1200px; + margin: 2rem auto; + padding: 0 2rem; +} + +.problem-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 1.5rem; +} + +.problem-card { + background-color: #ffffff; + border-radius: 15px; + box-shadow: 0 4px 6px rgba(0,0,0,0.1); + padding: 1.5rem; + transition: transform 0.3s ease, box-shadow 0.3s ease; +} + +.problem-card:hover { + transform: translateY(-5px); + box-shadow: 0 8px 12px rgba(0,0,0,0.15); +} + +.problem-card h3 { + margin-top: 0; + font-size: 1.25rem; +} + +.problem-meta { + font-size: 0.9rem; + color: #757575; +} + +.problem-meta span { + margin-right: 1rem; +} + +.level-badge { + display: inline-block; + padding: 0.25rem 0.75rem; + border-radius: 12px; + font-size: 0.8rem; + font-weight: 500; + text-transform: capitalize; +} + +.level-easy { + background-color: #e8f5e9; + color: #4caf50; +} + +.level-medium { + background-color: #fff3e0; + color: #ff9800; +} + +.level-hard { + background-color: #ffebee; + color: #f44336; +} \ No newline at end of file