Skip to content

Commit

Permalink
the new project
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhipradamohapatro120503 committed Jun 24, 2023
0 parents commit f3eff07
Show file tree
Hide file tree
Showing 35 changed files with 602 additions and 0 deletions.
Empty file added base/__init__.py
Empty file.
Binary file added base/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file added base/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file added base/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file added base/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file added base/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file added base/__pycache__/views.cpython-310.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions base/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.contrib import admin
from .models import Task

admin.site.register(Task)
6 changes: 6 additions & 0 deletions base/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class BaseConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'base'
31 changes: 31 additions & 0 deletions base/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 4.2.2 on 2023-06-22 09:47

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(blank=True, max_length=200, null=True)),
('description', models.TextField(blank=True, null=True)),
('complete', models.BooleanField(default=False)),
('create', models.DateTimeField(auto_now_add=True)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['complete'],
},
),
]
Empty file added base/migrations/__init__.py
Empty file.
Binary file not shown.
Binary file added base/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
15 changes: 15 additions & 0 deletions base/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.db import models
from django.contrib.auth.models import User

class Task(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
title = models.CharField(max_length=200, null=True, blank=True)
description = models.TextField(null=True, blank=True)
complete = models.BooleanField(default=False)
create = models.DateTimeField(auto_now_add=True)

def __str__(self):
return self.title

class Meta:
ordering = ['complete']
19 changes: 19 additions & 0 deletions base/templates/base/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends 'base/main.html' %}
{% block content %}

<div class="header-bar">
<h1>Login</h1>
</div>

<div class="card-body">
<form method="POST">
{% csrf_token %}
{{form.as_p}}
<input class="button" type="submit" value="Login">
</form>

<p>Don't have an account? <a href="{% url 'register' %}">Register</a></p>
</div>


{% endblock content %}
115 changes: 115 additions & 0 deletions base/templates/base/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bucket List</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Lobster+Two:ital,wght@0,400;0,700;1,400;1,700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,800;1,100;1,200;1,400;1,500;1,700;1,800;1,900&display=swap');
body{
background-color: #FF78C4;
font-family: 'Lobster Two', cursive;
padding: 50;
/* font-family: 'Poppins', sans-serif; */
}
.container{
max-width: 550px;
margin: auto;
background: linear-gradient(180deg ,#FFECEC 10%, #FFECEC 63%, #F273E6 90%);
-webkit-box-shadow: 2px 2px 13px -4px rgba(0,0,0,0.25);
box-shadow: 2p;
}

h1,
h2,
h3,
h4,
h5,
h6{
font-family: 'Lobster Two', cursive;
}
p{
color: black;
}
.header-bar{
display: flex;
justify-content: space-between;
color: #111111;
padding: 10px;
border-radius: 5px 5px 0 0;;
background: linear-gradient(90deg ,#FFBDF7 0%, #E1AEFF 43%, #E1AEFF 100%);
}
.header-bar a{
color: #e66969;
text-decoration: none;
}
.task-wrapper{
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
background-color: #A31ACB;
border-top: 1px solid #e0e0e0;
}
.task-title{
display: flex;
}
.task-title a{
text-decoration: none;
color: #fff;
margin-left: 10px;
font-size: 190%;
}
.delete-link{
text-decoration: none;
font-weight: 900;
font-size: 230%;
color: #fff;
line-height: 0;
}
#search-add-wrapper{
display: flex;
justify-content: space-between;
align-self: center;
padding: 10px;
background: linear-gradient(90deg ,#FFBDF7 0%, #E1AEFF 43%, #E1AEFF 100%);
}
#add-link{
color: rgb(76, 0, 255);
text-decoration: none;
font-size: 200%;
text-shadow: 1px 1px #F273E6;
}
input[type=text],input[type=password],textarea{
border: 1px solid #A31ACB;
border-radius: 5px;
padding: 10px;
width: 90%;
}
label{
padding-top: 10px !important;
display: block;
}
.button{
border: 1px solid #A31ACB;
background-color: #FFBDF7;
color: #A31ACB;
padding: 10px;
font-size: 14px;
border-radius: 5px;
cursor: pointer;
text-decoration: none;
}
.card-body{
padding: 20px;
}
</style>
</head>
<body>
<div class="container">
{% block content %}

{% endblock content %}
</div>
</body>
</html>
24 changes: 24 additions & 0 deletions base/templates/base/register.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% extends 'base/main.html' %}
{% block content %}
<div class="header-bar">
<h1>Register</h1>
</div>

<div class="card-body">
<form method="POST">
{% csrf_token %}
<label>{{form.username.label}}</label>
{{form.username}}
<label>{{form.password1.label}}</label>
{{form.password1}}
<label>{{form.password2.label}}</label>
{{form.password2}}
<input style="margin-top: 10px;" class="button" type="submit" value="Register">
</form>

<p>Already have an account? <a href="{% url 'login' %}">Click Hear</a></p>

</div>


{% endblock content %}
1 change: 1 addition & 0 deletions base/templates/base/task.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Task: {{task}}</h1>
16 changes: 16 additions & 0 deletions base/templates/base/task_confirm_delete.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends 'base/main.html' %}
{% block content %}

<div class="header-bar">
<a href="{% url 'tasks' %}">&#8592;Go Back</a>
</div>

<div class="card-body">
<form method="POST">
{% csrf_token %}
<p>Are you sure want to Delete List "{{task}}"</p>
<input class="button" type="submit" value="Delete"/>
</form>
</div>

{% endblock content %}
17 changes: 17 additions & 0 deletions base/templates/base/task_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends 'base/main.html' %}
{% block content %}
<div class="header-bar">
<a href="{% url 'tasks' %}">&#8592;Back</a>
</div>

<div class="card-body">
<form method="post" action="">
{% csrf_token %}
{{form.as_p}}
<input class="button" type="submit" value="Submit">
</form>
</div>



{% endblock content %}
52 changes: 52 additions & 0 deletions base/templates/base/task_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{% extends 'base/main.html' %}
{% block content %}

<div class="header-bar">
<div>
<h1>Hello {{request.user|title}}</h1>
<h3 style="margin: 0">You have <i>{{count}}</i> Incomplete Dream'{{ count|pluralize:"s" }}</h3>
</div>
{% if request.user.is_authenticated %}
<a href="{% url 'logout' %}">Logout</a>
{% else %}
<a href="{% url 'login' %}">Login</a>
{% endif %}
</div>

<div id="search-add-wrapper">
<form method="GET" style="margin-top: 20px;display: flex;">
<input type="text" name="search-area" value="{{search_input}}">
<input class="button" type="submit" value="Search">
</form>
<a id="add-link" href="{% url 'task-create' %}">&#x2b;</a>
</div>






<div class="task-item-wrapper">
{% for task in tasks %}
<div class="task-wrapper">
{% if task.complete %}
<div class="task-title">
<div class="task-complete">
<i><s><a href="{% url 'task-update' task.id %}">{{task}}</a></s></i>
</div>
</div>
{% else %}
<div class="task-title">
<div class="task-incomplete">
<a href="{% url 'task-update' task.id %}">{{task}}</a>
</div>
</div>
<a class="delete-link" href="{% url 'task-delete' task.id %}">&#xd7;</a>
{% endif %}
</div>
{% empty %}
<h3>No Items In List</h3>
{% endfor %}
</div>

{% endblock content %}
3 changes: 3 additions & 0 deletions base/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
14 changes: 14 additions & 0 deletions base/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django.urls import path
from .views import TaskList , TaskDetail, TaskCreate, TaskUpdate, TaskDelete, CustomLoginView, RegisterPage
from django.contrib.auth.views import LogoutView

urlpatterns = [
path('login/',CustomLoginView.as_view(),name='login'),
path('logout/',LogoutView.as_view(next_page='login'),name='logout'),
path('register/',RegisterPage.as_view(),name='register'),
path('',TaskList.as_view(),name='tasks'),
path('task/<int:pk>/',TaskDetail.as_view(),name='task'),
path('task-create',TaskCreate.as_view(),name='task-create'),
path('task-update/<int:pk>/',TaskUpdate.as_view(),name='task-update'),
path('task-delete/<int:pk>/',TaskDelete.as_view(),name='task-delete'),
]
Loading

0 comments on commit f3eff07

Please sign in to comment.