emile 1 year ago
parent d60cd731fe
commit ae5aee3aa0

BIN
.DS_Store vendored

Binary file not shown.

BIN
osinaweb/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -11,6 +11,7 @@ urlpatterns = [
path('businessmodal/', views.add_business_modal, name='addbusinessmodal'),
path('staff/', views.add_staff, name='adduser'),
path('project/', views.add_project, name='addproject'),
path('userstory/<str:project_id>/', views.add_user_story_modal, name='adduserstorymodal'),
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'),

@ -279,6 +279,31 @@ def add_project(request):
return render(request, 'add_templates/add-project.html', context)
def add_user_story_modal(request, project_id):
project = get_object_or_404(Project, project_id=project_id)
if request.method == 'POST':
content = request.POST.get('content')
story = ProjectRequirement(
content = content,
project = project,
added_by = request.user,
)
story.save()
# Reload the parent page using JavaScript
response = HttpResponse('<script>window.top.location.reload();</script>')
return response
context = {
'project' : project,
}
return render(request, 'add_templates/add-userstory-modal.html', context)
def add_project_note_modal(request, project_id):

Binary file not shown.

@ -13,7 +13,7 @@
</head>
<body class="font-poppinsLight">
<form id="hiddenContent" method="POST" action="{% url 'adduserstory' project.project_id %}">
<form id="hiddenContent" method="POST" action="{% url 'adduserstorymodal' project.project_id %}">
{% csrf_token %}
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add User Story</h1>

@ -274,7 +274,7 @@
<button
class="h-full rounded-tr-md px-4 bg-gray-300 text-osiblue text-[18px] outline-none border-none cursor-pointer flex justify-center items-center addUserStoryButton"
data-modal-url="{% url 'adduserstory' project.project_id %}">
data-modal-url="{% url 'adduserstorymodal' project.project_id %}">
<i class="fa fa-plus"></i>
</button>
</div>

@ -1,116 +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_project_note' %}">
{% 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>

@ -1,32 +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 '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>

@ -1,39 +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">
<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>

@ -1,86 +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">
<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>

@ -1,32 +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_tag' %}">
{% 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>

@ -1,33 +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">
<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>

@ -61,7 +61,6 @@ urlpatterns = [
#Modals urls
path('add-user-story/<str:project_id>/', views.add_user_story_modal, name='adduserstory'),
path('update-status/<str:task_id>/', views.update_status_modal, name='updatestatus'),
path('show-points/<str:task_id>/', views.show_points_modal, name='showpoints'),
path('timeline/', views.timeline_modal, name='timeline'),

@ -403,32 +403,6 @@ def add_business_modal(request, *args, **kwargs):
def add_user_story_modal(request, project_id):
project = get_object_or_404(Project, project_id=project_id)
if request.method == 'POST':
content = request.POST.get('content')
story = ProjectRequirement(
content = content,
project = project,
added_by = request.user,
)
story.save()
# Reload the parent page using JavaScript
response = HttpResponse('<script>window.top.location.reload();</script>')
return response
context = {
'project' : project,
}
return render(request, 'popup_modals/add-userstory-modal.html', context)
def status_mobile_modal (request, *args, **kwargs):

Loading…
Cancel
Save