1/2/26 V.4
This commit is contained in:
parent
fa77b3759c
commit
d289010e28
Binary file not shown.
Binary file not shown.
10
core/templates/core/completed_projects.html
Normal file
10
core/templates/core/completed_projects.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Completed Projects{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">Completed Projects</h1>
|
||||||
|
<p>This page will contain the completed projects.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
10
core/templates/core/daily_logs.html
Normal file
10
core/templates/core/daily_logs.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Daily Logs{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">Daily Logs</h1>
|
||||||
|
<p>This page will contain the daily logs.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
10
core/templates/core/documents.html
Normal file
10
core/templates/core/documents.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Documents{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">Documents</h1>
|
||||||
|
<p>This page will contain the documents.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
10
core/templates/core/equipment.html
Normal file
10
core/templates/core/equipment.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Equipment{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">Equipment</h1>
|
||||||
|
<p>This page will contain the equipment.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
10
core/templates/core/incidents.html
Normal file
10
core/templates/core/incidents.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Incidents{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">Incidents</h1>
|
||||||
|
<p>This page will contain the incidents.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@ -47,56 +47,68 @@
|
|||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<p class="px-6 text-xs text-gray-500 uppercase tracking-wider">Menu</p>
|
<p class="px-6 text-xs text-gray-500 uppercase tracking-wider">Menu</p>
|
||||||
<nav class="px-4 py-2 space-y-1">
|
<nav class="px-4 py-2 space-y-1">
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-gray-200 rounded-lg">
|
<a href="{% url 'index' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-gray-200 rounded-lg">
|
||||||
🏠 Dashboard
|
🏠 Dashboard
|
||||||
</a>
|
</a>
|
||||||
|
{% if 'Manager' in user_groups or 'Admin' in user_groups %}
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
📊 Reports
|
📊 Reports
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
📅 Calendar
|
📅 Calendar
|
||||||
</a>
|
</a>
|
||||||
|
{% if 'Manager' in user_groups or 'Admin' in user_groups %}
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
👥 Teams
|
👥 Teams
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
</nav>
|
</nav>
|
||||||
<p class="px-6 mt-4 text-xs text-gray-500 uppercase tracking-wider">Daily Operations</p>
|
<hr class="mx-6 my-4 border-gray-200">
|
||||||
|
<p class="px-6 text-xs text-gray-500 uppercase tracking-wider">Daily Operations</p>
|
||||||
<nav class="px-4 py-2 space-y-1">
|
<nav class="px-4 py-2 space-y-1">
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="{% url 'daily_logs' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
📝 Daily Logs
|
📝 Daily Logs
|
||||||
</a>
|
</a>
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="{% url 'safety_meetings' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
🛡️ Safety Meetings
|
🛡️ Safety Meetings
|
||||||
</a>
|
</a>
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="/incidents" class="sidebar-link flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
🚨 Incidents
|
<span>🚨 Incidents</span>
|
||||||
|
<span class="ml-auto inline-block py-0.5 px-2 text-xs font-semibold text-white bg-red-500 rounded-full">2</span>
|
||||||
</a>
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
<p class="px-6 mt-4 text-xs text-gray-500 uppercase tracking-wider">Compliance</p>
|
{% if 'Manager' in user_groups or 'Admin' in user_groups %}
|
||||||
|
<hr class="mx-6 my-4 border-gray-200">
|
||||||
|
<p class="px-6 text-xs text-gray-500 uppercase tracking-wider">Compliance</p>
|
||||||
<nav class="px-4 py-2 space-y-1">
|
<nav class="px-4 py-2 space-y-1">
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="/documents" class="sidebar-link flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
📄 Documents
|
<span>📄 Documents</span>
|
||||||
|
<span class="ml-auto inline-block py-0.5 px-2 text-xs font-semibold text-white bg-orange-500 rounded-full">7</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="{% url 'subcontractors' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
👷 Subcontractors
|
👷 Subcontractors
|
||||||
</a>
|
</a>
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="{% url 'equipment' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
🔧 Equipment
|
🔧 Equipment
|
||||||
</a>
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
<p class="px-6 mt-4 text-xs text-gray-500 uppercase tracking-wider">Projects</p>
|
<hr class="mx-6 my-4 border-gray-200">
|
||||||
|
<p class="px-6 text-xs text-gray-500 uppercase tracking-wider">Projects</p>
|
||||||
<nav class="px-4 py-2 space-y-1">
|
<nav class="px-4 py-2 space-y-1">
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="{% url 'ongoing_projects' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
🟦 Ongoing
|
🟦 Ongoing
|
||||||
</a>
|
</a>
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="{% url 'completed_projects' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
✅ Completed
|
✅ Completed
|
||||||
</a>
|
</a>
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="{% url 'on_hold_projects' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
⏸️ On Hold
|
⏸️ On Hold
|
||||||
</a>
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% if 'Manager' in user_groups or 'Admin' in user_groups %}
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
<div class="p-4 bg-gray-100 rounded-lg text-center">
|
<div class="p-4 bg-gray-100 rounded-lg text-center">
|
||||||
<p class="text-sm font-medium">Ready to launch a new project?</p>
|
<p class="text-sm font-medium">Ready to launch a new project?</p>
|
||||||
@ -104,11 +116,14 @@
|
|||||||
<button class="mt-3 w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-semibold">Add New Project</button>
|
<button class="mt-3 w-full bg-blue-600 text-white py-2 rounded-lg text-sm font-semibold">Add New Project</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="border-t border-gray-200">
|
<div class="border-t border-gray-200">
|
||||||
<nav class="px-4 py-4 space-y-1">
|
<nav class="px-4 py-4 space-y-1">
|
||||||
|
{% if 'Manager' in user_groups or 'Admin' in user_groups %}
|
||||||
<a href="{% url 'settings' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="{% url 'settings' %}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
⚙️ Settings
|
⚙️ Settings
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
<a href="#" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-200 rounded-lg">
|
||||||
🛟 Help Center
|
🛟 Help Center
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
10
core/templates/core/on_hold_projects.html
Normal file
10
core/templates/core/on_hold_projects.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}On Hold Projects{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">On Hold Projects</h1>
|
||||||
|
<p>This page will contain the on hold projects.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
10
core/templates/core/ongoing_projects.html
Normal file
10
core/templates/core/ongoing_projects.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Ongoing Projects{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">Ongoing Projects</h1>
|
||||||
|
<p>This page will contain the ongoing projects.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
10
core/templates/core/safety_meetings.html
Normal file
10
core/templates/core/safety_meetings.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Safety Meetings{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">Safety Meetings</h1>
|
||||||
|
<p>This page will contain the safety meetings.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
10
core/templates/core/subcontractors.html
Normal file
10
core/templates/core/subcontractors.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Subcontractors{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="p-6">
|
||||||
|
<h1 class="text-2xl font-semibold">Subcontractors</h1>
|
||||||
|
<p>This page will contain the subcontractors.</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
24
core/urls.py
24
core/urls.py
@ -1,9 +1,31 @@
|
|||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from .views import index, search, settings
|
from .views import (
|
||||||
|
index,
|
||||||
|
search,
|
||||||
|
settings,
|
||||||
|
daily_logs,
|
||||||
|
safety_meetings,
|
||||||
|
incidents,
|
||||||
|
documents,
|
||||||
|
subcontractors,
|
||||||
|
equipment,
|
||||||
|
ongoing_projects,
|
||||||
|
completed_projects,
|
||||||
|
on_hold_projects,
|
||||||
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", index, name="index"),
|
path("", index, name="index"),
|
||||||
path("search", search, name="search"),
|
path("search", search, name="search"),
|
||||||
path("settings", settings, name="settings"),
|
path("settings", settings, name="settings"),
|
||||||
|
path("daily-logs", daily_logs, name="daily_logs"),
|
||||||
|
path("safety-meetings", safety_meetings, name="safety_meetings"),
|
||||||
|
path("incidents", incidents, name="incidents"),
|
||||||
|
path("documents", documents, name="documents"),
|
||||||
|
path("subcontractors", subcontractors, name="subcontractors"),
|
||||||
|
path("equipment", equipment, name="equipment"),
|
||||||
|
path("projects/ongoing", ongoing_projects, name="ongoing_projects"),
|
||||||
|
path("projects/completed", completed_projects, name="completed_projects"),
|
||||||
|
path("projects/on-hold", on_hold_projects, name="on_hold_projects"),
|
||||||
]
|
]
|
||||||
|
|||||||
@ -3,12 +3,19 @@ from ai.local_ai_api import LocalAIApi
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
|
user_groups = []
|
||||||
|
if request.user.is_authenticated:
|
||||||
|
user_groups = [group.name for group in request.user.groups.all()]
|
||||||
context = {
|
context = {
|
||||||
"project_name": "ComplianceShield",
|
"project_name": "ComplianceShield",
|
||||||
|
"user_groups": user_groups,
|
||||||
}
|
}
|
||||||
return render(request, "core/index.html", context)
|
return render(request, "core/index.html", context)
|
||||||
|
|
||||||
def search(request):
|
def search(request):
|
||||||
|
user_groups = []
|
||||||
|
if request.user.is_authenticated:
|
||||||
|
user_groups = [group.name for group in request.user.groups.all()]
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
query = request.POST.get("query", "")
|
query = request.POST.get("query", "")
|
||||||
if query:
|
if query:
|
||||||
@ -37,6 +44,7 @@ def search(request):
|
|||||||
context = {
|
context = {
|
||||||
"project_name": "ComplianceShield",
|
"project_name": "ComplianceShield",
|
||||||
"search_results": search_results,
|
"search_results": search_results,
|
||||||
|
"user_groups": user_groups,
|
||||||
}
|
}
|
||||||
return render(request, "core/index.html", context)
|
return render(request, "core/index.html", context)
|
||||||
|
|
||||||
@ -45,5 +53,33 @@ def search(request):
|
|||||||
def settings(request):
|
def settings(request):
|
||||||
context = {
|
context = {
|
||||||
"project_name": "ComplianceShield",
|
"project_name": "ComplianceShield",
|
||||||
|
"user_groups": user_groups,
|
||||||
}
|
}
|
||||||
return render(request, "core/settings.html", context)
|
return render(request, "core/settings.html", context)
|
||||||
|
|
||||||
|
def daily_logs(request):
|
||||||
|
return render(request, "core/daily_logs.html")
|
||||||
|
|
||||||
|
def safety_meetings(request):
|
||||||
|
return render(request, "core/safety_meetings.html")
|
||||||
|
|
||||||
|
def incidents(request):
|
||||||
|
return render(request, "core/incidents.html")
|
||||||
|
|
||||||
|
def documents(request):
|
||||||
|
return render(request, "core/documents.html")
|
||||||
|
|
||||||
|
def subcontractors(request):
|
||||||
|
return render(request, "core/subcontractors.html")
|
||||||
|
|
||||||
|
def equipment(request):
|
||||||
|
return render(request, "core/equipment.html")
|
||||||
|
|
||||||
|
def ongoing_projects(request):
|
||||||
|
return render(request, "core/ongoing_projects.html")
|
||||||
|
|
||||||
|
def completed_projects(request):
|
||||||
|
return render(request, "core/completed_projects.html")
|
||||||
|
|
||||||
|
def on_hold_projects(request):
|
||||||
|
return render(request, "core/on_hold_projects.html")
|
||||||
|
|||||||
@ -56,3 +56,26 @@
|
|||||||
.search-bar {
|
.search-bar {
|
||||||
border: 1px solid #000 !important;
|
border: 1px solid #000 !important;
|
||||||
}
|
}
|
||||||
|
.sidebar-section-header { font-size: 11px; font-weight: 700; color: #606060; text-transform: uppercase; letter-spacing: 0.5px; margin: 24px 0 12px 0; padding-left: 12px; }
|
||||||
|
.sidebar-link.active { background: rgba(255, 255, 255, 0.08); border-left: 3px solid #c9a55a; /* Gold accent */ color: #ffffff; }
|
||||||
|
.badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: .25em .6em;
|
||||||
|
font-size: 75%;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
vertical-align: baseline;
|
||||||
|
border-radius: .375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.red {
|
||||||
|
background-color: #dc3545;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.orange {
|
||||||
|
background-color: #fd7e14;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,3 +56,26 @@
|
|||||||
.search-bar {
|
.search-bar {
|
||||||
border: 1px solid #000 !important;
|
border: 1px solid #000 !important;
|
||||||
}
|
}
|
||||||
|
.sidebar-section-header { font-size: 11px; font-weight: 700; color: #606060; text-transform: uppercase; letter-spacing: 0.5px; margin: 24px 0 12px 0; padding-left: 12px; }
|
||||||
|
.sidebar-link.active { background: rgba(255, 255, 255, 0.08); border-left: 3px solid #c9a55a; /* Gold accent */ color: #ffffff; }
|
||||||
|
.badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: .25em .6em;
|
||||||
|
font-size: 75%;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
vertical-align: baseline;
|
||||||
|
border-radius: .375rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.red {
|
||||||
|
background-color: #dc3545;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.orange {
|
||||||
|
background-color: #fd7e14;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user