first commmit
This commit is contained in:
commit
77bb9ea690
138
.gitignore
vendored
Normal file
138
.gitignore
vendored
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
# Django #
|
||||||
|
*.log
|
||||||
|
*.pot
|
||||||
|
*.pyc
|
||||||
|
__pycache__
|
||||||
|
db.sqlite3
|
||||||
|
media
|
||||||
|
|
||||||
|
# Backup files #
|
||||||
|
*.bak
|
||||||
|
|
||||||
|
# If you are using PyCharm #
|
||||||
|
# User-specific stuff
|
||||||
|
.idea/**/workspace.xml
|
||||||
|
.idea/**/tasks.xml
|
||||||
|
.idea/**/usage.statistics.xml
|
||||||
|
.idea/**/dictionaries
|
||||||
|
.idea/**/shelf
|
||||||
|
|
||||||
|
# AWS User-specific
|
||||||
|
.idea/**/aws.xml
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
.idea/**/contentModel.xml
|
||||||
|
|
||||||
|
# Sensitive or high-churn files
|
||||||
|
.idea/**/dataSources/
|
||||||
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
.idea/**/dbnavigator.xml
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# File-based project format
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Python #
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
*.whl
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
.pytest_cache/
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
.hypothesis/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# celery
|
||||||
|
celerybeat-schedule.*
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
|
||||||
|
# Sublime Text #
|
||||||
|
*.tmlanguage.cache
|
||||||
|
*.tmPreferences.cache
|
||||||
|
*.stTheme.cache
|
||||||
|
*.sublime-workspace
|
||||||
|
*.sublime-project
|
||||||
|
|
||||||
|
# sftp configuration file
|
||||||
|
sftp-config.json
|
||||||
|
|
||||||
|
# Package control specific files Package
|
||||||
|
Control.last-run
|
||||||
|
Control.ca-list
|
||||||
|
Control.ca-bundle
|
||||||
|
Control.system-ca-bundle
|
||||||
|
GitHub.sublime-settings
|
||||||
|
|
||||||
|
# Visual Studio Code #
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.history
|
||||||
60
README.md
Normal file
60
README.md
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
1. Start Program
|
||||||
|
-Authentication screen
|
||||||
|
-User authenticates
|
||||||
|
-(system) gives authorization to different capabilities of the program based on role)
|
||||||
|
2. Display Welcome Message and Options Menu
|
||||||
|
- Option 1: Create New Project
|
||||||
|
- Define project
|
||||||
|
- Define\add-existing roles in addition to project initiator role if admin (not shown if not)
|
||||||
|
- Assign project manager(s) user(s) if PMO admin
|
||||||
|
- (system) if not admin create a signal for PMO Admins task card for assignment of a project manager
|
||||||
|
- Option 2: Load Existing Project if authorized
|
||||||
|
- Request access to an existing project
|
||||||
|
- (system) create a signal for project manager(s) request access task card
|
||||||
|
- Option 3: Exit Program
|
||||||
|
3. If Option 1 selected:
|
||||||
|
3.1. Prompt user to choose project methodology template
|
||||||
|
- If "PMO Admin" show button for project methodology web application
|
||||||
|
- Display list of available templates
|
||||||
|
- User selects a template
|
||||||
|
3.2. Create new project based on selected template
|
||||||
|
- Initialize project with cards representing tasks from the template
|
||||||
|
- Display project dashboard
|
||||||
|
- Allow user to perform actions on project (e.g., add, edit, delete tasks)
|
||||||
|
4. If Option 2 selected:
|
||||||
|
4.1. Prompt user to load existing project file
|
||||||
|
- User provides file path
|
||||||
|
- Load project from file
|
||||||
|
4.2. Display project dashboard
|
||||||
|
- Allow user to perform actions on project (e.g., add, edit, delete tasks)
|
||||||
|
5. Project Dashboard Options:
|
||||||
|
- Option A: View Project Overview (summary of tasks, progress, etc.)
|
||||||
|
- Option B: Manage Cards in infinite self-organizing canvas as frontend (react)
|
||||||
|
- Option B1: Add New Card (api to backend)
|
||||||
|
- Option B2: Edit Card (modify details, update status, etc. - api to backend)
|
||||||
|
- Option B3: Delete Card (api to backend)
|
||||||
|
- Option B4: Split Card into Subtasks (api to backend)
|
||||||
|
- Option B5: Change Card relations (api to backend)
|
||||||
|
- Option C: Import Cards from Another Project
|
||||||
|
- User selects project file to import cards from ( then turn it to a list of cards to be created through api to backend)
|
||||||
|
- Merge imported cards into current project ( execute insert cards through api to backend)
|
||||||
|
- Option D: Export Cards to Another Project
|
||||||
|
- User selects project file to export cards to
|
||||||
|
- Export selected cards to specified project file
|
||||||
|
- Option E: Save Project
|
||||||
|
- Save current project state to file
|
||||||
|
- Option F: Exit to Main Menu
|
||||||
|
6. Repeat steps 3-5 until user chooses to exit the program
|
||||||
|
7. Display Farewell Message
|
||||||
|
8. End Program
|
||||||
|
|
||||||
|
Existing Roles
|
||||||
|
"Application Admin" - Install and configuration of the application
|
||||||
|
"Application Designer" - Application customization
|
||||||
|
"Database Admin" - Links and manages backend databases\schemas
|
||||||
|
"PMO Admin" - Policy and methodology management
|
||||||
|
"Program Manager" - Business value reporting and projects monitoring
|
||||||
|
"Project Manager" - Budget, scope, communication, control, reporting management
|
||||||
|
"Project Coordinator" - Resource and task management
|
||||||
|
"Project User" - Task management
|
||||||
|
"Project initiator" - Most basic role that creates a project, defines business value statement, provides high level scope, provides high level budget, provides expected start and end dates for the project.
|
||||||
0
__init__.py
Normal file
0
__init__.py
Normal file
16
asgi.py
Normal file
16
asgi.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
"""
|
||||||
|
ASGI config for p00001 project.
|
||||||
|
|
||||||
|
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from django.core.asgi import get_asgi_application
|
||||||
|
|
||||||
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'p00001.settings')
|
||||||
|
|
||||||
|
application = get_asgi_application()
|
||||||
135
settings.py
Normal file
135
settings.py
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
"""
|
||||||
|
Django settings for p00001 project.
|
||||||
|
|
||||||
|
Generated by 'django-admin startproject' using Django 5.0.4.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/5.0/topics/settings/
|
||||||
|
|
||||||
|
For the full list of settings and their values, see
|
||||||
|
https://docs.djangoproject.com/en/5.0/ref/settings/
|
||||||
|
"""
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
|
||||||
|
# Quick-start development settings - unsuitable for production
|
||||||
|
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
||||||
|
|
||||||
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
|
SECRET_KEY = 'django-insecure-ipo62&72a-0)=d^4t)@#%1e815i(h89q$@d__p+*#d-ntx*u5p'
|
||||||
|
|
||||||
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
|
DEBUG = True
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = []
|
||||||
|
|
||||||
|
|
||||||
|
# Application definition
|
||||||
|
|
||||||
|
INSTALLED_APPS = [
|
||||||
|
'p00001.wbsboard',
|
||||||
|
'django.contrib.admin',
|
||||||
|
'django.contrib.auth',
|
||||||
|
'django.contrib.contenttypes',
|
||||||
|
'django.contrib.sessions',
|
||||||
|
'django.contrib.messages',
|
||||||
|
'django.contrib.staticfiles',
|
||||||
|
]
|
||||||
|
|
||||||
|
MIDDLEWARE = [
|
||||||
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
]
|
||||||
|
|
||||||
|
ROOT_URLCONF = 'p00001.urls'
|
||||||
|
|
||||||
|
TEMPLATES = [
|
||||||
|
{
|
||||||
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
|
'DIRS': [],
|
||||||
|
'APP_DIRS': True,
|
||||||
|
'OPTIONS': {
|
||||||
|
'context_processors': [
|
||||||
|
'django.template.context_processors.debug',
|
||||||
|
'django.template.context_processors.request',
|
||||||
|
'django.contrib.auth.context_processors.auth',
|
||||||
|
'django.contrib.messages.context_processors.messages',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
WSGI_APPLICATION = 'p00001.wsgi.application'
|
||||||
|
|
||||||
|
|
||||||
|
# Database
|
||||||
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
|
||||||
|
|
||||||
|
#DATABASES = {
|
||||||
|
# 'default': {
|
||||||
|
# 'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
# 'NAME': BASE_DIR / 'db.sqlite3',
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||||
|
'NAME': 'p00001',
|
||||||
|
'USER': 'p00001user',
|
||||||
|
'PASSWORD': 'ExpressDelivery.123',
|
||||||
|
'HOST': 'localhost',
|
||||||
|
'PORT': '5432',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Password validation
|
||||||
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# Internationalization
|
||||||
|
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
||||||
|
|
||||||
|
LANGUAGE_CODE = 'en-us'
|
||||||
|
|
||||||
|
TIME_ZONE = 'UTC'
|
||||||
|
|
||||||
|
USE_I18N = True
|
||||||
|
|
||||||
|
USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
|
# Static files (CSS, JavaScript, Images)
|
||||||
|
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
||||||
|
|
||||||
|
STATIC_URL = 'static/'
|
||||||
|
|
||||||
|
# Default primary key field type
|
||||||
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
||||||
|
|
||||||
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
0
task_card/__init__.py
Normal file
0
task_card/__init__.py
Normal file
3
task_card/admin.py
Normal file
3
task_card/admin.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
6
task_card/apps.py
Normal file
6
task_card/apps.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class TaskCardConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'task_card'
|
||||||
26
task_card/models.py
Normal file
26
task_card/models.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
|
class Task_Id(models.Model):
|
||||||
|
taskId = models.AutoField(primary_key=True, unique=True)
|
||||||
|
|
||||||
|
class Task_Name(models.Model):
|
||||||
|
name = models.CharField(max_length=100)
|
||||||
|
|
||||||
|
class Task_Start_Date(models.Model):
|
||||||
|
taskStartDate = models.DateField(auto_now=False, auto_now_add=False, attributes)
|
||||||
|
|
||||||
|
class Task_End_Date(models.Model):
|
||||||
|
taskStartDate = models.DateField(auto_now=False, auto_now_add=False, attributes)
|
||||||
|
|
||||||
|
class Task_Status(models.Model):
|
||||||
|
CHOICES = [
|
||||||
|
('choice1', 'initiated'),
|
||||||
|
('choice2', 'started'),
|
||||||
|
('choice3', 'stalled'),
|
||||||
|
('choice4', 'parked'),
|
||||||
|
('choice5', 'abandonned'),
|
||||||
|
('choice6', 'completed'),
|
||||||
|
]
|
||||||
|
|
||||||
|
selected_word = models.CharField(max_length=50, choices=CHOICES)
|
||||||
3
task_card/tests.py
Normal file
3
task_card/tests.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
22
task_card/urls.py
Normal file
22
task_card/urls.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
"""
|
||||||
|
URL configuration for p00001 project.
|
||||||
|
|
||||||
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
|
https://docs.djangoproject.com/en/5.0/topics/http/urls/
|
||||||
|
Examples:
|
||||||
|
Function views
|
||||||
|
1. Add an import: from my_app import views
|
||||||
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||||
|
Class-based views
|
||||||
|
1. Add an import: from other_app.views import Home
|
||||||
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||||
|
Including another URLconf
|
||||||
|
1. Import the include() function: from django.urls import include, path
|
||||||
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
|
"""
|
||||||
|
from django.urls import path
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path("", views.index, name="index"),
|
||||||
|
]
|
||||||
4
task_card/views.py
Normal file
4
task_card/views.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
from django.http import HttpResponse
|
||||||
|
# Create your views here.
|
||||||
|
def index(request):
|
||||||
|
return HttpResponse("You are at task card module")
|
||||||
28
urls.py
Normal file
28
urls.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
"""
|
||||||
|
URL configuration for p00001 project.
|
||||||
|
|
||||||
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
|
https://docs.djangoproject.com/en/5.0/topics/http/urls/
|
||||||
|
Examples:
|
||||||
|
Function views
|
||||||
|
1. Add an import: from my_app import views
|
||||||
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||||
|
Class-based views
|
||||||
|
1. Add an import: from other_app.views import Home
|
||||||
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||||
|
Including another URLconf
|
||||||
|
1. Import the include() function: from django.urls import include, path
|
||||||
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
|
"""
|
||||||
|
from django.contrib import admin
|
||||||
|
from django.urls import include, path
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path( '', include('p00001.wbsboard.urls')),
|
||||||
|
path('wbsboard/', include('p00001.wbsboard.urls')),
|
||||||
|
path('task_card/', include('p00001.task_card.urls')),
|
||||||
|
path('admin/', admin.site.urls),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
0
wbsboard/__init__.py
Normal file
0
wbsboard/__init__.py
Normal file
3
wbsboard/admin.py
Normal file
3
wbsboard/admin.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
6
wbsboard/apps.py
Normal file
6
wbsboard/apps.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class WbsboardConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'p00001.wbsboard'
|
||||||
41
wbsboard/migrations/0001_initial.py
Normal file
41
wbsboard/migrations/0001_initial.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# Generated by Django 5.0.4 on 2024-05-02 09:14
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='WBSBoard',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('name', models.CharField(max_length=100)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Task_List',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('title', models.CharField(max_length=100)),
|
||||||
|
('order', models.IntegerField(default=0)),
|
||||||
|
('wbsboard', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_lists', to='wbsboard.wbsboard')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Task_Card',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('title', models.CharField(max_length=100)),
|
||||||
|
('description', models.TextField(blank=True)),
|
||||||
|
('order', models.IntegerField(default=0)),
|
||||||
|
('task_list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='task_cards', to='wbsboard.wbsboard')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
0
wbsboard/migrations/__init__.py
Normal file
0
wbsboard/migrations/__init__.py
Normal file
16
wbsboard/models.py
Normal file
16
wbsboard/models.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
class WBSBoard(models.Model):
|
||||||
|
name = models.CharField(max_length=100)
|
||||||
|
|
||||||
|
class Task_List(models.Model):
|
||||||
|
wbsboard = models.ForeignKey(WBSBoard, related_name='task_lists', on_delete=models.CASCADE)
|
||||||
|
title = models.CharField(max_length=100)
|
||||||
|
order = models.IntegerField(default=0)
|
||||||
|
|
||||||
|
class Task_Card(models.Model):
|
||||||
|
task_list = models.ForeignKey(WBSBoard, related_name='task_cards', on_delete=models.CASCADE)
|
||||||
|
title = models.CharField(max_length=100)
|
||||||
|
description = models.TextField(blank=True)
|
||||||
|
order = models.IntegerField(default=0)
|
||||||
|
|
||||||
94
wbsboard/templates/canvasboard.html
Normal file
94
wbsboard/templates/canvasboard.html
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Infinite Canvas with Cards</title>
|
||||||
|
<style>
|
||||||
|
canvas {
|
||||||
|
border: 1px solid #000;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<canvas id="canvas" width="1900" height="1200"></canvas>
|
||||||
|
<script>
|
||||||
|
// Simulated temporary NoSQL database
|
||||||
|
const temporaryDB = {
|
||||||
|
cards: [
|
||||||
|
{ id: 1, text: "Card 1", x: 50, y: 50 }, // Initialize position for Card 1
|
||||||
|
{ id: 2, text: "Card 2", x: 200, y: 100 }, // Initialize position for Card 2
|
||||||
|
{ id: 3, text: "Card 3", x: 350, y: 150 } // Initialize position for Card 3
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
// Simulated central NoSQL database
|
||||||
|
const centralDB = {
|
||||||
|
cards: []
|
||||||
|
};
|
||||||
|
|
||||||
|
// Function to draw cards on canvas
|
||||||
|
function drawCards() {
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
|
// temporaryDB.cards.forEach(card => {
|
||||||
|
// ctx.fillStyle = "#fff";
|
||||||
|
// ctx.fillRect(card.x, card.y, 100, 50);
|
||||||
|
// ctx.strokeRect(card.x, card.y, 100, 50);
|
||||||
|
// ctx.fillStyle = "#000";
|
||||||
|
// ctx.fillText(card.text, card.x + 10, card.y + 30);
|
||||||
|
// });
|
||||||
|
{% for task_card in task_cards %}
|
||||||
|
<li>
|
||||||
|
ctx.fillStyle = "##ff";
|
||||||
|
ctx.fillRect(card.x, card.y, 100, 50);
|
||||||
|
ctx.strokeRect(card.x, card.y, 100, 50);
|
||||||
|
ctx.fillStyle = "#000";
|
||||||
|
ctx.fillText({{ task_card.text }});
|
||||||
|
</li>
|
||||||
|
{# Access the 'text' field of the TaskCard model instance #}
|
||||||
|
{% endfor %}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Function to handle card dragging
|
||||||
|
function dragCard(e) {
|
||||||
|
const rect = canvas.getBoundingClientRect();
|
||||||
|
const mouseX = e.clientX - rect.left;
|
||||||
|
const mouseY = e.clientY - rect.top;
|
||||||
|
|
||||||
|
temporaryDB.cards.forEach(card => {
|
||||||
|
if (mouseX > card.x && mouseX < card.x + 100 &&
|
||||||
|
mouseY > card.y && mouseY < card.y + 50) {
|
||||||
|
card.x = mouseX - 50;
|
||||||
|
card.y = mouseY - 25;
|
||||||
|
drawCards();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to commit changes to central database
|
||||||
|
function commitChanges() {
|
||||||
|
centralDB.cards = temporaryDB.cards;
|
||||||
|
console.log("Changes committed to central database:", centralDB.cards);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize canvas and draw cards
|
||||||
|
const canvas = document.getElementById('canvas');
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
drawCards();
|
||||||
|
|
||||||
|
// Event listener for card dragging
|
||||||
|
canvas.addEventListener('mousedown', (e) => {
|
||||||
|
canvas.addEventListener('mousemove', dragCard);
|
||||||
|
});
|
||||||
|
|
||||||
|
canvas.addEventListener('mouseup', () => {
|
||||||
|
canvas.removeEventListener('mousemove', dragCard);
|
||||||
|
commitChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
28
wbsboard/templates/wbsboard.html
Normal file
28
wbsboard/templates/wbsboard.html
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
!<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WBSBoard</title>
|
||||||
|
<!-- Include CSS/JS for styling and interactivity -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="wbsboard-container">
|
||||||
|
{% for wbsboard in wbsboards %}
|
||||||
|
<div class="wbsboard">
|
||||||
|
<h2>{{ wbsboard.name }}</h2>
|
||||||
|
<div class="task_lists">
|
||||||
|
{% for lst in wbsboard.task_lists.all %}
|
||||||
|
<div class="task_list">
|
||||||
|
<h3>{{ lst.title }}</h3>
|
||||||
|
<ul class="task_cards">
|
||||||
|
{% for task_card in lst.cards.all %}
|
||||||
|
<li>{{ task_card.title }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
3
wbsboard/tests.py
Normal file
3
wbsboard/tests.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
30
wbsboard/urls.py
Normal file
30
wbsboard/urls.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
"""
|
||||||
|
URL configuration for p00001 project.
|
||||||
|
|
||||||
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
|
https://docs.djangoproject.com/en/5.0/topics/http/urls/
|
||||||
|
Examples:
|
||||||
|
Function views
|
||||||
|
1. Add an import: from my_app import views
|
||||||
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||||
|
Class-based views
|
||||||
|
1. Add an import: from other_app.views import Home
|
||||||
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||||
|
Including another URLconf
|
||||||
|
1. Import the include() function: from django.urls import include, path
|
||||||
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
|
"""
|
||||||
|
from django.urls import path
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path("", views.index, name="index"),
|
||||||
|
]
|
||||||
|
|
||||||
|
from django.urls import path
|
||||||
|
from .views import task_card_list
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('task-cards/', task_card_list, name='task_card_list'),
|
||||||
|
# Other URL patterns
|
||||||
|
]
|
||||||
21
wbsboard/views.py
Normal file
21
wbsboard/views.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
from .models import WBSBoard
|
||||||
|
from django.http import HttpResponse
|
||||||
|
from django.template import loader
|
||||||
|
from models importg task_card
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
template = loader.get_template('canvasboard.html')
|
||||||
|
return HttpResponse(template.render())
|
||||||
|
|
||||||
|
|
||||||
|
def wbsboard(request):
|
||||||
|
wbsboard = WBSBoard.objects.all()
|
||||||
|
return render(request, 'wbsboard/wbsboard.html', {'wbsboard': wbsboard})
|
||||||
|
|
||||||
|
|
||||||
|
from django.shortcuts import render
|
||||||
|
from .models import TaskCard
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
16
wsgi.py
Normal file
16
wsgi.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
"""
|
||||||
|
WSGI config for p00001 project.
|
||||||
|
|
||||||
|
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'p00001.settings')
|
||||||
|
|
||||||
|
application = get_wsgi_application()
|
||||||
Loading…
x
Reference in New Issue
Block a user