0% found this document useful (0 votes)
46 views41 pages

Notes Sharing Web App Coding

Uploaded by

Dinesh Kumar P
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views41 pages

Notes Sharing Web App Coding

Uploaded by

Dinesh Kumar P
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 41

Notes sharing web app coding

HTML
1.ABOUT

{% include 'navbar.html' %}
{% load static %}

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="about-section">
<h1>About Us</h1>
<p>This is Simple Enotes APP Develop by SRINIDHI</p>
<p>This project anytime anywhere remember all queries of students Motivate
peoples to use.</p>
</div>
<br><br>
<h2 style="text-align:center">Our Team</h2>
<div class="row offset-3">
<div class="column">
<div class="card">
<img src="{% static 'images/t2.jpg' %}" alt="SRINIDHI" style="border-
radius: 50%;">
<div class="container">
<h2>SRINIDHI</h2>
<p class="title">CEO & Founder</p>
<p>[email protected]</p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>

<div class="column">
<div class="card">
<img src="{% static 'images/avatar-5.png' %}" alt="JENNIE"
style="border-radius: 50%;">
<div class="container">
<h2>JENNIE</h2>
<p class="title">Software Developer</p>
<p>[email protected]</p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>
</div>
</body>
</html>

2.ADD NOTES

{% extends 'usernavbar.html' %}
{% block main %}

<div class="pagetitle">
<h1>Add Notes</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/dashboard">Home</a></li>
<li class="breadcrumb-item active">Add Notes</li>
</ol>
</nav>
</div><!-- End Page Title -->

<section class="section profile">


<div class="row">

<div class="col-xl-12">

<div class="card">
<div class="card-body pt-3">
<!-- Bordered Tabs -->
<ul class="nav nav-tabs nav-tabs-bordered">

<li class="nav-item">
<button class="nav-link active" data-bs-
toggle="tab" data-bs-target="#profile-overview">
Add Notes
</button>
</li>

</ul>
<div class="tab-content pt-2">

<div class="tab-pane fade show active profile-


overview" id="profile-overview">
<form method="post">
{% csrf_token %}

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">Title</label>
<div class="col-md-8 col-lg-9">
<input name="Title" type="text"
class="form-control" placeholder="Enter Title" required>
</div>
</div>

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">Notes Description</label>
<div class="col-md-8 col-lg-9">
<textarea name="Content" class="form-
control" style="height: 100px" placeholder="Notes Description"
required></textarea>
</div>
</div>

<div class="text-center">
<button type="submit" class="btn btn-
primary">Submit</button>
</div>
</form><!-- End Profile Edit Form -->

</div>

</div>
</div>
</div>
</div>
</div>
</section>

{% if error == "no" %}
<script>
alert('New Notes Added Successfully.');
window.location=('{% url 'addNotes' %}');
</script>
{% endif %}

{% if error == "yes" %}
<script>
alert('Something went wrong, Try Again');
</script>
{% endif %}

{% endblock %}
3.CHANGE PASSWORD
{% extends 'usernavbar.html' %}
{% block main %}

<div class="pagetitle">
<h1>Change Password</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/dashboard">Home</a></li>
<li class="breadcrumb-item active">Change Password</li>
</ol>
</nav>
</div><!-- End Page Title -->

<script>
function checkpassword(){
if(document.changepassword.newpassword.value!
=document.changepassword.confirmpassword.value){
alert('New Password and Confirm Password field does not Match');
document.changepassword.confirmpassword.focus();
return false;
}
return true;
}
</script>

{% if error == "no" %}
<script>
alert('Password updated successfully');
window.location=('{% url 'logout' %}');
</script>
{% endif %}
{% if error == "yes" %}
<script>
alert('Something went wrong , try again later');
</script>
{% endif %}

{% if error == "not" %}
<script>
alert('Your current password is wrong');
</script>
{% endif %}

<section class="section profile">


<div class="row">

<div class="col-xl-12">
<div class="card">
<div class="card-body pt-3">
<!-- Bordered Tabs -->
<ul class="nav nav-tabs nav-tabs-bordered">

<li class="nav-item">
<button class="nav-link active" data-bs-
toggle="tab" data-bs-target="#profile-overview">
Change Password
</button>
</li>

</ul>
<div class="tab-content pt-2">

<div class="tab-pane fade show active profile-


overview" id="profile-overview">
<form method="post" name="changepassword"
onsubmit="return checkpassword()">
{% csrf_token %}

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">Current Password</label>
<div class="col-md-8 col-lg-9">
<input type="password"
name="oldpassword" class="form-control" placeholder="Current Password"
required>
</div>
</div>

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">New Password</label>
<div class="col-md-8 col-lg-9">
<input type="password"
name="newpassword" class="form-control" placeholder="New Password" required>
</div>
</div>

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">Confirm Password</label>
<div class="col-md-8 col-lg-9">
<input type="password"
name="confirmpassword" class="form-control" placeholder="Confirm Password"
required>
</div>
</div>

<div class="text-center">
<button type="submit" class="btn btn-
primary">Submit</button>
</div>
</form><!-- End Profile Edit Form -->

</div>

</div>
</div>
</div>
</div>
</div>
</section>

{% endblock %}
4.DASHBOARD

{% extends 'usernavbar.html' %}
{% block main %}

<div class="pagetitle">
<h1>Dashboard</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/dashboard">Home</a></li>
<li class="breadcrumb-item active">Dashboard</li>
</ol>
</nav>
</div><!-- End Page Title -->

<section class="section dashboard">


<div class="row">

<!-- Left side columns -->


<div class="col-lg-8">
<div class="row">

<!-- Sales Card -->


<div class="col-xxl-6 col-md-6">
<div class="card info-card sales-card">
<div class="card-body">
<h5 class="card-title">Total Notes</h5>
<div class="d-flex align-items-center">
<div class="card-icon rounded-circle d-flex align-items-
center justify-content-center">
<i class="bi bi-files"></i>
</div>
<div class="ps-3">
<h6>{{totalnotes}}</h6>

</div>
</div>
</div>

</div>
</div><!-- End Sales Card -->
</div>
</div>
</div>
</section>

{% endblock %}
5.EDITNOTES

{% extends 'usernavbar.html' %}
{% block main %}

<div class="pagetitle">
<h1>Update Notes</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/dashboard">Home</a></li>
<li class="breadcrumb-item active">Update Notes</li>
</ol>
</nav>
</div><!-- End Page Title -->

<section class="section profile">


<div class="row">

<div class="col-xl-12">

<div class="card">
<div class="card-body pt-3">
<!-- Bordered Tabs -->
<ul class="nav nav-tabs nav-tabs-bordered">

<li class="nav-item">
<button class="nav-link active" data-bs-
toggle="tab" data-bs-target="#profile-overview">
Edit Notes
</button>
</li>

</ul>
<div class="tab-content pt-2">

<div class="tab-pane fade show active profile-


overview" id="profile-overview">
<form method="post">
{% csrf_token %}

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">Title</label>
<div class="col-md-8 col-lg-9">
<input name="Title" type="text"
class="form-control" value="{{notes.Title}}">
</div>
</div>

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">Notes Description</label>
<div class="col-md-8 col-lg-9">
<textarea name="Content" class="form-
control" style="height: 100px" required>{{notes.Content}}</textarea>
</div>
</div>

<div class="text-center">
<button type="submit" class="btn btn-
primary">Update</button>
</div>
</form><!-- End Profile Edit Form -->

</div>

</div>
</div>
</div>
</div>
</div>
</section>

{% if error == "no" %}
<script>
alert('Notes has been Updated.');
window.location=('{% url 'viewNotes' %}');
</script>
{% endif %}

{% if error == "yes" %}
<script>
alert('Something went wrong, Try Again');
</script>
{% endif %}

{% endblock %}
6.INDEX

{% include 'navbar.html' %}
{% load static %}
<style>
.image{
width :100%;
height : 655px;
background-image :url({% static 'images/enotesss.jpg' %});
background-repeat : no-repeat;
background-size: cover;
}
</style>
<div class="image">
<div class="transparentbox">
<p>Enotes Management System</p>
</div>
</div>

7.NAVBAR

{% load static %}
<!-- CSS cdn-->
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-
Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<!-- JS cdn-->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/
GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"

integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa
0b4Q"
crossorigin="anonymous"></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"

integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PV
CmYl"
crossorigin="anonymous"></script>
<!-- font-awesome cdn-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/6.0.0/css/all.min.css"
integrity="sha512-
9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6
qOPnzFeg=="
crossorigin="anonymous" referrerpolicy="no-referrer"/>

<link rel="stylesheet" href="{% static 'css/style.css' %}">

<nav class="navbar navbar-expand-lg navbar-dark bg-custom">


<a class="navbar-brand" href="#"><i class="fa-solid fa-book-open-
cover"></i> Enotes</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-
target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-
label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">


<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="{% url 'index' %}"><i class="fa-
solid fa-house-user"></i> Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/about"><i class="fa-solid fa-
address-card"></i> About</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/register"><i class="fa-solid fa-
user-plus"></i> Registration</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/user_login"><i class="fa-solid fa-
right-to-bracket"></i> Login</a>
</li>
</ul>
</div>
</nav>
8.PROFILE
{% extends 'usernavbar.html' %}
{% block main %}

<div class="pagetitle">
<h1>Profile</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/dashboard">Home</a></li>
<li class="breadcrumb-item active">Profile</li>
</ol>
</nav>
</div><!-- End Page Title -->

<section class="section profile">


<div class="row">
<div class="col-xl-4">

<div class="card">
<div class="card-body profile-card pt-4 d-flex flex-column
align-items-center">

<h2>{{user.first_name}} {{user.last_name}}</h2>
<h3>{{signup.About}}</h3>
<div class="social-links mt-2">
<a href="#" class="twitter"><i class="bi bi-
twitter"></i></a>
<a href="#" class="facebook"><i class="bi bi-
facebook"></i></a>
<a href="#" class="instagram"><i class="bi bi-
instagram"></i></a>
<a href="#" class="linkedin"><i class="bi bi-
linkedin"></i></a>
</div>
</div>
</div>
</div>

<div class="col-xl-8">

<div class="card">
<div class="card-body pt-3">
<!-- Bordered Tabs -->
<ul class="nav nav-tabs nav-tabs-bordered">

<li class="nav-item">
<button class="nav-link active" data-bs-
toggle="tab" data-bs-target="#profile-overview">
Overview
</button>
</li>

<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab"
data-bs-target="#profile-edit">Edit Profile
</button>
</li>

</ul>
<div class="tab-content pt-2">

<div class="tab-pane fade show active profile-


overview" id="profile-overview">

<h5 class="card-title">Profile Details</h5>

<div class="row">
<div class="col-lg-3 col-md-4 label ">Full
Name</div>
<div class="col-lg-9 col-md-
8">{{user.first_name}} {{user.last_name}}</div>
</div>

<div class="row">
<div class="col-lg-3 col-md-4 label
">About</div>
<div class="col-lg-9 col-md-
8">{{signup.About}}</div>
</div>

<div class="row">
<div class="col-lg-3 col-md-4 label">Email
ID</div>
<div class="col-lg-9 col-md-
8">{{user.username}}</div>
</div>

<div class="row">
<div class="col-lg-3 col-md-4 label">Contact
Number</div>
<div class="col-lg-9 col-md-
8">{{signup.ContactNo}}</div>
</div>

<div class="row">
<div class="col-lg-3 col-md-4
label">Registration Date</div>
<div class="col-lg-9 col-md-
8">{{signup.RegDate}}</div>
</div>
</div>

<div class="tab-pane fade profile-edit pt-3"


id="profile-edit">

<!-- Profile Edit Form -->


<form method="post">
{% csrf_token %}

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">First Name</label>
<div class="col-md-8 col-lg-9">
<input name="firstName" type="text"
class="form-control" value="{{user.first_name}}">
</div>
</div>

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">Last Name</label>
<div class="col-md-8 col-lg-9">
<input name="lastName" type="text"
class="form-control" value="{{user.last_name}}">
</div>
</div>

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">Phone</label>
<div class="col-md-8 col-lg-9">
<input name="ContactNo" type="text"
class="form-control" value="{{signup.ContactNo}}">
</div>
</div>

<div class="row mb-3">


<label class="col-md-4 col-lg-3 col-form-
label">About</label>
<div class="col-md-8 col-lg-9">
<input name="About" type="text"
class="form-control" value="{{signup.About}}">
</div>
</div>
<div class="row mb-3">
<label class="col-md-4 col-lg-3 col-form-
label">Email</label>
<div class="col-md-8 col-lg-9">
<input name="email" type="email"
class="form-control" value="{{user.username}}" readonly>
</div>
</div>

<div class="text-center">
<button type="submit" class="btn btn-
primary">Save Changes</button>
</div>
</form><!-- End Profile Edit Form -->
</div>
</div>
</div>
</div>
</div>
</div>
</section>

{% if error == "no" %}
<script>
alert('Profile has been Updated.');
window.location=('{% url 'profile' %}');
</script>
{% endif %}

{% if error == "yes" %}
<script>
alert('Something went wrong, Try Again');
</script>
{% endif %}

{% endblock %}
9.REGISTER

{% load static %}
<html>
<head>
<title>Login Form</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,
shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="{% static 'css/login.css'
%}">
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css
">
<link
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
</head>
<body>
<div class="container">
<div class="row px-3">
<div class="col-lg-10 col-xl-9 card flex-row mx-auto px-0">
<div class="img-left d-none d-md-flex"></div>

<div class="card-body">
<h4 class="title text-center mt-4">
Register Form
</h4>
<form class="form-box px-3" method="post">
{% csrf_token %}
<div class="form-input">
<span><i class="fa fa-user"></i></span>
<input type="text" name="firstName" placeholder="Enter
First Name" required>
</div>

<div class="form-input">
<span><i class="fa fa-user"></i></span>
<input type="text" name="lastName" placeholder="Enter
Last Name" required>
</div>

<div class="form-input">
<span><i class="fa fa-envelope-o"></i></span>
<input type="email" name="email" placeholder="Email
Address" required>
</div>

<div class="form-input">
<span><i class="fa fa-key"></i></span>
<input type="password" name="password"
placeholder="Password" required>
</div>

<div class="form-input">
<span><i class="fa fa-phone"></i></span>
<input type="text" name="ContactNo" placeholder="Enter
Contact No." maxlength="10" required>
</div>

<div class="form-input">
<span><i class="fa fa-address-card"></i></span>
<textarea name="About" placeholder="About...."
required></textarea>
</div>

<div class="mb-3">
<button type="submit" class="btn btn-block text-
uppercase">
Submit
</button>
</div>

<div class="row mb-3">


<a href="{% url 'index' %}" class="btn btn-block
btn-social btn-facebook">
Back to Home
</a>
</div>
</form>
</div>
</div>
</div>
</div>

{% if error == "no" %}
<script>
alert('Registration Successfully');
window.location=('{% url 'user_login' %}');
</script>
{% endif %}

{% if error == "yes" %}
<script>
alert('Something went wrong, Try Again');
</script>
{% endif %}

</body>
</html>
10.USER LOGIN

{% load static %}
<html>
<head>
<title>Login Form</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,
shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="{% static 'css/login.css'
%}">
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css
">
<link
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
</head>
<body>
<div class="container">
<div class="row px-3">
<div class="col-lg-10 col-xl-9 card flex-row mx-auto px-0">
<div class="img-left d-none d-md-flex"></div>

<div class="card-body">
<h4 class="title text-center mt-4">
Login
</h4>
<form class="form-box px-3" method="post">
{% csrf_token %}
<div class="form-input">
<span><i class="fa fa-envelope-o"></i></span>
<input type="email" name="email" placeholder="Email
Address" tabindex="10" required>
</div>
<div class="form-input">
<span><i class="fa fa-key"></i></span>
<input type="password" name="password"
placeholder="Password" required>
</div>

<div class="mb-3">
<button type="submit" class="btn btn-block text-
uppercase">
Login
</button>
</div>

<div class="text-center mb-3">

</div>

<div class="row mb-3">


<a href="{% url 'index' %}" class="btn btn-block
btn-social btn-facebook">
Back to Home
</a>
</div>

<hr class="my-4">

<div class="text-center mb-2">


Don't have an account?
<a href="{% url 'register' %}" class="register-link">
Register here
</a>
</div>
</form>
</div>
</div>
</div>
</div>

{% if error == "no" %}
<script>
alert('Logged In Successfully');
window.location=('{% url 'dashboard' %}');
</script>
{% endif %}

{% if error == "yes" %}
<script>
alert('Invalid Credential, Try Again');
</script>
{% endif %}

</body>
</html>
11.USER NAVBAR

{% load static %}
<html lang="en">

<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">

<title>Enotes Management System</title>


<meta content="" name="description">
<meta content="" name="keywords">

<!-- Favicons -->


<link href="{% static 'assets/img/favicon.png' %}" rel="icon">
<link href="{% static 'assets/img/apple-touch-icon.png' %}" rel="apple-
touch-icon">

<!-- Google Fonts -->


<link href="https://fonts.gstatic.com" rel="preconnect">
<link href="https://fonts.googleapis.com/css?
family=Open+Sans:300,300i,400,400i,600,600i,700,700i|
Nunito:300,300i,400,400i,600,600i,700,700i|
Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">

<!-- Vendor CSS Files -->


<link href="{% static 'assets/vendor/bootstrap/css/bootstrap.min.css' %}"
rel="stylesheet">
<link href="{% static 'assets/vendor/bootstrap-icons/bootstrap-icons.css'
%}" rel="stylesheet">
<link href="{% static 'assets/vendor/boxicons/css/boxicons.min.css' %}"
rel="stylesheet">
<link href="{% static 'assets/vendor/quill/quill.snow.css' %}"
rel="stylesheet">
<link href="{% static 'assets/vendor/quill/quill.bubble.css' %}"
rel="stylesheet">
<link href="{% static 'assets/vendor/remixicon/remixicon.css' %}"
rel="stylesheet">
<link href="{% static 'assets/vendor/simple-datatables/style.css' %}"
rel="stylesheet">

<!-- Template Main CSS File -->


<link href="{% static 'assets/css/style.css' %}" rel="stylesheet">

</head>

<body>

<!-- ======= Header ======= -->


<header id="header" class="header fixed-top d-flex align-items-center">

<div class="d-flex align-items-center justify-content-between">


<a href="index.html" class="logo d-flex align-items-center">
<img src="{% static 'images/enotes.jpg' %}" alt="">
</a>
<i class="bi bi-list toggle-sidebar-btn"></i>
</div><!-- End Logo -->

