New changes
parent
6a68292b71
commit
d60cd731fe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,32 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
path('status/', views.add_status_modal, name='addstatusmodal'),
|
||||
|
||||
path('customer/', views.add_customer, name='addcustomer'),
|
||||
path('business/', views.add_business, name='addbusiness'),
|
||||
path('businessmodal/', views.add_business_modal, name='addbusinessmodal'),
|
||||
path('staff/', views.add_staff, name='adduser'),
|
||||
path('project/', views.add_project, name='addproject'),
|
||||
path('projectnote/<str:project_id>/', views.add_project_note_modal, name='addprojectnotemodal'),
|
||||
path('file/', views.add_file_modal, name='addfilemodal'),
|
||||
path('credential/', views.add_credential_modal, name='addcredentialmodal'),
|
||||
path('task/', views.add_task, name='addtask'),
|
||||
path('task/<str:project_id>/', views.add_task, name='addprojecttask'),
|
||||
path('task/<str:project_id>/<int:requirement_id>/', views.add_task, name='adduserstorytask'),
|
||||
path('point/<str:task_id>/', views.add_point_modal, name='addpointmodal'),
|
||||
path('epic/<str:project_id>/', views.add_epic, name='addepic'),
|
||||
path('note/', views.add_note_modal, name='addnotemodal'),
|
||||
path('dailyreport/', views.add_daily_report, name='adddailyreport'),
|
||||
path('projecttype/', views.add_projecttype_modal, name='addprojecttypemodal'),
|
||||
path('staffposition/', views.add_staffposition_modal, name='addstaffpositionmodal'),
|
||||
path('businesstype/', views.add_businesstype_modal, name='addbusinesstypemodal'),
|
||||
path('reference/', views.add_reference_modal, name='addreferencemodal'),
|
||||
path('tag/', views.add_tag_modal, name='addtagmodal'),
|
||||
|
||||
|
||||
|
||||
]
|
@ -0,0 +1,626 @@
|
||||
from django.shortcuts import render, redirect, get_object_or_404
|
||||
from osinacore.models import *
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.http import HttpResponse
|
||||
from django.urls import reverse
|
||||
from django.http import HttpResponseRedirect
|
||||
from datetime import date
|
||||
from django.http import JsonResponse
|
||||
|
||||
|
||||
|
||||
def add_status_modal(request, *args, **kwargs):
|
||||
if request.method == 'POST':
|
||||
text = request.POST.get('text')
|
||||
current_datetime = datetime.now()
|
||||
date = datetime.now().date()
|
||||
time = current_datetime.strftime("%I:%M %p")
|
||||
|
||||
try:
|
||||
staff_profile = StaffProfile.objects.get(user=request.user)
|
||||
except StaffProfile.DoesNotExist:
|
||||
# Handle the case where a StaffProfile does not exist for the user
|
||||
staff_profile = None
|
||||
|
||||
status = Status(
|
||||
text=text,
|
||||
staff=staff_profile,
|
||||
date=date,
|
||||
time = time,
|
||||
)
|
||||
status.save()
|
||||
|
||||
# Reload the parent page
|
||||
return HttpResponse('<script>window.top.location.reload();</script>')
|
||||
return render(request, 'add_templates/add-status-modal.html')
|
||||
|
||||
|
||||
|
||||
@login_required
|
||||
def add_customer(request):
|
||||
businesses = Business.objects.all().order_by('-id')
|
||||
references = Reference.objects.all().order_by('-id')
|
||||
business_types = BusinessType.objects.all().order_by('-id')
|
||||
|
||||
if request.method == 'POST':
|
||||
email = request.POST.get('email').lower()
|
||||
first_name = request.POST.get('first_name')
|
||||
last_name = request.POST.get('last_name')
|
||||
business_id = request.POST.get('business')
|
||||
business = get_object_or_404(Business, id=business_id)
|
||||
username = f"{first_name.lower()}{last_name.lower()}"
|
||||
original_username = username
|
||||
counter = 1
|
||||
|
||||
while User.objects.filter(username=username).exists():
|
||||
username = f"{original_username.lower()}{counter}"
|
||||
counter += 1
|
||||
|
||||
user = User.objects.create_user(
|
||||
username=username,
|
||||
email=email,
|
||||
password=request.POST.get('password2')
|
||||
)
|
||||
user.first_name = first_name.lower().capitalize()
|
||||
user.last_name = last_name.lower().capitalize()
|
||||
user.save()
|
||||
|
||||
|
||||
referenceid = request.POST.get('referenceid')
|
||||
reference = get_object_or_404(Reference, id=referenceid)
|
||||
|
||||
CustomerProfile.objects.create(
|
||||
user=user,
|
||||
mobile_number = request.POST.get('mobile_number'),
|
||||
personal_website = request.POST.get('personal_website'),
|
||||
status = request.POST.get('status'),
|
||||
reference = reference,
|
||||
business = business,
|
||||
)
|
||||
return redirect('customers')
|
||||
|
||||
context = {
|
||||
'businesses' : businesses,
|
||||
'references' :references,
|
||||
'business_types' : business_types
|
||||
|
||||
}
|
||||
return render(request, 'add_templates/add-customer.html', context)
|
||||
|
||||
|
||||
|
||||
@login_required
|
||||
def add_business(request):
|
||||
business_types = BusinessType.objects.all().order_by('-id')
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
email= request.POST.get('email')
|
||||
financial_number = request.POST.get('financial_number')
|
||||
phone_number = request.POST.get('phone_number')
|
||||
vat = request.POST.get('vat')
|
||||
if vat == 'true':
|
||||
vat = True
|
||||
else:
|
||||
vat = False
|
||||
commercial_registration = request.POST.get('commercial_registration')
|
||||
website = request.POST.get('website')
|
||||
logo = request.FILES.get('logo')
|
||||
|
||||
business_type_id = request.POST.get('type')
|
||||
|
||||
business_type = get_object_or_404(BusinessType, id=business_type_id)
|
||||
|
||||
business = Business(
|
||||
name = name,
|
||||
email = email,
|
||||
financial_number = financial_number,
|
||||
vat = vat,
|
||||
commercial_registration = commercial_registration,
|
||||
website = website,
|
||||
type=business_type,
|
||||
logo = logo,
|
||||
phone_number = phone_number,
|
||||
)
|
||||
business.save()
|
||||
|
||||
return redirect('businesses')
|
||||
|
||||
context = {
|
||||
'business_types': business_types,
|
||||
}
|
||||
|
||||
return render(request, 'add_templates/add-business.html', context)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@login_required
|
||||
def add_business_modal(request):
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
email = request.POST.get('email')
|
||||
financial_number = request.POST.get('financial_number')
|
||||
phone_number = request.POST.get('phone_number')
|
||||
vat = request.POST.get('vat')
|
||||
if vat == 'true':
|
||||
vat = True
|
||||
else:
|
||||
vat = False
|
||||
commercial_registration = request.POST.get('commercial_registration')
|
||||
website = request.POST.get('website')
|
||||
logo = request.FILES.get('logo')
|
||||
|
||||
business_type_id = request.POST.get('type')
|
||||
business_type = get_object_or_404(BusinessType, id=business_type_id)
|
||||
|
||||
business = Business(
|
||||
name=name,
|
||||
email=email,
|
||||
financial_number=financial_number,
|
||||
vat=vat,
|
||||
commercial_registration=commercial_registration,
|
||||
website=website,
|
||||
type=business_type,
|
||||
logo=logo,
|
||||
phone_number=phone_number,
|
||||
)
|
||||
business.save()
|
||||
|
||||
|
||||
businesses = Business.objects.all()
|
||||
|
||||
updated_options = [{'id': business.id, 'name': business.name} for business in businesses]
|
||||
|
||||
|
||||
return JsonResponse(updated_options, safe=False)
|
||||
|
||||
|
||||
return render(request, 'add_templates/addbusiness-modal.html')
|
||||
|
||||
|
||||
@login_required
|
||||
def add_staff(request):
|
||||
staffpositions = StaffPosition.objects.all().order_by('-id')
|
||||
if request.method == 'POST':
|
||||
email = request.POST.get('email').lower()
|
||||
first_name = request.POST.get('first_name')
|
||||
last_name = request.POST.get('last_name')
|
||||
username = f"{first_name.lower()}{last_name.lower()}"
|
||||
original_username = username
|
||||
counter = 1
|
||||
|
||||
while User.objects.filter(username=username).exists():
|
||||
username = f"{original_username.lower()}{counter}"
|
||||
counter += 1
|
||||
|
||||
user = User.objects.create_user(
|
||||
username=username,
|
||||
email=email,
|
||||
password= request.POST.get('password2')
|
||||
)
|
||||
user.first_name = first_name.lower().capitalize()
|
||||
user.last_name = last_name.lower().capitalize()
|
||||
user.save()
|
||||
|
||||
staff_positionid = request.POST.get('staff_position')
|
||||
staff_position = get_object_or_404(StaffPosition, id=staff_positionid)
|
||||
|
||||
StaffProfile.objects.create(
|
||||
user=user,
|
||||
image = request.FILES.get('image'),
|
||||
mobile_number = request.POST.get('mobile_number'),
|
||||
active = request.POST.get('active'),
|
||||
intern = request.POST.get('intern'),
|
||||
staff_position = staff_position,
|
||||
)
|
||||
return redirect('users')
|
||||
|
||||
context = {
|
||||
'staffpositions' : staffpositions,
|
||||
}
|
||||
return render(request, 'add_templates/add-staff.html', context)
|
||||
|
||||
|
||||
|
||||
@login_required
|
||||
def add_project(request):
|
||||
staffs = StaffProfile.objects.all().order_by('-id')
|
||||
project_types = ProjectType.objects.all()
|
||||
customers = CustomerProfile.objects.all().order_by('-id')
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
|
||||
customerid = request.POST.get('customer')
|
||||
customer = get_object_or_404(CustomerProfile, id=customerid)
|
||||
|
||||
managerid = request.POST.get('manager')
|
||||
manager = get_object_or_404(StaffProfile, id=managerid)
|
||||
|
||||
|
||||
project_type = request.POST.getlist('project_type')
|
||||
details = request.POST.get('details')
|
||||
membersids = request.POST.getlist('members')
|
||||
status = request.POST.get('status')
|
||||
start_date = request.POST.get('start_date')
|
||||
end_date = request.POST.get('end_date')
|
||||
|
||||
|
||||
project = Project(
|
||||
name=name,
|
||||
customer=customer,
|
||||
manager=manager,
|
||||
details=details,
|
||||
status=status,
|
||||
start_date=start_date,
|
||||
end_date=end_date,
|
||||
)
|
||||
project.save()
|
||||
|
||||
project.project_type.set(project_type)
|
||||
project.members.set(membersids)
|
||||
|
||||
requirements = request.POST.getlist('requirements')
|
||||
for requirement_content in requirements:
|
||||
if requirement_content:
|
||||
requirement = ProjectRequirement(content=requirement_content, project=project, added_by=request.user)
|
||||
requirement.save()
|
||||
|
||||
return redirect('my-projects')
|
||||
|
||||
|
||||
context = {
|
||||
'staffs' : staffs,
|
||||
'project_types' : project_types,
|
||||
'customers' : customers,
|
||||
|
||||
}
|
||||
return render(request, 'add_templates/add-project.html', context)
|
||||
|
||||
|
||||
|
||||
|
||||
def add_project_note_modal(request, project_id):
|
||||
project = get_object_or_404(Project, project_id=project_id)
|
||||
if request.method == 'POST':
|
||||
text = request.POST.get('note_text')
|
||||
color = request.POST.get('note_color')
|
||||
user = request.user
|
||||
date = timezone.now()
|
||||
|
||||
note = Note(
|
||||
text=text,
|
||||
color=color,
|
||||
user=user,
|
||||
date=date,
|
||||
project=project,
|
||||
)
|
||||
note.save()
|
||||
|
||||
return HttpResponse('<script>window.top.location.reload();</script>')
|
||||
|
||||
context = {
|
||||
'project' : project
|
||||
}
|
||||
|
||||
return render(request, 'add_templates/add-project-note-modal.html', context)
|
||||
|
||||
|
||||
|
||||
|
||||
def add_file_modal(request, *args, **kwargs):
|
||||
|
||||
context = {
|
||||
|
||||
}
|
||||
return render(request, 'add_templates/add-file-modal.html', context)
|
||||
|
||||
def add_credential_modal(request, *args, **kwargs):
|
||||
context = {
|
||||
|
||||
}
|
||||
return render(request, 'add_templates/add-credentials-modal.html', context)
|
||||
|
||||
|
||||
|
||||
|
||||
@login_required
|
||||
def add_task(request, project_id=None, requirement_id=None):
|
||||
project = None
|
||||
requirement = None
|
||||
epics_of_my_project = None
|
||||
projects = None
|
||||
|
||||
|
||||
if project_id: #Case where user wants to add task from project page(Adding a task for a project)
|
||||
project = get_object_or_404(Project, project_id=project_id)
|
||||
epics_of_my_project = Epic.objects.filter(project=project)
|
||||
if requirement_id:
|
||||
requirement = get_object_or_404(ProjectRequirement, id=requirement_id)
|
||||
|
||||
|
||||
else: #Case where user wants to add task from tasks page(No project specified)
|
||||
projects = Project.objects.all().order_by('-id')
|
||||
|
||||
|
||||
staffs = StaffProfile.objects.all().order_by('-id')
|
||||
|
||||
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
status = request.POST.get('status')
|
||||
extra = request.POST.get('extra')
|
||||
description = request.POST.get('description')
|
||||
start_date = request.POST.get('start_date')
|
||||
end_date = request.POST.get('end_date')
|
||||
|
||||
|
||||
|
||||
if not project_id:
|
||||
project_id = request.POST.get('project')
|
||||
project = get_object_or_404(Project, id=project_id)
|
||||
|
||||
epic_id = request.POST.get('epic')
|
||||
epic = get_object_or_404(Epic, id=epic_id)
|
||||
|
||||
|
||||
assigned_to_id = request.POST.get('assigned_to')
|
||||
assigned_to = get_object_or_404(StaffProfile, id=assigned_to_id)
|
||||
|
||||
task = Task(
|
||||
name=name,
|
||||
status=status,
|
||||
project=project,
|
||||
epic=epic,
|
||||
extra=extra,
|
||||
description=description,
|
||||
start_date=start_date,
|
||||
end_date=end_date,
|
||||
assigned_to = assigned_to,
|
||||
requirement = requirement,
|
||||
|
||||
)
|
||||
|
||||
task.save()
|
||||
|
||||
|
||||
task_details_url = reverse('detailed-task', args=[task.task_id])
|
||||
if requirement:
|
||||
return redirect('detailed-project', project_id=project.project_id)
|
||||
else:
|
||||
return HttpResponseRedirect(task_details_url)
|
||||
|
||||
|
||||
context = {
|
||||
'project':project,
|
||||
'epics_of_my_project' : epics_of_my_project,
|
||||
'staffs' : staffs,
|
||||
'projects' : projects,
|
||||
'requirement' : requirement
|
||||
|
||||
|
||||
}
|
||||
return render(request, 'add_templates/add-task.html', context)
|
||||
|
||||
|
||||
|
||||
|
||||
def add_point_modal(request, task_id):
|
||||
task = get_object_or_404(Task, task_id=task_id)
|
||||
if request.method == 'POST':
|
||||
text = request.POST.get('text')
|
||||
point = Point(
|
||||
text = text,
|
||||
task = task,
|
||||
status='Not Completed'
|
||||
)
|
||||
point.save()
|
||||
|
||||
# Redirect back to the same page
|
||||
return redirect(request.META.get('HTTP_REFERER', ''))
|
||||
|
||||
context = {
|
||||
'task' : task,
|
||||
|
||||
}
|
||||
return render(request, 'add_templates/add-point-modal.html', context)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@login_required
|
||||
def add_epic(request, project_id):
|
||||
project = get_object_or_404(Project, project_id=project_id)
|
||||
if request.method == 'POST':
|
||||
title = request.POST.get('title')
|
||||
status = request.POST.get('status')
|
||||
description = request.POST.get('description')
|
||||
|
||||
|
||||
project_id = request.POST.get('project')
|
||||
project = get_object_or_404(Project, id=project_id)
|
||||
|
||||
|
||||
start_date = request.POST.get('start_date')
|
||||
end_date = request.POST.get('end_date')
|
||||
|
||||
|
||||
epic = Epic(
|
||||
title=title,
|
||||
status=status,
|
||||
project=project,
|
||||
description=description,
|
||||
start_date=start_date,
|
||||
end_date=end_date
|
||||
)
|
||||
|
||||
|
||||
epic.save()
|
||||
|
||||
redirect_url = reverse('detailed-project', args=[project.project_id])
|
||||
return redirect(redirect_url)
|
||||
|
||||
context = {
|
||||
'project' : project,
|
||||
}
|
||||
return render(request, 'add_templates/add-epic.html', context)
|
||||
|
||||
|
||||
|
||||
|
||||
def add_note_modal(request, *args, **kwargs):
|
||||
if request.method == 'POST':
|
||||
text = request.POST.get('note_text')
|
||||
color = request.POST.get('note_color')
|
||||
user = request.user
|
||||
date = timezone.now()
|
||||
|
||||
note = Note(
|
||||
text=text,
|
||||
color=color,
|
||||
user=user,
|
||||
date=date,
|
||||
)
|
||||
note.save()
|
||||
|
||||
# Reload the parent page
|
||||
return HttpResponse('<script>window.top.location.reload();</script>')
|
||||
return render(request, 'add_templates/add-note-modal.html')
|
||||
|
||||
|
||||
|
||||
def add_daily_report(request):
|
||||
user = request.user
|
||||
today = date.today()
|
||||
statuses = Status.objects.filter(staff=user.staffprofile, date=today)
|
||||
if request.method == 'POST':
|
||||
text = request.POST.get('text')
|
||||
current_datetime = datetime.now()
|
||||
date = datetime.now().date()
|
||||
time = current_datetime.strftime("%I:%M %p")
|
||||
try:
|
||||
staff_profile = StaffProfile.objects.get(user=request.user)
|
||||
except StaffProfile.DoesNotExist:
|
||||
# Handle the case where a StaffProfile does not exist for the user
|
||||
staff_profile = None
|
||||
|
||||
|
||||
dailyreport = DailyReport(
|
||||
text = text,
|
||||
date = date,
|
||||
time = time,
|
||||
staff = staff_profile
|
||||
)
|
||||
dailyreport.save()
|
||||
|
||||
|
||||
return redirect('dailyreports')
|
||||
|
||||
context = {
|
||||
'statuses': statuses,
|
||||
|
||||
|
||||
}
|
||||
return render(request, 'add_templates/add-daily-report.html', context)
|
||||
|
||||
|
||||
|
||||
|
||||
def add_projecttype_modal(request, *args, **kwargs):
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
projecttype = ProjectType(
|
||||
name = name,
|
||||
|
||||
)
|
||||
projecttype.save()
|
||||
|
||||
# Reload the parent page
|
||||
return HttpResponse('<script>window.top.location.reload();</script>')
|
||||
return render(request, 'add_templates/add-projecttype-modal.html')
|
||||
|
||||
|
||||
|
||||
def add_staffposition_modal(request):
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
staffposition = StaffPosition(
|
||||
name = name,
|
||||
|
||||
|
||||
)
|
||||
staffposition.save()
|
||||
|
||||
# Reload the parent page
|
||||
return HttpResponse('<script>window.top.location.reload();</script>')
|
||||
return render(request, 'add_templates/add-staffposition-modal.html')
|
||||
|
||||
|
||||
|
||||
def add_businesstype_modal(request, *args, **kwargs):
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
|
||||
|
||||
businesstype = BusinessType(
|
||||
name = name,
|
||||
)
|
||||
businesstype.save()
|
||||
|
||||
|
||||
# Reload the parent page
|
||||
return HttpResponse('<script>window.top.location.reload();</script>')
|
||||
|
||||
return render(request, 'add_templates/add-businesstype-modal.html')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def add_reference_modal(request, *args, **kwargs):
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
date = request.POST.get('date')
|
||||
|
||||
|
||||
reference = Reference(
|
||||
name = name,
|
||||
date = date,
|
||||
)
|
||||
reference.save()
|
||||
|
||||
|
||||
# Reload the parent page
|
||||
return HttpResponse('<script>window.top.location.reload();</script>')
|
||||
return render(request, 'add_templates/add-reference-modal.html')
|
||||
|
||||
|
||||
|
||||
|
||||
def add_tag_modal(request, *args, **kwargs):
|
||||
if request.method == 'POST':
|
||||
name = request.POST.get('name')
|
||||
|
||||
|
||||
tag = Tag(
|
||||
name = name,
|
||||
)
|
||||
tag.save()
|
||||
|
||||
# Reload the parent page
|
||||
return HttpResponse('<script>window.top.location.reload();</script>')
|
||||
return render(request, 'add_templates/add-tag-modal.html')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,41 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="{% url 'addpointmodal' task.task_id %}">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Point</h1>
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<input name="text" type="text" placeholder="Type your point here..."
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4" id="pointInput"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- THE WARNING MESSAGE THAT APPEARS WHEN THE USER CLICKS ON THE ADD BUTTON WITH AN EMPTY INPUT FIELD -->
|
||||
<p class="text-red-500 font-light mt-2" id="AlertPointMessage">
|
||||
|
||||
</p>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4 gap-4">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300"
|
||||
id="addPointsFormButton">Save</button>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,116 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="{% url 'addprojectnotemodal' project.project_id %}">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Note</h1>
|
||||
|
||||
<div class="w-full flex flex-col gap-3 justify-center items-center">
|
||||
<input required name="note_text" type="text" placeholder="Type your note here..."
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4">
|
||||
|
||||
<select required name="project" id=""
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 hidden">
|
||||
<option value="{{project.id}}">{{project.id}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-between items-center flex-wrap mt-4">
|
||||
<div class="color-option w-[40px] h-[40px] rounded-full bg-blue-200 cursor-pointer"
|
||||
style="background-color: #BFDBFF;" id="blue">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="color-option w-[40px] h-[40px] rounded-full bg-pink-200 cursor-pointer"
|
||||
style="background-color: #FBCFE8;" id="pink">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="color-option w-[40px] h-[40px] rounded-full bg-yellow-200 cursor-pointer"
|
||||
style="background-color: #FEEF91;" id="yellow">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="color-option w-[40px] h-[40px] rounded-full bg-green-200 cursor-pointer"
|
||||
style="background-color: #B6FAD0;" id="green">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="color-option w-[40px] h-[40px] rounded-full bg-purple-200 cursor-pointer"
|
||||
style="background-color: #EBD6F9;" id="purple">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="color-option w-[40px] h-[40px] rounded-full bg-red-200 cursor-pointer"
|
||||
style="background-color: #FFCACA;" id="red">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input required name="note_color" type="text"
|
||||
class="w-full border border-gray-300 rounded-md py-1 px-3 outline-none h-[50px] mt-4 hidden"
|
||||
id="hexCodeDisplay">
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// TO GET THE COLOR OF THE DIV
|
||||
const colorOptions = document.querySelectorAll('.color-option');
|
||||
const hexCodeDisplay = document.getElementById('hexCodeDisplay');
|
||||
|
||||
colorOptions.forEach((colorOption) => {
|
||||
colorOption.addEventListener('click', () => {
|
||||
// Remove borders from all color-options
|
||||
colorOptions.forEach((option) => {
|
||||
option.style.border = 'none';
|
||||
});
|
||||
|
||||
// Get the id and background color of the clicked color div
|
||||
const colorId = colorOption.id;
|
||||
const bgColor = colorOption.style.backgroundColor;
|
||||
|
||||
// Convert the RGB color to a hex code (if it's in RGB format)
|
||||
const hexColor = rgbToHex(bgColor);
|
||||
|
||||
// Display the hex code in the input field
|
||||
hexCodeDisplay.value = hexColor;
|
||||
|
||||
// Apply a black border to the selected color-option
|
||||
colorOption.style.border = '3px solid gray';
|
||||
|
||||
console.log(`Selected color ID: ${colorId}`);
|
||||
});
|
||||
});
|
||||
|
||||
// Function to convert RGB color to hex code
|
||||
function rgbToHex(rgb) {
|
||||
const rgbaArray = rgb.match(/\d+/g);
|
||||
const hexArray = rgbaArray.map((value) => {
|
||||
const hex = parseInt(value, 10).toString(16);
|
||||
return hex.length === 1 ? '0' + hex : hex;
|
||||
});
|
||||
return '#' + hexArray.join('');
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-6">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,32 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="{% url 'addtagmodal' %}">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Tag</h1>
|
||||
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<input name="name" type="text" placeholder="Tag Name"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
@ -0,0 +1,32 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="{% url 'adduserstory' project.project_id %}">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add User Story</h1>
|
||||
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<input name="content" type="text" placeholder="User Story"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,39 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<div id="hiddenContent">
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Credential</h1>
|
||||
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<input type="text" placeholder="Account" class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4">
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<input type="text" placeholder="Password" class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4">
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<input type="text" placeholder="Used for" class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4">
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-6">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,86 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<div id="hiddenContent">
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add File</h1>
|
||||
|
||||
<form>
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<input type="text" placeholder="File Name"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4" required>
|
||||
</div>
|
||||
|
||||
<input type="date" id="date" name="date"
|
||||
class="w-full md:w-[300px] p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4"
|
||||
required>
|
||||
|
||||
<div class="inbox-box border border-gray-300 py-1 px-3 w-full rounded-md mt-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<input required name="cv" type="file" id="actual-btn" accept=".pdf,.docx" hidden required />
|
||||
<span id="file-name" class="text-gray-500 text-base focus:outline-none outline-none">Upload
|
||||
Document(s)</span>
|
||||
<label for="actual-btn"
|
||||
class="bg-transparent text-gray-500 border border-white py-2 h-14 cursor-pointer flex items-center"><i
|
||||
class="fa fa-upload"></i></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-6">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300"
|
||||
id="addfileclose">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- <script>
|
||||
const successMessage = document.getElementById('successMessage');
|
||||
const addfileclose = document.getElementById('addfileclose');
|
||||
const form = document.querySelector('form');
|
||||
|
||||
addfileclose.addEventListener("click", () => {
|
||||
if (form.checkValidity()) {
|
||||
successMessage.classList.remove('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
// Add an event listener to prevent the form submission when the Enter key is pressed
|
||||
form.addEventListener("submit", (e) => {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
</script> -->
|
||||
|
||||
<!-- WHEN THE USER CHOOSE A FILE THE NAME OF THE FILE WILL APPEAR IN THE SPAN -->
|
||||
<script>
|
||||
const fileInput = document.getElementById('actual-btn');
|
||||
const fileNameSpan = document.getElementById('file-name');
|
||||
|
||||
fileInput.addEventListener('change', (event) => {
|
||||
const selectedFiles = event.target.files;
|
||||
if (selectedFiles.length > 0) {
|
||||
const fileNames = Array.from(selectedFiles).map(file => file.name).join(', ');
|
||||
fileNameSpan.textContent = fileNames;
|
||||
} else {
|
||||
fileNameSpan.textContent = 'Upload Documents (PDF, docx)';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,33 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<div id="hiddenContent">
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Timeline</h1>
|
||||
|
||||
<div class="w-full flex-col justify-center items-center">
|
||||
<input type="date" id="date" name="date" class="w-full md:w-[300px] p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4">
|
||||
|
||||
<input type="text" placeholder="Total Time" class="w-full md:w-[300px] p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4">
|
||||
</div>
|
||||
|
||||
<p class="text-sm text-gray-500 mt-3">Value in minutes</p>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4">
|
||||
<button
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
@ -1,129 +0,0 @@
|
||||
{% extends "main.html" %}
|
||||
{%load static%}
|
||||
{% block content %}
|
||||
|
||||
<!-- IN THIS TASK FORM THE TASK DOESN'T BELONG NEITHER TO APROJECT OR EPIC, WE REAHC THIS FORM FROM THE TASKS.HTML -->
|
||||
|
||||
<div class="w-full px-5 s:px-9 mb-5">
|
||||
<div class="w-full h-full shadow-md rounded-md py-5 px-3 bg-white">
|
||||
<h1 class="text-3xl text-secondosiblue text-center font-semibold">
|
||||
Create Task
|
||||
</h1>
|
||||
|
||||
<div class="w-full flex flex-col gap-5 justify-center items-center mt-5">
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Task Name:</label>
|
||||
<input type="text"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Project:</label>
|
||||
<select
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="">Cars & Classics</option>
|
||||
<option value="">Osina</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Epic:</label>
|
||||
<select
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="" selected disabled>Select Epic</option>
|
||||
<option value="">Epic 1</option>
|
||||
<option value="">Epic 2</option>
|
||||
<option value="">Epic 3</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Status:</label>
|
||||
<select
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="">Open</option>
|
||||
<option value="">Working On</option>
|
||||
<option value="">Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Assigned To:</label>
|
||||
<select required
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500">
|
||||
<option value="Pending">Nataly</option>
|
||||
<option value="Active">Salim</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Description:</label>
|
||||
<textarea type="text" placeholder="Description.." rows="5" cols="5"
|
||||
class="w-full py-3 px-3 border border-gray-300 outline-none rounded-md resize-none"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Extra:</label>
|
||||
<select id=""
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="" selected>No</option>
|
||||
<option value="">Yes</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Start Date:</label>
|
||||
<input type="date" id="date" name="date"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">End Date:</label>
|
||||
<input type="date" id="date" name="date"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Documents:</label>
|
||||
<div class="inbox-box border border-gray-300 w-full rounded-md px-3 mt-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<input name="" required type="file" class="file-input" accept=".pdf,.docx" hidden multiple />
|
||||
<span class="file-name text-gray-500 text-base focus:outline-none outline-none">Upload
|
||||
Document(s)</span>
|
||||
<label
|
||||
class="file-label bg-transparent text-gray-500 border border-white h-14 cursor-pointer flex items-center">
|
||||
<i class="fa fa-upload" style="font-size: 25px;"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-3">
|
||||
<button
|
||||
class="w-fit py-1 px-5 bg-osiblue rounded-md outline-none text-white border border-osiblue text-xl cursor-pointer hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- POPUP MODAL -->
|
||||
<div class="w-full h-full bg-black bg-opacity-40 z-20 fixed justify-center items-center hidden" id="popUpModal">
|
||||
<div class="w-[95%] md:w-fit h-fit bg-white rounded-md p-9 relative">
|
||||
<button class="absolute top-3 right-5 text-slate-800 text-xl cursor-pointer outline-none border-none"
|
||||
id="closeModalButton">
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
<iframe id="popupModalFrame" frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-------------- JS SCRIPTS --------------->
|
||||
<script type="text/javascript" src='{% static "js/upload-input-tag.js" %}'></script>
|
||||
|
||||
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
@ -1,140 +0,0 @@
|
||||
{% extends "main.html" %}
|
||||
{%load static%}
|
||||
{% block content %}
|
||||
|
||||
<!-- THIS TASK BELONGS TO A USER STORY ADDED FROM PROJECT DETAILS PAGE -->
|
||||
|
||||
<div class="w-full px-5 s:px-9 mb-5">
|
||||
<div class="w-full h-full shadow-md rounded-md py-5 px-3 bg-white">
|
||||
<h1 class="text-3xl text-secondosiblue text-center font-semibold">
|
||||
Create Task for {{requirement.content}}
|
||||
</h1>
|
||||
|
||||
<form method="POST" action="{% url 'save_task' %}">
|
||||
{% csrf_token %}
|
||||
<div class="w-full flex flex-col gap-5 justify-center items-center mt-5">
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Task Name:</label>
|
||||
<input required name="name" type="text" placeholder="Name"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500 text-base">User Story:</label>
|
||||
<select id="" name="requirement"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="{{requirement.id}}" selected >{{requirement.content}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500 text-base">Epic:</label>
|
||||
<select id="" name="epic"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="" selected>Select Epic</option>
|
||||
{% for epic in requirement.project.epic_set.all %}
|
||||
<option value="{{epic.id}}"selected>{{epic.title}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500 text-base">Project:</label>
|
||||
<select id="" name="project"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="{{requirement.project.id}}" selected>{{requirement.project.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Status:</label>
|
||||
<select required name="status"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="Open">Open</option>
|
||||
<option value="Working On">Working On</option>
|
||||
<option value="Closed">Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Assigned To:</label>
|
||||
<select name="assigned_to" required
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
{% for staff in members_list %}
|
||||
<option value="" selected>Select Staff</option>
|
||||
<option value="{{staff.id}}">{{staff.user.first_name}} {{staff.user.last_name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Task Description:</label>
|
||||
<textarea required name="description" type="text" placeholder="Description..." rows="5" cols="5"
|
||||
class="w-full py-3 px-3 border border-gray-300 outline-none rounded-md resize-none mt-1"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Extra:</label>
|
||||
<select required name="extra" id=""
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False" selected>No</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Start Date:</label>
|
||||
<input required name="start_date" type="date" id="date" name="date"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">End Date:</label>
|
||||
<input required name="end_date" type="date" id="date" name="date"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Documents:</label>
|
||||
<div class="inbox-box border border-gray-300 w-full rounded-md px-3 mt-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<input name="" type="file" class="file-input" accept=".pdf,.docx" hidden multiple />
|
||||
<span class="file-name text-gray-500 text-base focus:outline-none outline-none">Upload
|
||||
Document(s)</span>
|
||||
<label
|
||||
class="file-label bg-transparent text-gray-500 border border-white h-14 cursor-pointer flex items-center">
|
||||
<i class="fa fa-upload" style="font-size: 25px;"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-3">
|
||||
<button type="submit"
|
||||
class="w-fit py-1 px-5 bg-osiblue rounded-md outline-none text-white border border-osiblue text-xl cursor-pointer hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- POPUP MODAL -->
|
||||
<div class="w-full h-full bg-black bg-opacity-40 z-20 fixed justify-center items-center hidden" id="popUpModal">
|
||||
<div class="w-[95%] md:w-fit h-fit bg-white rounded-md p-9 relative">
|
||||
<button class="absolute top-3 right-5 text-slate-800 text-xl cursor-pointer outline-none border-none"
|
||||
id="closeModalButton">
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
<iframe id="popupModalFrame" frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-------------- JS SCRIPTS --------------->
|
||||
<script type="text/javascript" src='{% static "js/upload-input-tag.js" %}'></script>
|
||||
|
||||
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
@ -1,128 +0,0 @@
|
||||
{% extends "main.html" %}
|
||||
{%load static%}
|
||||
{% block content %}
|
||||
|
||||
<!-- IN THIS TASK FORM THE TASK ALREADY BELONG TO AN EPIC THAT BELONGS TO A PROJECT -->
|
||||
|
||||
<div class="w-full px-5 s:px-9 mb-5">
|
||||
<div class="w-full h-full shadow-md rounded-md py-5 px-3 bg-white">
|
||||
<h1 class="text-3xl text-secondosiblue text-center font-semibold">
|
||||
Create Task
|
||||
</h1>
|
||||
|
||||
<div class="w-full flex flex-col gap-5 justify-center items-center mt-5">
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Task Name:</label>
|
||||
<input type="text"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Project Name:</label>
|
||||
<select id=""
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 cursor-not-allowed mt-1"
|
||||
disabled>
|
||||
<option value="">Test 1</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Epic:</label>
|
||||
<select id=""
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 cursor-not-allowed mt-1"
|
||||
disabled>
|
||||
<option value="">Epic</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Status:</label>
|
||||
<select id=""
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="">Open</option>
|
||||
<option value="">Working On</option>
|
||||
<option value="">Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Assigned To:</label>
|
||||
<select required
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="Pending">Nataly</option>
|
||||
<option value="Active">Salim</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Task Description:</label>
|
||||
<textarea type="text" placeholder="Description..." rows="5" cols="5"
|
||||
class="w-full py-3 px-3 border border-gray-300 outline-none rounded-md resize-none mt-1"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Extra:</label>
|
||||
<select id=""
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500 mt-1">
|
||||
<option value="" selected>No</option>
|
||||
<option value="">Yes</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Start Date:</label>
|
||||
<input type="date" id="date" name="date"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">End Date:</label>
|
||||
<input type="date" id="date" name="date"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Documents:</label>
|
||||
<div class="inbox-box border border-gray-300 w-full rounded-md px-3 mt-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<input name="" required type="file" class="file-input" accept=".pdf,.docx" hidden multiple />
|
||||
<span class="file-name text-gray-500 text-base focus:outline-none outline-none">Upload
|
||||
Document(s)</span>
|
||||
<label
|
||||
class="file-label bg-transparent text-gray-500 border border-white h-14 cursor-pointer flex items-center">
|
||||
<i class="fa fa-upload" style="font-size: 25px;"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-3">
|
||||
<button
|
||||
class="w-fit py-1 px-5 bg-osiblue rounded-md outline-none text-white border border-osiblue text-xl cursor-pointer hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- POPUP MODAL -->
|
||||
<div class="w-full h-full bg-black bg-opacity-40 z-20 fixed justify-center items-center hidden" id="popUpModal">
|
||||
<div class="w-[95%] md:w-fit h-fit bg-white rounded-md p-9 relative">
|
||||
<button class="absolute top-3 right-5 text-slate-800 text-xl cursor-pointer outline-none border-none"
|
||||
id="closeModalButton">
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
<iframe id="popupModalFrame" frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-------------- JS SCRIPTS --------------->
|
||||
<script type="text/javascript" src='{% static "js/upload-input-tag.js" %}'></script>
|
||||
|
||||
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
@ -1,90 +0,0 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="{% url 'save_point' %}">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Point</h1>
|
||||
<select name="task" required
|
||||
class="hidden w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md text-gray-500">
|
||||
|
||||
<option value="{{task.id}}">{{task.name}}</option>
|
||||
|
||||
</select>
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<input name="text" type="text" placeholder="Type your point here..."
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4" id="pointInput"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- THE WARNING MESSAGE THAT APPEARS WHEN THE USER CLICKS ON THE ADD BUTTON WITH AN EMPTY INPUT FIELD -->
|
||||
<p class="text-red-500 font-light mt-2" id="AlertPointMessage">
|
||||
|
||||
</p>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4 gap-4">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300"
|
||||
id="addPointsFormButton">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex flex-col" id="allPointsContainer">
|
||||
<!-- THE ENTERED POINTS BY THE USER CONTAINER -->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <script>
|
||||
const allPointsContainer = document.getElementById("allPointsContainer");
|
||||
const pointInput = document.getElementById("pointInput");
|
||||
const addButton = document.getElementById("addPointsFormButton");
|
||||
const alertMessage = document.getElementById("AlertPointMessage");
|
||||
|
||||
addButton.addEventListener("click", function () {
|
||||
// Fetch the entered in the input field
|
||||
const pointText = pointInput.value;
|
||||
|
||||
// Check if the input field is empty
|
||||
if (pointText.trim() === "") {
|
||||
// Show an error message
|
||||
alertMessage.textContent = "Please enter a point before adding.";
|
||||
return; // Exit the function without adding if input is empty
|
||||
}
|
||||
|
||||
// Clear the error message
|
||||
alertMessage.textContent = "";
|
||||
|
||||
// Create a new container div for each pair
|
||||
const container = document.createElement("div");
|
||||
container.className = "w-full flex justify-start items-center gap-3 mt-3";
|
||||
|
||||
// Create a new paragraph element
|
||||
const newParagraph = document.createElement("p");
|
||||
|
||||
// Set the text content of the new paragraph to the input text
|
||||
newParagraph.textContent = "- " + pointText;
|
||||
|
||||
container.appendChild(newParagraph);
|
||||
|
||||
allPointsContainer.appendChild(container);
|
||||
|
||||
// Clear the input field
|
||||
pointInput.value = "";
|
||||
});
|
||||
</script> -->
|
||||
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue