diff --git a/config/__pycache__/urls.cpython-311.pyc b/config/__pycache__/urls.cpython-311.pyc index bff1ac9..28817aa 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/urls.py b/config/urls.py index 7fe8561..bcfc074 100644 --- a/config/urls.py +++ b/config/urls.py @@ -18,21 +18,10 @@ from django.contrib import admin from django.urls import include, path from django.conf import settings from django.conf.urls.static import static -from django.contrib.auth import views as auth_views -from core.views import SignUpView urlpatterns = [ path("admin/", admin.site.urls), path("", include("core.urls")), - path('signup/', SignUpView.as_view(), name='signup'), - path('login/', auth_views.LoginView.as_view(template_name='registration/login.html'), name='login'), - path('logout/', auth_views.LogoutView.as_view(), name='logout'), - path('password_change/', auth_views.PasswordChangeView.as_view(template_name='registration/password_change.html'), name='password_change'), - path('password_change/done/', auth_views.PasswordChangeDoneView.as_view(template_name='registration/password_change_done.html'), name='password_change_done'), - path('password_reset/', auth_views.PasswordResetView.as_view(template_name='registration/password_reset.html'), name='password_reset'), - path('password_reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='registration/password_reset_done.html'), name='password_reset_done'), - path('reset///', auth_views.PasswordResetConfirmView.as_view(template_name='registration/password_reset_confirm.html'), name='password_reset_confirm'), - path('reset/done/', auth_views.PasswordResetCompleteView.as_view(template_name='registration/password_reset_complete.html'), name='password_reset_complete'), ] if settings.DEBUG: diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc index 1988f9e..4dda475 100644 Binary files a/core/__pycache__/forms.cpython-311.pyc and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/mail.cpython-311.pyc b/core/__pycache__/mail.cpython-311.pyc deleted file mode 100644 index 8b4651f..0000000 Binary files a/core/__pycache__/mail.cpython-311.pyc and /dev/null differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 06a521c..6055c0d 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index f020e6a..648bd09 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 465fe3b..b7c676a 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/forms.py b/core/forms.py index a3fe62f..23cd219 100644 --- a/core/forms.py +++ b/core/forms.py @@ -1,19 +1,6 @@ from django import forms -from django.contrib.auth.forms import UserCreationForm -from django.contrib.auth.models import User from .models import MoodEntry, Activity -class DateRangeFilterForm(forms.Form): - start_date = forms.DateField(widget=forms.DateInput(attrs={'type': 'date', 'class': 'form-control'})) - end_date = forms.DateField(widget=forms.DateInput(attrs={'type': 'date', 'class': 'form-control'})) - -class SignUpForm(UserCreationForm): - email = forms.EmailField(max_length=254, help_text='Required. Inform a valid email address.') - - class Meta: - model = User - fields = ('username', 'email') - class MoodEntryForm(forms.ModelForm): activities = forms.ModelMultipleChoiceField( queryset=Activity.objects.all(), @@ -25,11 +12,6 @@ class MoodEntryForm(forms.ModelForm): model = MoodEntry fields = ['mood_score', 'note', 'activities'] widgets = { - 'mood_score': forms.NumberInput(attrs={'class': 'form-control', 'min': 1, 'max': 10}), - 'note': forms.Textarea(attrs={'class': 'form-control', 'rows': 4}), + 'mood_score': forms.NumberInput(attrs={'min': 1, 'max': 5}), + 'note': forms.Textarea(attrs={'rows': 4}), } - -class ContactForm(forms.Form): - name = forms.CharField(max_length=100, widget=forms.TextInput(attrs={'class': 'form-control'})) - email = forms.EmailField(widget=forms.EmailInput(attrs={'class': 'form-control'})) - message = forms.CharField(widget=forms.Textarea(attrs={'class': 'form-control', 'rows': 5})) diff --git a/core/mail.py b/core/mail.py deleted file mode 100644 index dfe626d..0000000 --- a/core/mail.py +++ /dev/null @@ -1,25 +0,0 @@ -from django.core.mail import send_mail -from django.conf import settings - -def send_contact_message(name, email, message): - """Sends an email from the contact form.""" - try: - subject = f'Contact Form Message from {name}' - message_body = f'You have received a new message from your website contact form.\n\n' \ - f'Here are the details:\n\n' \ - f'Name: {name}\n' \ - f'Email: {email}\n\n' \ - f'Message:\n{message}\n' - - send_mail( - subject, - message_body, - settings.DEFAULT_FROM_EMAIL, # from - [settings.CONTACT_EMAIL_TO], # to - fail_silently=False, - ) - return True - except Exception as e: - # In a real app, you'd want to log this error - print(e) - return False diff --git a/core/migrations/0002_note.py b/core/migrations/0002_note.py deleted file mode 100644 index 0a8df15..0000000 --- a/core/migrations/0002_note.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 5.2.7 on 2025-12-22 19:21 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='Note', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=255)), - ('content', models.TextField()), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/core/migrations/__pycache__/0002_note.cpython-311.pyc b/core/migrations/__pycache__/0002_note.cpython-311.pyc deleted file mode 100644 index 8b75bf3..0000000 Binary files a/core/migrations/__pycache__/0002_note.cpython-311.pyc and /dev/null differ diff --git a/core/models.py b/core/models.py index 26c79ca..16f0a31 100644 --- a/core/models.py +++ b/core/models.py @@ -35,14 +35,4 @@ class MoodEntry(models.Model): mission = models.ForeignKey(Mission, on_delete=models.SET_NULL, null=True, blank=True) def __str__(self): - return f'{self.user.username} - {self.date_time.strftime("%Y-%m-%d")}' - -class Note(models.Model): - user = models.ForeignKey(User, on_delete=models.CASCADE) - title = models.CharField(max_length=255) - content = models.TextField() - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) - - def __str__(self): - return self.title \ No newline at end of file + return f'{self.user.username} - {self.date_time.strftime("%Y-%m-%d")}' \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 6fe0115..9b2be9d 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,9 +1,9 @@ - + - {% block title %}PixelMinds{% endblock %} + {% block title %}Knowledge Base{% endblock %} {% if project_description %} @@ -13,109 +13,28 @@ {% endif %} - {% load static %} - - {% block head %}{% endblock %} - -
- -
- -
- {% block content %}{% endblock %} -
- - - - + + {% block content %}{% endblock %} - \ No newline at end of file + diff --git a/core/templates/core/about.html b/core/templates/core/about.html deleted file mode 100644 index f725703..0000000 --- a/core/templates/core/about.html +++ /dev/null @@ -1,58 +0,0 @@ -{% extends 'base.html' %} -{% load static %} - -{% block title %}About Us - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-

About PixelMinds

-

We are a team of passionate developers, designers, and healthcare professionals dedicated to helping you live a healthier, happier life.

-
-
-
-
- -
-
-
-
-

Our Mission

-

Our mission is to make mental and physical health tracking simple, accessible, and insightful for everyone. We believe that technology can empower individuals to take control of their well-being by providing them with the right tools and data-driven guidance.

-

We leverage cutting-edge AI to provide you with personalized insights and recommendations based on your mood and activity data. By understanding your patterns, you can make informed decisions to improve your well-being.

-
-
- Health Innovation -
-
-
-
- -
-
-
-

Meet the Team

-

A small group with a big vision.

-
-
-
- Team Member -
Alex Vance
-

Lead Developer

-
-
- Team Member -
Brenda Shaw
-

UX Designer

-
-
- Team Member -
Dr. Carlin Day
-

Health Advisor

-
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/core/contact.html b/core/templates/core/contact.html deleted file mode 100644 index ae56f1f..0000000 --- a/core/templates/core/contact.html +++ /dev/null @@ -1,61 +0,0 @@ -{% extends 'base.html' %} -{% load static %} - -{% block title %}Contact Us - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-

Get in Touch

-

We'd love to hear from you. Whether you have a question, feedback, or just want to say hello, please don't hesitate to reach out.

-
-
-
-
- -
-
-
-
- - {% if messages %} - {% for message in messages %} - - {% endfor %} - {% endif %} - -
-
-
- {% csrf_token %} -
- {{ form.name.label_tag }} - {{ form.name }} - {% if form.name.errors %}
{{ form.name.errors|striptags }}
{% endif %} -
-
- {{ form.email.label_tag }} - {{ form.email }} - {% if form.email.errors %}
{{ form.email.errors|striptags }}
{% endif %} -
-
- {{ form.message.label_tag }} - {{ form.message }} - {% if form.message.errors %}
{{ form.message.errors|striptags }}
{% endif %} -
-
- -
-
-
-
-
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/core/dashboard.html b/core/templates/core/dashboard.html index 5f64843..0accf32 100644 --- a/core/templates/core/dashboard.html +++ b/core/templates/core/dashboard.html @@ -1,113 +1,49 @@ {% extends 'base.html' %} -{% load static %} - -{% block title %}Dashboard - PixelMinds{% endblock %} {% block head %} - {% endblock %} {% block content %} -
-
-
-
-

Your Dashboard

-

An overview of your mood entries.

-
- -
- -
-
-
Filter by Date
-
-
- - {{ form.start_date }} -
-
- - {{ form.end_date }} -
-
- -
-
-
-
- -
-
-
Mood Over Time
- {% if chart_data != '[]' %} - - {% else %} -
-

No mood entries found for the selected period.

-

Try adjusting the filter or add a new entry.

-
- {% endif %} -
-
-
-
+
+

Mood Dashboard

+ +
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index ecbc122..5a49aca 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,84 +1,55 @@ {% extends 'base.html' %} -{% load static %} -{% block title %}PixelMinds - Your Personal Health Companion{% endblock %} +{% block title %}{{ project_name }}{% endblock %} {% block content %} -
-
+
+
+
+

Welcome to {{ project_name }}

+

Your personal space to reflect and grow.

+
+
+ {% if user.is_authenticated %} + + Log New Mood + {% else %} + Log In + {% endif %} +
+
+ + {% if user.is_authenticated %} +

Your Recent Moods

+ {% if mood_entries %} +
+ {% for entry in mood_entries %} +
+
+
Mood Score: {{ entry.mood_score }}/5
+ {{ entry.date_time|date:"Y-m-d H:i" }} +
+

{{ entry.note|truncatewords:30 }}

+ {% if entry.activities.all %} + Activities: + {% for activity in entry.activities.all %} + {{ activity.name }} + {% endfor %} + + {% endif %} +
+ {% endfor %} +
+ {% else %} +

You haven't logged any moods yet. Get started!

+ {% endif %} + {% else %} +
+
+

Track Your Mental Wellness

+

Gain insights into your moods and activities to better understand your mental health. Log in to begin your journey.

+ Log In & Get Started +
+
+ {% endif %}
- -{% include 'core/mood_modal.html' %} -{% endblock %} - -{% block extra_js %} - {% endblock %} diff --git a/core/templates/core/mood_entry_form.html b/core/templates/core/mood_entry_form.html index d4d6fdb..8893d25 100644 --- a/core/templates/core/mood_entry_form.html +++ b/core/templates/core/mood_entry_form.html @@ -1,64 +1,57 @@ {% extends 'base.html' %} -{% load static %} - -{% block title %}New Mood Entry - PixelMinds{% endblock %} {% block content %} -
-
-
-
-
-
-

How are you feeling?

-
- {% csrf_token %} - -
- - {{ form.mood_score }} - {% if form.mood_score.errors %} -
- {{ form.mood_score.errors|striptags }} -
- {% endif %} -
- -
- - {{ form.note }} - {% if form.note.errors %} -
- {{ form.note.errors|striptags }} -
- {% endif %} -
- -
- -
- {% for checkbox in form.activities %} -
- {{ checkbox.tag }} - -
- {% endfor %} +
+
+
+
+

Track Your Mood

+
+ + {% csrf_token %} + +
+ + {{ form.mood_score }} + {% if form.mood_score.errors %} +
+ {{ form.mood_score.errors|striptags }}
- {% if form.activities.errors %} -
- {{ form.activities.errors|striptags }} -
- {% endif %} -
+ {% endif %} +
-
- +
+ + {{ form.note }} + {% if form.note.errors %} +
+ {{ form.note.errors|striptags }} +
+ {% endif %} +
+ +
+ +
+ {% for checkbox in form.activities %} +
+ {{ checkbox.tag }} + +
+ {% endfor %}
- -
+ {% if form.activities.errors %} +
+ {{ form.activities.errors|striptags }} +
+ {% endif %} +
+ + +
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/core/templates/core/mood_modal.html b/core/templates/core/mood_modal.html deleted file mode 100644 index 387edb4..0000000 --- a/core/templates/core/mood_modal.html +++ /dev/null @@ -1,21 +0,0 @@ - diff --git a/core/templates/core/privacy_policy.html b/core/templates/core/privacy_policy.html deleted file mode 100644 index 8a04fd0..0000000 --- a/core/templates/core/privacy_policy.html +++ /dev/null @@ -1,50 +0,0 @@ -{% extends 'base.html' %} -{% load static %} - -{% block title %}Privacy Policy - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-
-

Privacy Policy

-

Your privacy is important to us. Last updated: December 22, 2025

-
- -

It is PixelMinds's policy to respect your privacy regarding any information we may collect from you across our website. This Privacy Policy applies to all of our services.

- -

1. Information We Collect

-

We only collect information about you if we have a reason to do so – for example, to provide our services, to communicate with you, or to make our services better. We collect this information from three sources: if and when you provide information to us, automatically through operating our services, and from outside sources.

- -

Information You Provide to Us

-
    -
  • Account Information: We collect information from you when you create an account, such as your name, email address, and password.
  • -
  • Health Data: We collect the mood scores, notes, and activities you log through our service.
  • -
- -

2. How We Use Information

-

We use the information we collect in various ways, including to:

-
    -
  • Provide, operate, and maintain our website and services.
  • -
  • Improve, personalize, and expand our services.
  • -
  • Understand and analyze how you use our services.
  • -
  • Develop new products, services, features, and functionality.
  • -
  • Communicate with you for customer service, updates, and marketing purposes.
  • -
- -

3. Security

-

We take reasonable precautions and follow industry best practices to protect your personal information and ensure that it is not inappropriately lost, misused, accessed, disclosed, altered, or destroyed.

- -

4. Changes to This Policy

-

We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page. You are advised to review this Privacy Policy periodically for any changes.

- -
-

This is a generic, placeholder privacy policy. It is not legal advice. You must consult with a legal professional to create a policy that is compliant with all applicable laws and regulations for your business.

- -
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/login.html b/core/templates/registration/login.html deleted file mode 100644 index 5e69616..0000000 --- a/core/templates/registration/login.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}Login - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-
-
-

Welcome Back

- - {% if form.errors %} - - {% endif %} - -
- {% csrf_token %} -
- - -
-
- - -
-
- -
-

Forgot password?

-
-
-
-

Don't have an account? Sign up

-
-
-
-
-{% endblock %} diff --git a/core/templates/registration/password_change.html b/core/templates/registration/password_change.html deleted file mode 100644 index 6460f72..0000000 --- a/core/templates/registration/password_change.html +++ /dev/null @@ -1,48 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}Change Password - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-
-

Change Password

-
-
- {% csrf_token %} - {% if form.non_field_errors %} - - {% endif %} - - {% for field in form %} -
- - {{ field }} - {% if field.help_text %} - {{ field.help_text|safe }} - {% endif %} - {% for error in field.errors %} -
- {{ error }} -
- {% endfor %} -
- {% endfor %} - -
- -
-
-
-
-
-
-
-
-{% endblock %} diff --git a/core/templates/registration/password_change_done.html b/core/templates/registration/password_change_done.html deleted file mode 100644 index 6d00fc8..0000000 --- a/core/templates/registration/password_change_done.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}Password Change Complete - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-
-

Password Change Complete

-
-

Your password has been successfully changed.

- Return to Home -
-
-
-
-
-
-{% endblock %} diff --git a/core/templates/registration/password_reset.html b/core/templates/registration/password_reset.html deleted file mode 100644 index 4c54855..0000000 --- a/core/templates/registration/password_reset.html +++ /dev/null @@ -1,53 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}Forgot Your Password? - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-
-

Password Recovery

-
-
Enter your email address and we will send you a link to reset your password.
-
- {% csrf_token %} - {% if form.non_field_errors %} - - {% endif %} - - {% for field in form %} -
- - {{ field }} - {% if field.help_text %} - {{ field.help_text }} - {% endif %} - {% for error in field.errors %} -
- {{ error }} -
- {% endfor %} -
- {% endfor %} - -
- Return to login - -
-
-
- -
-
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/password_reset_complete.html b/core/templates/registration/password_reset_complete.html deleted file mode 100644 index 4690178..0000000 --- a/core/templates/registration/password_reset_complete.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}Password Reset Complete - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-
-

Password Reset Complete

-
-

Your password has been set. You may go ahead and log in now.

- Return to Login -
-
-
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/password_reset_confirm.html b/core/templates/registration/password_reset_confirm.html deleted file mode 100644 index 492c3f4..0000000 --- a/core/templates/registration/password_reset_confirm.html +++ /dev/null @@ -1,58 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}Enter New Password - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-
- {% if validlink %} -

Reset Password

-
-

Please enter your new password twice so we can verify you typed it in correctly.

-
- {% csrf_token %} - {% if form.non_field_errors %} - - {% endif %} - - {% for field in form %} -
- - {{ field }} - {% if field.help_text %} - {{ field.help_text|safe }} - {% endif %} - {% for error in field.errors %} -
- {{ error }} -
- {% endfor %} -
- {% endfor %} - -
- -
-
-
- {% else %} -

Password Reset Failed

-
-

The password reset link was invalid, possibly because it has already been used.

-

Please request a new password reset.

- Request a New Password Reset -
- {% endif %} -
-
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/password_reset_done.html b/core/templates/registration/password_reset_done.html deleted file mode 100644 index 83ff84b..0000000 --- a/core/templates/registration/password_reset_done.html +++ /dev/null @@ -1,22 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}Password Reset Sent - PixelMinds{% endblock %} - -{% block content %} -
-
-
-
-
-