<nav class="header-nav ms-auto">


<ul class="d-flex align-items-center">

<li class="nav-item dropdown pe-3">


<a class="nav-link nav-profile d-flex align-items-center pe-0"
href="#" data-bs-toggle="dropdown">
<span class="d-none d-md-block dropdown-toggle ps-
2">{{request.user.first_name}} {{request.user.last_name}}</span>
</a><!-- End Profile Iamge Icon -->

<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow


profile">
<li class="dropdown-header">
<h6>{{request.user.first_name}} {{request.user.last_name}}</h6>
</li>
<li>
<hr class="dropdown-divider">
</li>

<li>
<a class="dropdown-item d-flex align-items-center"
href="/profile">
<i class="bi bi-person"></i>
<span>My Profile</span>
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>

<li>
<a class="dropdown-item d-flex align-items-center"
href="/changePassword">
<i class="bi bi-gear"></i>
<span>Account Settings</span>
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>

<li>
<hr class="dropdown-divider">
</li>

<li>
<a class="dropdown-item d-flex align-items-center"
href="/logout">
<i class="bi bi-box-arrow-right"></i>
<span>Sign Out</span>
</a>
</li>

</ul><!-- End Profile Dropdown Items -->


</li><!-- End Profile Nav -->

</ul>
</nav><!-- End Icons Navigation -->

</header><!-- End Header -->

<!-- ======= Sidebar ======= -->


<aside id="sidebar" class="sidebar">

<ul class="sidebar-nav" id="sidebar-nav">

<li class="nav-item">
<a class="nav-link" href="/dashboard">
<i class="bi bi-grid"></i>
<span>Dashboard</span>
</a>
</li><!-- End Dashboard Nav -->

<li class="nav-item">
<a class="nav-link collapsed" href="/profile">
<i class="bi bi-person"></i>
<span>Profile</span>
</a>
</li><!-- End Profile Page Nav -->

<li class="nav-item">
<a class="nav-link collapsed" href="/addNotes">
<i class="bi bi-question-circle"></i>
<span>Add Notes</span>
</a>
</li><!-- End F.A.Q Page Nav -->

<li class="nav-item">
<a class="nav-link collapsed" href="/viewNotes">
<i class="bi bi-envelope"></i>
<span>View Notes</span>
</a>
</li><!-- End Contact Page Nav -->

<li class="nav-item">
<a class="nav-link collapsed" href="/changePassword">
<i class="bi bi-card-list"></i>
<span>Change Password</span>
</a>
</li><!-- End Register Page Nav -->

<li class="nav-item">
<a class="nav-link collapsed" href="/logout">
<i class="bi bi-box-arrow-in-right"></i>
<span>Logout</span>
</a>
</li><!-- End Login Page Nav -->
</ul>

</aside><!-- End Sidebar-->

<main id="main" class="main">


<section class="section dashboard">
{% block main %}

{% endblock %}
</section>

</main><!-- End #main -->

<!-- ======= Footer ======= -->


<footer id="footer" class="footer">
<div class="copyright">
&copy; Copyright <strong><span>Enotes Management System</span></strong>.
</div>
</footer><!-- End Footer -->

<a href="#" class="back-to-top d-flex align-items-center justify-content-


center"><i class="bi bi-arrow-up-short"></i></a>

<!-- Vendor JS Files -->


<script src="{% static 'assets/vendor/apexcharts/apexcharts.min.js'
%}"></script>
<script src="{% static 'assets/vendor/bootstrap/js/bootstrap.bundle.min.js'
%}"></script>
<script src="{% static 'assets/vendor/chart.js/chart.min.js' %}"></script>
<script src="{% static 'assets/vendor/echarts/echarts.min.js' %}"></script>
<script src="{% static 'assets/vendor/quill/quill.min.js' %}"></script>
<script src="{% static 'assets/vendor/simple-datatables/simple-
datatables.js' %}"></script>
<script src="{% static 'assets/vendor/tinymce/tinymce.min.js' %}"></script>
<script src="{% static 'assets/vendor/php-email-form/validate.js'
%}"></script>

<!-- Template Main JS File -->


<script src="{% static 'assets/js/main.js' %}"></script>
</body>
</html>
12.VIEW NOTES

{% extends 'usernavbar.html' %}
{% block main %}

<div class="pagetitle">
<h1>View Notes</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/dashboard">Home</a></li>
<li class="breadcrumb-item active">View Notes</li>
</ol>
</nav>
</div>

<section class="section">
<div class="row">
<div class="col-lg-12">

<div class="card">
<div class="card-body">
<h5 class="card-title">View Notes</h5>

<!-- Table with stripped rows -->


<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Title</th>
<th scope="col">Upload Date</th>
<th scope="col">Action</th>
</tr>
</thead>

<tbody>
{% for i in notes %}
<tr>
<td>{{forloop.counter}}</td>
<td>{{i.Title}}</td>
<td>{{i.CreationDate}}</td>
<td><a href="{% url 'editNotes' i.id %}" class="btn btn-
primary">Edit</a> |
<a href="{% url 'deleteNotes' i.id %}" class="btn btn-
danger" onclick="return confirm('Are your sure to Delete ?')">Delete</a></td>
</tr>
{% endfor %}
</tbody>
</table>

</div>
</div>

</div>
</div>
</section>

{% endblock %}

CSS
1.LOGIN

body{
height: 100vh;
background: #0062E6 !important;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.card{
overflow: hidden;
border: 0 !important;
border-radius: 20px !important;
box-shadow: 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.1);
}

.img-left{
width: 45%;
background: url('/static/images/log.jpg') center;
background-size: cover;
}

.card-body{
padding: 2rem;
}

.title{
margin-bottom: 2rem;
}

.form-input{
position: relative;
}

.form-input input{
width: 100%;
height: 45px;
padding-left: 40px;
margin-bottom: 20px;
box-sizing: border-box;
box-shadow: none;
border: 1px solid #00000020;
border-radius: 50px;
outline: none;
background: transparent;
}

.form-input span{
position: absolute;
top: 10px;
padding-left: 15px;
color: #007bff;
}

.form-input input::placeholder{
color: black;
padding-left: 0px;
}

.form-input input:focus, .form-input input:valid{


border: 2px solid #007bff;
}

.form-input input:focus::placeholder{
color: #454b69;
}

.form-input textarea{
width: 100%;
height: 45px;
padding-left: 40px;
margin-bottom: 20px;
box-sizing: border-box;
box-shadow: none;
border: 1px solid #00000020;
border-radius: 50px;
outline: none;
background: transparent;
}
.form-input textarea::placeholder{
color: black;
padding-left: 0px;
}

.form-input textarea:focus, .form-input textarea:valid{


border: 2px solid #007bff;
}

.form-input textarea:focus::placeholder{
color: #454b69;
}

.form-box button[type="submit"]{
margin-top: 10px;
border: none;
cursor: pointer;
border-radius: 50px;
background: #007bff;
color: #fff;
font-size: 90%;
font-weight: bold;
letter-spacing: .1rem;
transition: 0.5s;
padding: 12px;
}

.form-box button[type="submit"]:hover{
background: #0069d9;
}

.forget-link, .register-link{
color: #007bff;
font-weight: bold;
}

.forget-link:hover, .register-link:hover{
color: #0069d9;
text-decoration: none;
}

.form-box .btn-social{
color: white !important;
border: 0;
font-weight: bold;
}
.form-box .btn-facebook{
margin-top: 10px;
border: none;
cursor: pointer;
border-radius: 50px;
font-size: 90%;
font-weight: bold;
letter-spacing: .1rem;
transition: 0.5s;
padding: 12px;
background: #4866a8;
}

.form-box .btn-facebook:hover{
background: #3d578f;
}
2.STYLE

.bg-custom {
background-color: #1a5b7e;
}

.transparentbox{
width : 100%;
height : 655px;
background-color : lightgrey;
border : 1px solid #CD853F;
opacity : 0.6;
}

.transparentbox p{
margin-top : 15%;
font-weight : bold;
font-size : 60px;
font-family :'Monotype Corsiva';
color : DarkRed;
text-align : center;
}

body {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
}

html {
box-sizing: border-box;
}

*, *:before, *:after {
box-sizing: inherit;
}

.column {
float: left;
width: 33.3%;
margin-bottom: 16px;
padding: 0 8px;
}

.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
margin: 8px;
}

.about-section {
padding: 50px;
text-align: center;
background-color: #474e5d;
color: white;
}

.container {
padding: 0 16px;
}

.container::after, .row::after {
content: "";
clear: both;
display: table;
}

.title {
color: grey;
}

.button {
border: none;
outline: 0;
display: inline-block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
}
.button:hover {
background-color: #555;
}

@media screen and (max-width: 650px) {


.column {
width: 100%;
display: block;
}
}
3.STYLE1

body{
background: #edf1f5;
margin-top:20px;
}
.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 0 solid transparent;
border-radius: 0;
}
.card {
margin-bottom: 30px;
}
.card-body {
flex: 1 1 auto;
padding: 1.57rem;
}

.note-has-grid .nav-link {
padding: .5rem
}

.note-has-grid .single-note-item .card {


border-radius: 10px
}

.note-has-grid .single-note-item .favourite-note {


cursor: pointer
}

.note-has-grid .single-note-item .side-stick {


position: absolute;
width: 3px;
height: 35px;
left: 0;
background-color: rgba(82, 95, 127, .5)
}

