New changes.
parent
7fd912e1d7
commit
adb4efe623
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,22 @@
|
||||
|
||||
var modal = document.getElementById("notesModal");
|
||||
var modalContent = document.getElementById("noteContent");
|
||||
|
||||
function showModal(text, color) {
|
||||
modalContent.innerHTML = text;
|
||||
modalContent.style.backgroundColor = color;
|
||||
|
||||
modal.style.display = "flex";
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
modal.style.display = "none";
|
||||
}
|
||||
|
||||
// Close the modal when clicking outside the container
|
||||
window.onclick = function (event) {
|
||||
if (event.target == modal) {
|
||||
modal.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
{%load static%}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<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>
|
||||
<form id="hiddenContent" method="post" action="{% url 'deletenotemodal' note.id %}" target="_parent">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="h-[140px] flex flex-col justify-center items-center">
|
||||
<h1 class="text-slate-800 text-xl font-semibold text-center">Are you sure you want to delete this note?</h1>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-5 gap-5">
|
||||
<button
|
||||
class="w-fit bg-red-500 border border-red-500 rounded-md text-white text-base px-3 py-2 hover:bg-white hover:text-red-500">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,190 @@
|
||||
{% extends "main.html" %}
|
||||
{%load static%}
|
||||
{% block content %}
|
||||
|
||||
<!-- USERS ACTIVITIES ON MOBILE -->
|
||||
<div class="w-[55px] h-[55px] bg-slate-700 rounded-full fixed xxlg1:hidden bottom-3 right-3 p-2 flex justify-center items-center cursor-pointer usersActivityIcon z-20"
|
||||
data-modal-url="{% url 'getupdatedactivities' %}">
|
||||
<img src="{% static 'images/usersactivity.png' %}" alt="Users">
|
||||
</div>
|
||||
|
||||
|
||||
<!-- NOTES POPUP THAT APPEARS WHEN CLICKING ON A SPECIFIC NOTE -->
|
||||
<div id="notesModal"
|
||||
class="w-full h-full bg-black bg-opacity-40 z-20 fixed hidden justify-center items-center inset-0 p-5">
|
||||
<div class="w-full s:w-[500px] h-fit rounded-md p-5 cursor-pointer relative"
|
||||
style="background-color: {{note.color}}">
|
||||
<p class="text-base text-gray-500 p-5 rounded-md" id="noteContent">
|
||||
</p>
|
||||
|
||||
<div class="bg-white rounded-full h-[30px] w-[30px] shadow-md absolute top-2 right-2 p-2 flex justify-center items-center cursor-pointer"
|
||||
onclick="closeModal()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="12" viewBox="0 0 384 512">
|
||||
<path
|
||||
d="M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z" fill="grey"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- NOTES SECTION -->
|
||||
<div class="w-full px-5 s:px-9 pb-5">
|
||||
<div class="w-full h-fit bg-white shadow-md rounded-md p-5">
|
||||
<div class="w-full flex flex-col s:flex-row justify-between gap-3 s:gap-0 items-center">
|
||||
<div class="w-full s:w-fit flex justify-between items-center">
|
||||
<div>
|
||||
<p class="text-base text-gray-500">Recent Note:</p>
|
||||
<div class="flex justify-start items-center gap-2">
|
||||
<div class="w-[13px] h-[13px] rounded-full" style="background-color: {{ recent_note.color }};">
|
||||
</div>
|
||||
<p class="text-slate-700 truncate max-w-xs l:max-w-xl">{{recent_note.text}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="w-[30px] h-[30px] rounded-full p-2 bg-gray-300 text-white text-[18px] outline-none border-none cursor-pointer flex s:hidden justify-center items-center shadow-md addNoteButton"
|
||||
data-modal-url="{% url 'addnote' %}">
|
||||
<i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="w-full s:w-fit hidden s:flex justify-start s:justify-end items-center gap-4">
|
||||
<button
|
||||
class="w-full s:w-fit rounded-md py-1 px-3 bg-slate-800 border border-slate-800 text-white hover:bg-white hover:text-slate-800"
|
||||
id="showNotesButton">Show
|
||||
Notes</button>
|
||||
<button
|
||||
class="w-[35px] h-[35px] rounded-full p-2 bg-gray-300 text-white text-[20px] outline-none border-none cursor-pointer flex justify-center items-center shadow-md addNoteButton"
|
||||
data-modal-url="{% url 'addnote' %}">
|
||||
<i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ALL NOTES CONTAINER (appears when clicking on the "Show notes" button) -->
|
||||
<div class="w-full h-fit mt-5 hidden" id="notesContainer">
|
||||
|
||||
<div class="w-full hidden lg:grid grid-cols-3 xlg:grid-cols-6 gap-3">
|
||||
{% for note in notes %}
|
||||
<div class="h-[150px] shadow-md rounded-md p-5 cursor-pointer" style="background-color: {{note.color}}"
|
||||
onclick="showModal('{{ note.text }}', '{{ note.color }}')">
|
||||
<p class="text-sm text-gray-500 overflow-hidden"
|
||||
style="word-break: break-all; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;">
|
||||
{{ note.text }}
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- MOBILE NOTES IN SLIDER -->
|
||||
<div class="w-full black lg:hidden">
|
||||
<div class="swiper-container mt-5">
|
||||
<div class="swiper-wrapper">
|
||||
{% for note in notes %}
|
||||
<div class="swiper-slide cursor-pointer">
|
||||
<div class="w-full h-[150px] p-3 flex justify-start items-start rounded-md shadow-md"
|
||||
style="background-color: {{note.color}}"
|
||||
onclick="showModal('{{ note.text }}', '{{ note.color }}')">
|
||||
<p class="text-sm text-gray-500 overflow-hidden"
|
||||
style="word-break: break-all; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;">
|
||||
{{ note.text }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- PROJECT TYPES LISTING AND USERS ACTIVITY SECTION -->
|
||||
<div class="w-full flex justify-between gap-5 px-5 s:px-9 pb-5">
|
||||
<!-- LEFT SIDE / PROJECT TYPES SECTION -->
|
||||
<div class="w-full xxlg1:w-[75%]">
|
||||
<div class="w-full h-fit bg-white rounded-md shadow-md p-5">
|
||||
<h1 class="text-slate-800 text-[30px] font-semibold">Notes</h1>
|
||||
|
||||
<!-- FILTERING -->
|
||||
<div class="w-full py-3 px-3 bg-gray-200 rounded-md shadow-md mt-4 flex justify-end items-center">
|
||||
<button
|
||||
class="text-base px-3 py-2 bg-blue-500 text-white outline-none border border-blue-500 rounded-md cursor-pointer hover:bg-white hover:text-blue-500 addNoteButton"
|
||||
data-modal-url="{% url 'addnote' %}">Add
|
||||
Note</button>
|
||||
</div>
|
||||
|
||||
<!-- NOTES -->
|
||||
<div class="w-full grid grid-cols-1 s:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-5 mt-5">
|
||||
{% for note in my_notes %}
|
||||
<div>
|
||||
<div class="w-full rounded-t-md px-3 py-2 flex justify-between items-center border-b border-white border-opacity-30"
|
||||
style="background-color: {{note.color}}">
|
||||
<p class="text-sm text-gray-500">{{ note.date|date:"F j, Y" }}</p>
|
||||
<button
|
||||
class="w-[30px] h-[30px] bg-white shadow-md rounded-md p-2 flex justify-center items-center cursor-pointer hover:scale-105 duration-300 transition-transform deleteNoteButton" data-modal-url="{% url 'deletenotemodal' note.id %}"
|
||||
style="color: {{note.color}};">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="h-[150px] shadow-md rounded-b-md p-5 cursor-pointer"
|
||||
style="background-color: {{note.color}}"
|
||||
onclick="showModal('{{ note.text }}', '{{ note.color }}')">
|
||||
<p class="text-sm text-gray-500 overflow-hidden"
|
||||
style="word-break: break-all; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;">
|
||||
{{ note.text }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- RIGHT SIDE / USERS ACTIVITY -->
|
||||
{% if latest_statuses_time_ago %}
|
||||
<div class="hidden xxlg1:block w-[25%] bg-white h-[630px] overflow-y-auto overflow-hidden rounded-md shadow-md p-5">
|
||||
<h1 class="text-2xl text-slate-700 text-center font-semibold">USERS ACTIVITY</h1>
|
||||
<div class="w-full h-fit mt-2" id="activitiesContainer">
|
||||
|
||||
{% include 'recent-activities.html' %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="hidden xxlg1:block w-[25%] bg-white h-[305px] overflow-y-auto overflow-hidden rounded-md shadow-md p-5">
|
||||
<h1 class="text-2xl text-slate-700 text-center font-semibold">USERS ACTIVITY</h1>
|
||||
<div class="w-full h-fit mt-2" id="activitiesContainer">
|
||||
|
||||
{% include 'recent-activities.html' %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</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>
|
||||
|
||||
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>
|
||||
</div>
|
||||
|
||||
<!---------------------- JS SCRIPTS -------------------->
|
||||
|
||||
<!-- TO SHOW ALL THE ADDED NOTES BY THE USER WHEN CLICKING ON THE SHOW NOTES BUTTON -->
|
||||
<script type="text/javascript" src='{% static "js/show-notes.js" %}'></script>
|
||||
|
||||
<!-- IT OPENS A POPUP FOR THE WHOLE NOTE CONTENT -->
|
||||
<script type="text/javascript" src='{% static "js/notes-pop-modal.js" %}'></script>
|
||||
|
||||
{% endblock content %}
|
@ -0,0 +1,111 @@
|
||||
{% 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>
|
||||
<form id="hiddenContent" method="POST" action="">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-slate-800 text-2xl font-semibold text-center">Add Note</h1>
|
||||
|
||||
<div class="w-full flex 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">
|
||||
</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-blue-500 border border-blue-500 rounded-md text-white text-xl px-3 py-2 hover:bg-white hover:text-blue-500">Add</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue