From e858c939c6963a4e2a4b992622c5c6a7a04020e9 Mon Sep 17 00:00:00 2001 From: Innocent Zenda Date: Sun, 5 Nov 2023 12:27:39 +0300 Subject: [PATCH] minor fixes --- README.md | 76 +++++++++---------- pim/contacts/admin.py | 1 + ...act_avatar_alter_contact_email_and_more.py | 62 +++++++++++++++ pim/contacts/models.py | 4 +- .../templates/contacts/contact_detail.html | 4 +- pim/contacts/templates/contacts/index.html | 2 +- templates/account/login.html | 6 -- 7 files changed, 107 insertions(+), 48 deletions(-) create mode 100644 pim/contacts/migrations/0010_alter_contact_avatar_alter_contact_email_and_more.py diff --git a/README.md b/README.md index 92a7c76..9721b1b 100644 --- a/README.md +++ b/README.md @@ -6,43 +6,43 @@ An application to help organize personal data and information. - [x] **User Registration and Authentication** - Register, login and logout securily. + Register, login and logout securily. - [x] **Task and To-Do Lists** - Create and manage to-do lists and tasks with due dates and priority level. + Create and manage to-do lists and tasks with due dates and priority level. -- [ ] **Contact Management** +- [x] **Contact Management** - Store and manage contacts including names, addresses, phone numbers, email addresses, and additional notes. + Store and manage contacts including names, addresses, phone numbers, email addresses, and additional notes. -- [ ] **Notes and Memo** +- [x] **Notes and Memo** - Capture and organize notes, ideas, and memos in different categories or tags. + Capture and organize notes, ideas, and memos in different categories or tags. - [ ] **Calendar and Event Management** - A calendar to schedule, visualize and manage events, appointments, tasks and reminders. + A calendar to schedule, visualize and manage events, appointments, tasks and reminders. - [ ] **Search and Filters** - Efficient search functionality and filters to quickly find specific information. + Efficient search functionality and filters to quickly find specific information. - [ ] **Customizable Categories and Tags** - Create your own custom categories and tags for organizing data. + Create your own custom categories and tags for organizing data. - [ ] **Import and Export** - Capability to import existing data and export it in various formats. + Capability to import existing data and export it in various formats. - [ ] **Reminders and Notifications** - Reminders and notifications sent for upcoming events and tasks. + Reminders and notifications sent for upcoming events and tasks. - [ ] **File Storage** - Safely store and manage files and attachments related to contacts, events and tasks. + Safely store and manage files and attachments related to contacts, events and tasks. ## Getting Started @@ -58,51 +58,51 @@ An application to help organize personal data and information. 2. Clone the forked repository - ```bash - git clone https://github.com//personal-information-manager - ``` + ```bash + git clone https://github.com//personal-information-manager + ``` 3. Create and activate virtual environment - ```bash - py -m venv .venv + ```bash + py -m venv .venv - source .venv/bin/activate - .venv/scripts/activate # windows - ``` + source .venv/bin/activate + .venv/scripts/activate # windows + ``` 4. Install Project Dependencies - ```bash - pip install pipenv # this project use pipenv to manage packages - pipenv install --dev - ``` + ```bash + pip install pipenv # this project use pipenv to manage packages + pipenv install --dev + ``` - Rename '.env_sample' to '.env', the fill the value accordingly. + Rename '.env_sample' to '.env', the fill the value accordingly. - Install the git hook script for pre-commit + Install the git hook script for pre-commit - ```bash - pre-commit install - ``` + ```bash + pre-commit install + ``` 5. Apply database migrations - ```bash - py manage.py migrate - ``` + ```bash + py manage.py migrate + ``` 6. Create superuser for admin access - ```bash - py manage.py createsuperuser - ``` + ```bash + py manage.py createsuperuser + ``` 7. Run the development server - ```bash - py manage.py runserver - ``` + ```bash + py manage.py runserver + ``` 8. Access your app in your browser at `http://localhost:8000` diff --git a/pim/contacts/admin.py b/pim/contacts/admin.py index ca391c5..9cc991c 100644 --- a/pim/contacts/admin.py +++ b/pim/contacts/admin.py @@ -11,4 +11,5 @@ class ContactAdmin(admin.ModelAdmin): 'is_favorite', 'email', 'phone_number', + 'user', ] diff --git a/pim/contacts/migrations/0010_alter_contact_avatar_alter_contact_email_and_more.py b/pim/contacts/migrations/0010_alter_contact_avatar_alter_contact_email_and_more.py new file mode 100644 index 0000000..f0cd843 --- /dev/null +++ b/pim/contacts/migrations/0010_alter_contact_avatar_alter_contact_email_and_more.py @@ -0,0 +1,62 @@ +# Generated by Django 4.2.7 on 2023-11-05 09:15 + +import phonenumber_field.modelfields +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('contacts', '0009_contact_organization'), + ] + + operations = [ + migrations.AlterField( + model_name='contact', + name='avatar', + field=models.ImageField( + blank=True, + default='avatars/User Avatar.jpg', + null=True, + upload_to='avatars', + verbose_name='avatar', + ), + ), + migrations.AlterField( + model_name='contact', + name='email', + field=models.EmailField( + blank=True, max_length=254, null=True, verbose_name='email' + ), + ), + migrations.AlterField( + model_name='contact', + name='is_favorite', + field=models.BooleanField(default=False, verbose_name='is favorite'), + ), + migrations.AlterField( + model_name='contact', + name='name', + field=models.CharField(max_length=100, verbose_name='name'), + ), + migrations.AlterField( + model_name='contact', + name='organization', + field=models.CharField( + blank=True, max_length=100, null=True, verbose_name='organization' + ), + ), + migrations.AlterField( + model_name='contact', + name='phone_number', + field=phonenumber_field.modelfields.PhoneNumberField( + max_length=128, region=None, verbose_name='phone number' + ), + ), + migrations.AlterField( + model_name='contact', + name='title', + field=models.CharField( + blank=True, max_length=100, null=True, verbose_name='title' + ), + ), + ] diff --git a/pim/contacts/models.py b/pim/contacts/models.py index aad9757..805a316 100644 --- a/pim/contacts/models.py +++ b/pim/contacts/models.py @@ -18,10 +18,10 @@ class Contact(models.Model): title = models.CharField(_('title'), max_length=100, blank=True, null=True) avatar = models.ImageField( _('avatar'), - upload_to='media/avatars', + upload_to='avatars', blank=True, null=True, - default='static/images/User Avatar.jpg', + default='avatars/User Avatar.jpg', ) is_favorite = models.BooleanField(_('is favorite'), default=False) email = models.EmailField(_('email'), blank=True, null=True) diff --git a/pim/contacts/templates/contacts/contact_detail.html b/pim/contacts/templates/contacts/contact_detail.html index 9ac54a9..6bc7bf3 100644 --- a/pim/contacts/templates/contacts/contact_detail.html +++ b/pim/contacts/templates/contacts/contact_detail.html @@ -1,6 +1,8 @@ +{% load static %} +
- User Avatar + User Avatar

diff --git a/pim/contacts/templates/contacts/index.html b/pim/contacts/templates/contacts/index.html index 515f4b4..7e6f073 100644 --- a/pim/contacts/templates/contacts/index.html +++ b/pim/contacts/templates/contacts/index.html @@ -10,7 +10,7 @@

{% trans 'Contacts' %}

+ hx-target="#contacts" hx-indicator=".htmx-indicator"> diff --git a/templates/account/login.html b/templates/account/login.html index 05f8603..62cc212 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -10,11 +10,5 @@

Log In

- - - - Forgot password? - - {% endblock content %}