.note-has-grid .single-note-item .category-dropdown.dropdown-toggle:after {


display: none
}

.note-has-grid .single-note-item .category [class*=category-] {


height: 15px;
width: 15px;
display: none
}

.note-has-grid .single-note-item .category [class*=category-]::after {


content: "\f0d7";
font: normal normal normal 14px/1 FontAwesome;
font-size: 12px;
color: #fff;
position: absolute
}

.note-has-grid .single-note-item .category .category-business {


background-color: rgba(44, 208, 126, .5);
border: 2px solid #2cd07e
}

.note-has-grid .single-note-item .category .category-social {


background-color: rgba(44, 171, 227, .5);
border: 2px solid #2cabe3
}

.note-has-grid .single-note-item .category .category-important {


background-color: rgba(255, 80, 80, .5);
border: 2px solid #ff5050
}

.note-has-grid .single-note-item.all-category .point {


color: rgba(82, 95, 127, .5)
}

.note-has-grid .single-note-item.note-business .point {


color: rgba(44, 208, 126, .5)
}

.note-has-grid .single-note-item.note-business .side-stick {


background-color: rgba(44, 208, 126, .5)
}

.note-has-grid .single-note-item.note-business .category .category-business {


display: inline-block
}

.note-has-grid .single-note-item.note-favourite .favourite-note {


color: #ffc107
}

.note-has-grid .single-note-item.note-social .point {


color: rgba(44, 171, 227, .5)
}

.note-has-grid .single-note-item.note-social .side-stick {


background-color: rgba(44, 171, 227, .5)
}

.note-has-grid .single-note-item.note-social .category .category-social {


display: inline-block
}

.note-has-grid .single-note-item.note-important .point {


color: rgba(255, 80, 80, .5)
}

.note-has-grid .single-note-item.note-important .side-stick {


background-color: rgba(255, 80, 80, .5)
}

.note-has-grid .single-note-item.note-important .category .category-important


{
display: inline-block
}

.note-has-grid .single-note-item.all-category .more-options,


.note-has-grid .single-note-item.all-category.note-favourite .more-options {
display: block
}

.note-has-grid .single-note-item.all-category.note-business .more-options,


.note-has-grid .single-note-item.all-category.note-favourite.note-business
.more-options,
.note-has-grid .single-note-item.all-category.note-favourite.note-important
.more-options,
.note-has-grid .single-note-item.all-category.note-favourite.note-social
.more-options,
.note-has-grid .single-note-item.all-category.note-important .more-options,
.note-has-grid .single-note-item.all-category.note-social .more-options {
display: none
}

@media (max-width:767.98px) {
.note-has-grid .single-note-item {
max-width: 100%
}
}

@media (max-width:991.98px) {
.note-has-grid .single-note-item {
max-width: 216px
}
}

PYTHON DJANGO CODES


1.ADMIN

from django.contrib import admin


from .models import *
# Register your models here.

admin.site.register(Signup)
admin.site.register(Notes)
2.APPS

from django.apps import AppConfig

class EnotesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'enotes'

3.MODELS

from django.contrib.auth.models import User


from django.db import models

# Create your models here.