Password Reset Sent

-
-

We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.

-

If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder.

- Return to Login -
-
-
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/signup.html b/core/templates/registration/signup.html deleted file mode 100644 index ae29338..0000000 --- a/core/templates/registration/signup.html +++ /dev/null @@ -1,50 +0,0 @@ -{% extends 'base.html' %} -{% load static %} - -{% block content %} -
-
-
-
-
-

Create Account

-
-
- {% csrf_token %} - {% if form.non_field_errors %} - - {% endif %} - - {% for field in form %} -
- - {{ field }} - {% if field.help_text %} - {{ field.help_text }} - {% endif %} - {% for error in field.errors %} -
- {{ error }} -
- {% endfor %} -
- {% endfor %} - -
- -
-
-
- -
-
-
-
-
-{% endblock %} \ No newline at end of file diff --git a/core/urls.py b/core/urls.py index 605eb4f..8b96229 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,16 +1,11 @@ from django.urls import path -from .views import home, create_mood_entry, dashboard, AboutView, ContactView, PrivacyPolicyView, SignUpView, save_mood_entry +from .views import home, create_mood_entry, dashboard app_name = 'core' urlpatterns = [ path("", home, name="index"), - path('signup/', SignUpView.as_view(), name='signup'), path('mood/new/', create_mood_entry, name='create_mood_entry'), - path('mood/save/', save_mood_entry, name='save_mood_entry'), path('dashboard/', dashboard, name='dashboard'), - path('about/', AboutView.as_view(), name='about'), - path('contact/', ContactView.as_view(), name='contact'), - path('privacy-policy/', PrivacyPolicyView.as_view(), name='privacy_policy'), ] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c7eb742..4108665 100644 --- a/core/views.py +++ b/core/views.py @@ -1,55 +1,14 @@ import os import platform -import json from django import get_version as django_version from django.shortcuts import render, redirect -from django.urls import reverse_lazy from django.utils import timezone from django.contrib.auth.decorators import login_required from django.http import JsonResponse -from django.views.generic import TemplateView, FormView, CreateView +from .forms import MoodEntryForm +from .models import MoodEntry from django_pandas.io import read_frame -from django.contrib import messages - -from .forms import MoodEntryForm, ContactForm, SignUpForm, DateRangeFilterForm -from .models import MoodEntry, Activity -from .mail import send_contact_message - - -class SignUpView(CreateView): - form_class = SignUpForm - success_url = reverse_lazy('login') - template_name = 'registration/signup.html' - - -class AboutView(TemplateView): - template_name = "core/about.html" - - -class ContactView(FormView): - template_name = "core/contact.html" - form_class = ContactForm - success_url = reverse_lazy('core:contact') - - def form_valid(self, form): - name = form.cleaned_data['name'] - email = form.cleaned_data['email'] - message = form.cleaned_data['message'] - - # Send email - email_sent = send_contact_message(name, email, message) - - if email_sent: - messages.success(self.request, 'Thank you for your message! We will get back to you shortly.') - else: - messages.error(self.request, 'Sorry, there was an error sending your message. Please try again later.') - - return super().form_valid(form) - - -class PrivacyPolicyView(TemplateView): - template_name = "core/privacy_policy.html" def home(request): @@ -60,8 +19,6 @@ def home(request): if request.user.is_authenticated: mood_entries = MoodEntry.objects.filter(user=request.user).order_by('-date_time')[:7] context['mood_entries'] = mood_entries - activities = Activity.objects.all() - context['activities'] = activities return render(request, "core/index.html", context) @@ -69,20 +26,10 @@ def home(request): @login_required def dashboard(request): mood_entries = MoodEntry.objects.filter(user=request.user).order_by('date_time') - form = DateRangeFilterForm(request.GET) - if form.is_valid(): - start_date = form.cleaned_data.get('start_date') - end_date = form.cleaned_data.get('end_date') - if start_date: - mood_entries = mood_entries.filter(date_time__gte=start_date) - if end_date: - mood_entries = mood_entries.filter(date_time__lte=end_date) - df = read_frame(mood_entries, fieldnames=['date_time', 'mood_score']) - if not df.empty: - df['date_time'] = df['date_time'].dt.strftime('%Y-%m-%d') + df['date_time'] = df['date_time'].dt.strftime('%Y-%m-%d') chart_data = df.to_json(orient='records') - return render(request, 'core/dashboard.html', {'chart_data': chart_data, 'form': form}) + return render(request, 'core/dashboard.html', {'chart_data': chart_data}) @login_required @@ -113,23 +60,3 @@ def create_mood_entry(request): form = MoodEntryForm() return render(request, 'core/mood_entry_form.html', {'form': form}) - -@login_required -def save_mood_entry(request): - if request.method == 'POST': - data = json.loads(request.body) - mood_score = data.get('mood_score') - activity_ids = data.get('activity_ids') - - mood_entry = MoodEntry.objects.create( - user=request.user, - mood_score=mood_score - ) - - if activity_ids: - activities = Activity.objects.filter(id__in=activity_ids) - mood_entry.activities.set(activities) - - return JsonResponse({'status': 'success'}) - return JsonResponse({'status': 'error'}, status=400) - diff --git a/static/css/custom.css b/static/css/custom.css index 0ad6952..925f6ed 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,232 +1,4 @@ - -@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Lexend+Deca:wght@600;700&display=swap'); - -:root { - --primary-color: #8a2be2; /* Deep purple */ - --secondary-color: #4b0082; /* Indigo */ - --light-gray: #f8f9fa; - --dark-gray: #1f2937; - --text-color: #e0e0e0; /* Lighter text for dark background */ -} - +/* Custom styles for the application */ body { - font-family: 'Inter', sans-serif; - color: var(--text-color); - background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); - background-size: 400% 400%; - animation: gradient 15s ease infinite; - height: 100vh; - overflow: hidden; /* Prevent scrollbars */ + font-family: system-ui, -apple-system, sans-serif; } - -@keyframes gradient { - 0% { - background-position: 0% 50%; - } - 50% { - background-position: 100% 50%; - } - 100% { - background-position: 0% 50%; - } -} - -.breathing-canvas { - display: flex; - justify-content: center; - align-items: center; - height: 100%; - position: relative; -} - -.pulsing-circle { - width: 80px; - height: 80px; - background-color: rgba(255, 255, 255, 0.8); - border-radius: 50%; - cursor: pointer; - animation: pulse 2s infinite; - box-shadow: 0 0 20px rgba(255, 255, 255, 0.5); - position: absolute; - bottom: 50px; -} - -@keyframes pulse { - 0% { - transform: scale(0.95); - box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); - } - 70% { - transform: scale(1); - box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); - } - 100% { - transform: scale(0.95); - box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); - } -} - -.fw-medium { - font-weight: 500; -} - -.fw-semibold { - font-weight: 600; -} - -.fw-bold { - font-weight: 700; -} - -.navbar { - background-color: transparent !important; - position: absolute; - width: 100%; - top: 0; - z-index: 10; -} - -.navbar-brand { - font-family: 'Lexend Deca', sans-serif; - font-weight: 700; - color: var(--text-color) !important; -} - -.nav-link { - color: var(--text-color) !important; -} - -.btn-primary { - background-color: transparent; - border-color: var(--text-color); - padding: 0.75rem 1.5rem; - font-weight: 500; - transition: all 0.2s ease-in-out; - color: var(--text-color); -} - -.btn-primary:hover { - background-color: rgba(255, 255, 255, 0.1); - border-color: var(--text-color); -} - -.footer { - position: absolute; - bottom: 0; - width: 100%; - background-color: transparent; -} - -/* Modal styles */ -.modal { - display: none; - position: fixed; - z-index: 100; - left: 0; - top: 0; - width: 100%; - height: 100%; - overflow: auto; - background-color: rgba(0, 0, 0, 0.4); -} - -.modal-content { - background-color: #1f2937; - margin: 15% auto; - padding: 20px; - border: 1px solid #888; - width: 80%; - max-width: 500px; - border-radius: 20px; - animation: bloom 0.5s ease-out; -} - -@keyframes bloom { - from { - transform: scale(0); - } - to { - transform: scale(1); - } -} - -.close-button { - color: #aaa; - float: right; - font-size: 28px; - font-weight: bold; -} - -.close-button:hover, -.close-button:focus { - color: white; - text-decoration: none; - cursor: pointer; -} - -/* Mood slider */ -.mood-slider-container { - margin: 20px 0; -} - -.mood-slider { - -webkit-appearance: none; - width: 100%; - height: 15px; - border-radius: 5px; - background: #ddd; - outline: none; - opacity: 0.7; - -webkit-transition: .2s; - transition: opacity .2s; -} - -.mood-slider:hover { - opacity: 1; -} - -.mood-slider::-webkit-slider-thumb { - -webkit-appearance: none; - appearance: none; - width: 25px; - height: 25px; - border-radius: 50%; - background: var(--primary-color); - cursor: pointer; -} - -.mood-slider::-moz-range-thumb { - width: 25px; - height: 25px; - border-radius: 50%; - background: var(--primary-color); - cursor: pointer; -} - -.mood-labels { - display: flex; - justify-content: space-between; - margin-top: 10px; -} - -/* Activity bubbles */ -.activity-bubbles { - display: flex; - flex-wrap: wrap; - justify-content: center; - gap: 15px; - margin: 20px 0; -} - -.activity-bubble { - padding: 10px 20px; - border-radius: 20px; - background-color: #4b5563; - cursor: pointer; - transition: background-color 0.3s; -} - -.activity-bubble.selected { - background-color: var(--primary-color); -} - diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 0ad6952..108056f 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,232 +1,21 @@ -@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Lexend+Deca:wght@600;700&display=swap'); - :root { - --primary-color: #8a2be2; /* Deep purple */ - --secondary-color: #4b0082; /* Indigo */ - --light-gray: #f8f9fa; - --dark-gray: #1f2937; - --text-color: #e0e0e0; /* Lighter text for dark background */ + --bg-color-start: #6a11cb; + --bg-color-end: #2575fc; + --text-color: #ffffff; + --card-bg-color: rgba(255, 255, 255, 0.01); + --card-border-color: rgba(255, 255, 255, 0.1); } - body { + margin: 0; font-family: 'Inter', sans-serif; + background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); color: var(--text-color); - background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)); - background-size: 400% 400%; - animation: gradient 15s ease infinite; - height: 100vh; - overflow: hidden; /* Prevent scrollbars */ -} - -@keyframes gradient { - 0% { - background-position: 0% 50%; - } - 50% { - background-position: 100% 50%; - } - 100% { - background-position: 0% 50%; - } -} - -.breathing-canvas { display: flex; justify-content: center; align-items: center; - height: 100%; + min-height: 100vh; + text-align: center; + overflow: hidden; position: relative; } - -.pulsing-circle { - width: 80px; - height: 80px; - background-color: rgba(255, 255, 255, 0.8); - border-radius: 50%; - cursor: pointer; - animation: pulse 2s infinite; - box-shadow: 0 0 20px rgba(255, 255, 255, 0.5); - position: absolute; - bottom: 50px; -} - -@keyframes pulse { - 0% { - transform: scale(0.95); - box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); - } - 70% { - transform: scale(1); - box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); - } - 100% { - transform: scale(0.95); - box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); - } -} - -.fw-medium { - font-weight: 500; -} - -.fw-semibold { - font-weight: 600; -} - -.fw-bold { - font-weight: 700; -} - -.navbar { - background-color: transparent !important; - position: absolute; - width: 100%; - top: 0; - z-index: 10; -} - -.navbar-brand { - font-family: 'Lexend Deca', sans-serif; - font-weight: 700; - color: var(--text-color) !important; -} - -.nav-link { - color: var(--text-color) !important; -} - -.btn-primary { - background-color: transparent; - border-color: var(--text-color); - padding: 0.75rem 1.5rem; - font-weight: 500; - transition: all 0.2s ease-in-out; - color: var(--text-color); -} - -.btn-primary:hover { - background-color: rgba(255, 255, 255, 0.1); - border-color: var(--text-color); -} - -.footer { - position: absolute; - bottom: 0; - width: 100%; - background-color: transparent; -} - -/* Modal styles */ -.modal { - display: none; - position: fixed; - z-index: 100; - left: 0; - top: 0; - width: 100%; - height: 100%; - overflow: auto; - background-color: rgba(0, 0, 0, 0.4); -} - -.modal-content { - background-color: #1f2937; - margin: 15% auto; - padding: 20px; - border: 1px solid #888; - width: 80%; - max-width: 500px; - border-radius: 20px; - animation: bloom 0.5s ease-out; -} - -@keyframes bloom { - from { - transform: scale(0); - } - to { - transform: scale(1); - } -} - -.close-button { - color: #aaa; - float: right; - font-size: 28px; - font-weight: bold; -} - -.close-button:hover, -.close-button:focus { - color: white; - text-decoration: none; - cursor: pointer; -} - -/* Mood slider */ -.mood-slider-container { - margin: 20px 0; -} - -.mood-slider { - -webkit-appearance: none; - width: 100%; - height: 15px; - border-radius: 5px; - background: #ddd; - outline: none; - opacity: 0.7; - -webkit-transition: .2s; - transition: opacity .2s; -} - -.mood-slider:hover { - opacity: 1; -} - -.mood-slider::-webkit-slider-thumb { - -webkit-appearance: none; - appearance: none; - width: 25px; - height: 25px; - border-radius: 50%; - background: var(--primary-color); - cursor: pointer; -} - -.mood-slider::-moz-range-thumb { - width: 25px; - height: 25px; - border-radius: 50%; - background: var(--primary-color); - cursor: pointer; -} - -.mood-labels { - display: flex; - justify-content: space-between; - margin-top: 10px; -} - -/* Activity bubbles */ -.activity-bubbles { - display: flex; - flex-wrap: wrap; - justify-content: center; - gap: 15px; - margin: 20px 0; -} - -.activity-bubble { - padding: 10px 20px; - border-radius: 20px; - background-color: #4b5563; - cursor: pointer; - transition: background-color 0.3s; -} - -.activity-bubble.selected { - background-color: var(--primary-color); -} -