diff --git a/cookies.txt b/cookies.txt index 34ed13f..0800a77 100644 --- a/cookies.txt +++ b/cookies.txt @@ -2,4 +2,4 @@ # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -127.0.0.1 FALSE / TRUE 1796993740 csrftoken O0Vgh9DkmoXw8WCtMNdqOcunv8UiueAy +127.0.0.1 FALSE / TRUE 1796996344 csrftoken IrGUUOXEZVrbozn4KFZ3mbjM6jSNDc6h diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index fd44fb3..56fe35a 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 4390aa4..44bb6bd 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/templates/base.html b/core/templates/base.html index da53ecd..af40219 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -9,6 +9,7 @@ + {% if project_description %} @@ -26,6 +27,9 @@
- {% block content %}{% endblock %} + {% if user.is_authenticated %} + + {% endif %} +
+ {% block content %}{% endblock %} +
+ diff --git a/core/templates/core/campaign.html b/core/templates/core/campaign.html new file mode 100644 index 0000000..7b4ae79 --- /dev/null +++ b/core/templates/core/campaign.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block content %} +

Campaign Page

+{% endblock %} \ No newline at end of file diff --git a/core/templates/core/login.html b/core/templates/core/login.html index d96d7f1..246d7df 100644 --- a/core/templates/core/login.html +++ b/core/templates/core/login.html @@ -2,7 +2,7 @@ {% block title %}Login - MarketMatchr{% endblock %} -{% block content %} +{% block content_unauth %}
@@ -18,5 +18,4 @@
- -{% endblock %} +{% endblock content_unauth %} diff --git a/core/templates/core/messages.html b/core/templates/core/messages.html new file mode 100644 index 0000000..87392b5 --- /dev/null +++ b/core/templates/core/messages.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block content %} +

Messages Page

+{% endblock %} \ No newline at end of file diff --git a/core/templates/core/pricing.html b/core/templates/core/pricing.html index 7801d31..427cdef 100644 --- a/core/templates/core/pricing.html +++ b/core/templates/core/pricing.html @@ -2,7 +2,7 @@ {% block title %}Pricing - MarketMatchr{% endblock %} -{% block content %} +{% block content_unauth %}
@@ -64,4 +64,4 @@
-{% endblock %} \ No newline at end of file +{% endblock content_unauth %} \ No newline at end of file diff --git a/core/templates/core/search.html b/core/templates/core/search.html new file mode 100644 index 0000000..de22c24 --- /dev/null +++ b/core/templates/core/search.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} + +{% block content %} +

Search Page

+

This is the default page for logged-in users.