class Signup(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
ContactNo = models.CharField(max_length=10, null=True)
About = models.CharField(max_length=450, null=True)
Role = models.CharField(max_length=150, null=True)
RegDate = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.user.first_name

class Notes(models.Model):
signup = models.ForeignKey(Signup, on_delete=models.CASCADE)
Title = models.CharField(max_length=200, null=True)
Content = models.CharField(max_length=450, null=True)
CreationDate = models.DateTimeField(auto_now_add=True)
UpdationDate = models.DateField(null=True)

def __str__(self):
return self.Title

4.TESTS

from django.test import TestCase

# Create your tests here.

5.VIEWS

from django.shortcuts import render, redirect


from .models import *
from django.contrib.auth import authenticate, logout, login

# Create your views here.

def index(request):
return render(request, 'index.html')

def about(request):
return render(request, 'about.html')

def register(request):
error = ""
if request.method == 'POST':
fn = request.POST['firstName']
ln = request.POST['lastName']
e = request.POST['email']
p = request.POST['password']
c = request.POST['ContactNo']
ab = request.POST['About']
role = "ROLE_USER"

try:
user = User.objects.create_user(username=e, password=p,
first_name=fn, last_name=ln)
Signup.objects.create(user=user, ContactNo=c, About=ab, Role=role)
error = "no"
except:
error = "yes"
return render(request, 'register.html', locals())

def user_login(request):
error = ""
if request.method == 'POST':
u = request.POST['email']
p = request.POST['password']
user = authenticate(username=u, password=p)
try:
if user:
login(request, user)
error = "no"
else:
error = "yes"
except:
error = "yes"
return render(request, 'user_login.html', locals())

def dashboard(request):
if not request.user.is_authenticated:
return redirect('user_login')
user = User.objects.get(id=request.user.id)
signup = Signup.objects.get(user=user)
totalnotes = Notes.objects.filter(signup=signup).count()
return render(request, 'dashboard.html', locals())

def profile(request):
if not request.user.is_authenticated:
return redirect('user_login')
user = User.objects.get(id=request.user.id)
signup = Signup.objects.get(user=user)

if request.method == "POST":

fname = request.POST['firstName']
lname = request.POST['lastName']
contactNo = request.POST['ContactNo']
about = request.POST['About']

signup.user.first_name = fname
signup.user.last_name = lname
signup.ContactNo = contactNo
signup.About = about

try:
signup.save()
signup.user.save()
error = "no"
except:
error = "yes"
return render(request, 'profile.html', locals())

def addNotes(request):
if not request.user.is_authenticated:
return redirect('user_login')
user = User.objects.get(id=request.user.id)
signup = Signup.objects.get(user=user)

error = ""
if request.method == "POST":
title = request.POST['Title']
content = request.POST['Content']

try:
Notes.objects.create(signup=signup, Title=title, Content=content)
error = "no"
except:
error = "yes"
return render(request, 'addNotes.html', locals())

def viewNotes(request):
if not request.user.is_authenticated:
return redirect('user_login')
user = User.objects.get(id=request.user.id)
signup = Signup.objects.get(user=user)
notes = Notes.objects.filter(signup=signup)
return render(request, 'viewNotes.html', locals())

def editNotes(request,pid):
if not request.user.is_authenticated:
return redirect('user_login')
notes = Notes.objects.get(id=pid)
if request.method == "POST":
title = request.POST['Title']
content = request.POST['Content']

notes.Title = title
notes.Content = content

try:
notes.save()
error = "no"
except:
error = "yes"
return render(request, 'editNotes.html', locals())

def deleteNotes(request,pid):
if not request.user.is_authenticated:
return redirect('user_login')
notes = Notes.objects.get(id=pid)
notes.delete()
return redirect('viewNotes')

def changePassword(request):
if not request.user.is_authenticated:
return redirect('user_login')
error = ""
user = request.user
if request.method == "POST":
o = request.POST['oldpassword']
n = request.POST['newpassword']
try:
u = User.objects.get(id=request.user.id)
if user.check_password(o):
u.set_password(n)
u.save()
error = "no"
else:
error = 'not'
except:
error = "yes"
return render(request, 'changePassword.html', locals())

def Logout(request):
logout(request)
return redirect('index')

6.ASGI

"""
ASGI config for Enotes_Management_System project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see


https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""

import os
from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'Enotes_Management_System.settings')

application = get_asgi_application()

7.SETTINGS

"""
Django settings for Enotes_Management_System project.

Generated by 'django-admin startproject' using Django 3.2.12.

For more information on this file, see


https://docs.djangoproject.com/en/3.2/topics/settings/

For the full list of settings and their values, see


https://docs.djangoproject.com/en/3.2/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.


BASE_DIR = Path(__file__).resolve().parent.parent

# Quick-start development settings - unsuitable for production


# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!


SECRET_KEY = 'django-insecure-h=#p#1$e9vnd8_ke*nzr+=0(o7b49t2=3yf@tr#(f-7tyn
%u5-'

# SECURITY WARNING: don't run with debug turned on in production!


DEBUG = True

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [
'enotes',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'Enotes_Management_System.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'Enotes_Management_System.wsgi.application'

# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}

# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME':
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)


# https://docs.djangoproject.com/en/3.2/howto/static-files/

STATIC_URL = '/static/'

# Default primary key field type


# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

8.URLS

"""Enotes_Management_System URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from enotes.views import *

urlpatterns = [
path('admin/', admin.site.urls),
path('', index, name='index'),
path('about', about, name='about'),
path('register', register, name='register'),
path('user_login', user_login, name='user_login'),
path('dashboard', dashboard, name='dashboard'),
path('profile', profile, name='profile'),
path('addNotes', addNotes, name='addNotes'),
path('viewNotes', viewNotes, name='viewNotes'),
path('editNotes/<int:pid>', editNotes, name='editNotes'),
path('deleteNotes/<int:pid>', deleteNotes, name='deleteNotes'),
path('changePassword', changePassword, name='changePassword'),
path('logout', Logout, name='logout'),
]

9.WSGI

"""
WSGI config for Enotes_Management_System project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see


https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'Enotes_Management_System.settings')
application = get_wsgi_application()

10.MANAGE

#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'Enotes_Management_System.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)

if __name__ == '__main__':
main()

You might also like