+{% endblock %} \ No newline at end of file diff --git a/core/templates/core/signup.html b/core/templates/core/signup.html index d2af04c..74c4a94 100644 --- a/core/templates/core/signup.html +++ b/core/templates/core/signup.html @@ -2,7 +2,7 @@ {% block title %}Sign Up - MarketMatchr{% endblock %} -{% block content %} +{% block content_unauth %}
@@ -51,4 +51,4 @@ roleInput.value = 'company'; }); -{% endblock %} \ No newline at end of file +{% endblock content_unauth %} \ No newline at end of file diff --git a/core/urls.py b/core/urls.py index f891ab5..1fecc0b 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,11 +1,15 @@ from django.urls import path +from django.contrib.auth.views import LogoutView -from .views import index, pricing, login, signup, dashboard +from .views import index, pricing, login, signup, search, campaign, messages urlpatterns = [ path("", index, name="index"), path("pricing/", pricing, name="pricing"), path("login/", login, name="login"), path("signup/", signup, name="signup"), - path("dashboard/", dashboard, name="dashboard"), + path("search/", search, name="search"), + path("campaign/", campaign, name="campaign"), + path("messages/", messages, name="messages"), + path("logout/", LogoutView.as_view(), name="logout"), ] diff --git a/core/views.py b/core/views.py index e450b28..80df44f 100644 --- a/core/views.py +++ b/core/views.py @@ -3,6 +3,8 @@ from django.contrib.auth import login as auth_login, authenticate from .forms import CompanySignUpForm, InfluencerSignUpForm, LoginForm def index(request): + if request.user.is_authenticated: + return redirect('search') return render(request, 'core/index.html') def pricing(request): @@ -17,7 +19,7 @@ def login(request): user = authenticate(username=username, password=password) if user is not None: auth_login(request, user) - return redirect('dashboard') + return redirect('search') else: form = LoginForm() return render(request, 'core/login.html', {'form': form}) @@ -31,10 +33,16 @@ def signup(request): if form.is_valid(): user = form.save() auth_login(request, user) - return redirect('dashboard') + return redirect('search') else: form = InfluencerSignUpForm() return render(request, 'core/signup.html', {'form': form}) -def dashboard(request): - return render(request, 'core/dashboard.html') \ No newline at end of file +def search(request): + return render(request, 'core/search.html') + +def campaign(request): + return render(request, 'core/campaign.html') + +def messages(request): + return render(request, 'core/messages.html') \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 73ab997..16b6f40 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,8 +1,66 @@ +main { + padding-top: 56px; +} + body { font-family: 'Lato', sans-serif; color: #333333; background-color: #F6F9FC; - padding-top: 70px; /* For fixed top navbar */ + transition: margin-left .5s; +} + +.content { + margin-left: 250px; + padding: 20px; + transition: margin-left .5s; +} + +.sidebar { + height: 100%; + width: 250px; + position: fixed; + z-index: 1; + top: 0; + left: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; +} + +.sidebar.collapsed { + width: 80px; +} + +.sidebar.collapsed a span { + display: none; +} + +.content.collapsed { + margin-left: 80px; +} + +.sidebar a { + padding: 10px 15px; + text-decoration: none; + font-size: 20px; + color: #818181; + display: block; +} + +.sidebar a:hover { + color: #f1f1f1; +} + +.sidebar a span { + margin-left: 10px; +} + +.sidebar-toggle { + background: none; + border: none; + color: #0A2540; + font-size: 24px; + cursor: pointer; } h1, h2, h3, h4, h5, h6 { diff --git a/static/js/sidebar.js b/static/js/sidebar.js new file mode 100644 index 0000000..15cecd0 --- /dev/null +++ b/static/js/sidebar.js @@ -0,0 +1,12 @@ +document.addEventListener("DOMContentLoaded", function() { + const sidebar = document.querySelector(".sidebar"); + const content = document.querySelector(".content"); + const toggleBtn = document.querySelector(".sidebar-toggle"); + + if (toggleBtn) { + toggleBtn.addEventListener("click", function() { + sidebar.classList.toggle("collapsed"); + content.classList.toggle("collapsed"); + }); + } +}); \ No newline at end of file diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 73ab997..16b6f40 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,8 +1,66 @@ +main { + padding-top: 56px; +} + body { font-family: 'Lato', sans-serif; color: #333333; background-color: #F6F9FC; - padding-top: 70px; /* For fixed top navbar */ + transition: margin-left .5s; +} + +.content { + margin-left: 250px; + padding: 20px; + transition: margin-left .5s; +} + +.sidebar { + height: 100%; + width: 250px; + position: fixed; + z-index: 1; + top: 0; + left: 0; + background-color: #111; + overflow-x: hidden; + transition: 0.5s; +} + +.sidebar.collapsed { + width: 80px; +} + +.sidebar.collapsed a span { + display: none; +} + +.content.collapsed { + margin-left: 80px; +} + +.sidebar a { + padding: 10px 15px; + text-decoration: none; + font-size: 20px; + color: #818181; + display: block; +} + +.sidebar a:hover { + color: #f1f1f1; +} + +.sidebar a span { + margin-left: 10px; +} + +.sidebar-toggle { + background: none; + border: none; + color: #0A2540; + font-size: 24px; + cursor: pointer; } h1, h2, h3, h4, h5, h6 { diff --git a/staticfiles/js/sidebar.js b/staticfiles/js/sidebar.js new file mode 100644 index 0000000..15cecd0 --- /dev/null +++ b/staticfiles/js/sidebar.js @@ -0,0 +1,12 @@ +document.addEventListener("DOMContentLoaded", function() { + const sidebar = document.querySelector(".sidebar"); + const content = document.querySelector(".content"); + const toggleBtn = document.querySelector(".sidebar-toggle"); + + if (toggleBtn) { + toggleBtn.addEventListener("click", function() { + sidebar.classList.toggle("collapsed"); + content.classList.toggle("collapsed"); + }); + } +}); \ No newline at end of file