diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 6b52506..d2aee0b 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/__pycache__/urls.cpython-311.pyc b/config/__pycache__/urls.cpython-311.pyc index 480daeb..be37309 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/settings.py b/config/settings.py index a7247c1..71ccb26 100644 --- a/config/settings.py +++ b/config/settings.py @@ -33,7 +33,8 @@ ALLOWED_HOSTS = [ CSRF_TRUSTED_ORIGINS = [ origin for origin in [ os.getenv("HOST_FQDN", ""), - os.getenv("CSRF_TRUSTED_ORIGIN", "") + os.getenv("CSRF_TRUSTED_ORIGIN", ""), + "https://matteo-barresi.dev.flatlogic.app", ] if origin ] CSRF_TRUSTED_ORIGINS = [ @@ -53,7 +54,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'core', + 'core.apps.CoreConfig', ] MIDDLEWARE = [ diff --git a/core/__pycache__/__init__.cpython-311.pyc b/core/__pycache__/__init__.cpython-311.pyc index 3b7774e..c23d5e3 100644 Binary files a/core/__pycache__/__init__.cpython-311.pyc and b/core/__pycache__/__init__.cpython-311.pyc differ diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index 2bd112a..ccb577f 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/apps.cpython-311.pyc b/core/__pycache__/apps.cpython-311.pyc index 6435d92..3841887 100644 Binary files a/core/__pycache__/apps.cpython-311.pyc and b/core/__pycache__/apps.cpython-311.pyc differ diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc deleted file mode 100644 index 56356eb..0000000 Binary files a/core/__pycache__/forms.cpython-311.pyc and /dev/null differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 2d874a7..75225d7 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 e9609bd..6ce520e 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 4b92fcd..1c7661a 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 3ebea38..16333c4 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,7 +1,4 @@ from django.contrib import admin -from .models import Cliente, Portafoglio, Attivita, Documento +from .models import Cliente -admin.site.register(Cliente) -admin.site.register(Portafoglio) -admin.site.register(Attivita) -admin.site.register(Documento) +admin.site.register(Cliente) \ No newline at end of file diff --git a/core/forms.py b/core/forms.py deleted file mode 100644 index 199bcaf..0000000 --- a/core/forms.py +++ /dev/null @@ -1,38 +0,0 @@ -from django import forms -from .models import Cliente, Portafoglio, Attivita, Documento - -class ClienteForm(forms.ModelForm): - class Meta: - model = Cliente - exclude = ('Importo_Portafoglio_Attuale',) - widgets = { - 'Data_di_Nascita': forms.DateInput(attrs={'type': 'date'}), - } - -class PortafoglioForm(forms.ModelForm): - class Meta: - model = Portafoglio - fields = '__all__' - widgets = { - 'Data_Inizio': forms.DateInput(attrs={'type': 'date'}), - 'cliente': forms.HiddenInput(), - } - -class AttivitaForm(forms.ModelForm): - class Meta: - model = Attivita - fields = '__all__' - widgets = { - 'Data': forms.DateInput(attrs={'type': 'date'}), - 'Ora': forms.TimeInput(attrs={'type': 'time'}), - 'cliente': forms.HiddenInput(), - } - -class DocumentoForm(forms.ModelForm): - class Meta: - model = Documento - fields = '__all__' - widgets = { - 'Data_di_Scadenza': forms.DateInput(attrs={'type': 'date'}), - 'cliente': forms.HiddenInput(), - } diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py index c852421..903ee33 100644 --- a/core/migrations/0001_initial.py +++ b/core/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.2.7 on 2025-10-25 16:24 +# Generated by Django 5.2.7 on 2025-10-25 19:20 from django.db import migrations, models @@ -15,18 +15,15 @@ class Migration(migrations.Migration): name='Cliente', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('Nome', models.CharField(max_length=100)), - ('Cognome', models.CharField(max_length=100)), - ('Codice_Fiscale', models.CharField(max_length=16, unique=True)), - ('Email', models.EmailField(max_length=254)), - ('Telefono', models.CharField(max_length=20)), - ('Data_di_Nascita', models.DateField()), - ('Lavoro', models.CharField(max_length=100)), - ('Stato', models.CharField(choices=[('Cliente', 'Cliente'), ('Prospect', 'Prospect'), ('Ex-Cliente', 'Ex-Cliente')], max_length=20)), - ('Categoria', models.CharField(choices=[('Privato', 'Privato'), ('Azienda', 'Azienda')], max_length=20)), - ('Importo_Portafoglio_Attuale', models.DecimalField(decimal_places=2, default=0.0, editable=False, max_digits=15)), - ('Scadenza_MIFID', models.DateField()), - ('Scadenza_Documento_Identita', models.DateField()), + ('nome', models.CharField(max_length=100, verbose_name='Nome')), + ('cognome', models.CharField(max_length=100, verbose_name='Cognome')), + ('codice_fiscale', models.CharField(max_length=16, unique=True, verbose_name='Codice Fiscale')), + ('email', models.EmailField(max_length=254, verbose_name='Email')), + ('telefono', models.CharField(max_length=20, verbose_name='Telefono')), + ('data_di_nascita', models.DateField(verbose_name='Data di Nascita')), + ('lavoro', models.CharField(max_length=100, verbose_name='Lavoro')), + ('stato', models.CharField(choices=[('Cliente', 'Cliente'), ('Prospect', 'Prospect'), ('Ex-Cliente', 'Ex-Cliente')], max_length=20, verbose_name='Stato')), + ('categoria', models.CharField(choices=[('Privato', 'Privato'), ('Azienda', 'Azienda')], max_length=20, verbose_name='Categoria')), ], ), ] diff --git a/core/migrations/0002_remove_cliente_scadenza_documento_identita_and_more.py b/core/migrations/0002_remove_cliente_scadenza_documento_identita_and_more.py deleted file mode 100644 index 2af4967..0000000 --- a/core/migrations/0002_remove_cliente_scadenza_documento_identita_and_more.py +++ /dev/null @@ -1,61 +0,0 @@ -# Generated by Django 5.2.7 on 2025-10-25 16:52 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='cliente', - name='Scadenza_Documento_Identita', - ), - migrations.RemoveField( - model_name='cliente', - name='Scadenza_MIFID', - ), - migrations.CreateModel( - name='Attivita', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('Data', models.DateField()), - ('Ora', models.TimeField(blank=True, null=True)), - ('Tipo', models.CharField(choices=[('Chiamata', 'Chiamata'), ('Riunione', 'Riunione'), ('Email', 'Email'), ('To-Do', 'To-Do'), ('Avviso Cedola', 'Avviso Cedola'), ('Scadenza Obbligazione', 'Scadenza Obbligazione'), ('Revisione Annuale', 'Revisione Annuale')], max_length=30)), - ('Stato', models.CharField(choices=[('Pianificato', 'Pianificato'), ('Completato', 'Completato')], default='Pianificato', max_length=20)), - ('Note', models.TextField(blank=True, null=True)), - ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attivita', to='core.cliente')), - ], - ), - migrations.CreateModel( - name='Documento', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('Nome_Documento', models.CharField(max_length=100)), - ('Tipo', models.CharField(choices=[('Contratto', 'Contratto'), ('KYC', 'KYC'), ('Report', 'Report'), ('Altro', 'Altro')], max_length=20)), - ('Data_Caricamento', models.DateField(auto_now_add=True)), - ('Data_di_Scadenza', models.DateField(blank=True, null=True)), - ('File', models.FileField(upload_to='documenti/')), - ('Condivisibile', models.BooleanField(default=False)), - ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documenti', to='core.cliente')), - ], - ), - migrations.CreateModel( - name='Portafoglio', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('Nome_Portafoglio', models.CharField(max_length=100)), - ('Profilo_di_Rischio', models.CharField(choices=[('Conservativo', 'Conservativo'), ('Bilanciato', 'Bilanciato'), ('Aggressivo', 'Aggressivo')], max_length=20)), - ('Composizione_Asset_Allocation', models.TextField(blank=True, null=True)), - ('Data_Inizio', models.DateField()), - ('Valore_Iniziale', models.DecimalField(decimal_places=2, max_digits=15)), - ('Valore_Corrente', models.DecimalField(decimal_places=2, max_digits=15)), - ('Note', models.TextField(blank=True, null=True)), - ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='portafogli', to='core.cliente')), - ], - ), - ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc index 92357d7..f398691 100644 Binary files a/core/migrations/__pycache__/0001_initial.cpython-311.pyc and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/migrations/__pycache__/0002_remove_cliente_scadenza_documento_identita_and_more.cpython-311.pyc b/core/migrations/__pycache__/0002_remove_cliente_scadenza_documento_identita_and_more.cpython-311.pyc deleted file mode 100644 index 446d7cc..0000000 Binary files a/core/migrations/__pycache__/0002_remove_cliente_scadenza_documento_identita_and_more.cpython-311.pyc and /dev/null differ diff --git a/core/migrations/__pycache__/__init__.cpython-311.pyc b/core/migrations/__pycache__/__init__.cpython-311.pyc index 58b1c14..b0caae6 100644 Binary files a/core/migrations/__pycache__/__init__.cpython-311.pyc and b/core/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 69ef07e..f6c223c 100644 --- a/core/models.py +++ b/core/models.py @@ -11,76 +11,21 @@ class Cliente(models.Model): ('Azienda', 'Azienda'), ] - Nome = models.CharField(max_length=100) - Cognome = models.CharField(max_length=100) - Codice_Fiscale = models.CharField(max_length=16, unique=True) - Email = models.EmailField() - Telefono = models.CharField(max_length=20) - Data_di_Nascita = models.DateField() - Lavoro = models.CharField(max_length=100) - Stato = models.CharField(max_length=20, choices=STATO_CHOICES) - Categoria = models.CharField(max_length=20, choices=CATEGORIA_CHOICES) - Importo_Portafoglio_Attuale = models.DecimalField(max_digits=15, decimal_places=2, default=0.00, editable=False) + nome = models.CharField("Nome", max_length=100) + cognome = models.CharField("Cognome", max_length=100) + codice_fiscale = models.CharField("Codice Fiscale", max_length=16, unique=True) + email = models.EmailField("Email") + telefono = models.CharField("Telefono", max_length=20) + data_di_nascita = models.DateField("Data di Nascita") + lavoro = models.CharField("Lavoro", max_length=100) + stato = models.CharField("Stato", max_length=20, choices=STATO_CHOICES) + categoria = models.CharField("Categoria", max_length=20, choices=CATEGORIA_CHOICES) + + @property + def importo_portafoglio_attuale(self): + # This is a calculated field. + # The logic to calculate this value will be implemented later. + return 0.00 def __str__(self): - return f"{self.Nome} {self.Cognome}" - -class Portafoglio(models.Model): - PROFILO_RISCHIO_CHOICES = [ - ('Conservativo', 'Conservativo'), - ('Bilanciato', 'Bilanciato'), - ('Aggressivo', 'Aggressivo'), - ] - cliente = models.ForeignKey(Cliente, on_delete=models.CASCADE, related_name='portafogli') - Nome_Portafoglio = models.CharField(max_length=100) - Profilo_di_Rischio = models.CharField(max_length=20, choices=PROFILO_RISCHIO_CHOICES) - Composizione_Asset_Allocation = models.TextField(blank=True, null=True) - Data_Inizio = models.DateField() - Valore_Iniziale = models.DecimalField(max_digits=15, decimal_places=2) - Valore_Corrente = models.DecimalField(max_digits=15, decimal_places=2) - Note = models.TextField(blank=True, null=True) - - def __str__(self): - return f"{self.Nome_Portafoglio} ({self.cliente})" - -class Attivita(models.Model): - TIPO_CHOICES = [ - ('Chiamata', 'Chiamata'), - ('Riunione', 'Riunione'), - ('Email', 'Email'), - ('To-Do', 'To-Do'), - ('Avviso Cedola', 'Avviso Cedola'), - ('Scadenza Obbligazione', 'Scadenza Obbligazione'), - ('Revisione Annuale', 'Revisione Annuale'), - ] - STATO_CHOICES = [ - ('Pianificato', 'Pianificato'), - ('Completato', 'Completato'), - ] - cliente = models.ForeignKey(Cliente, on_delete=models.CASCADE, related_name='attivita') - Data = models.DateField() - Ora = models.TimeField(blank=True, null=True) - Tipo = models.CharField(max_length=30, choices=TIPO_CHOICES) - Stato = models.CharField(max_length=20, choices=STATO_CHOICES, default='Pianificato') - Note = models.TextField(blank=True, null=True) - - def __str__(self): - return f"{self.Tipo} - {self.Data} - {self.cliente}" - -class Documento(models.Model): - TIPO_CHOICES = [ - ('Contratto', 'Contratto'), - ('KYC', 'KYC'), - ('Report', 'Report'), - ('Altro', 'Altro'), - ] - cliente = models.ForeignKey(Cliente, on_delete=models.CASCADE, related_name='documenti') - Nome_Documento = models.CharField(max_length=100) - Tipo = models.CharField(max_length=20, choices=TIPO_CHOICES) - Data_Caricamento = models.DateField(auto_now_add=True) - Data_di_Scadenza = models.DateField(blank=True, null=True) - File = models.FileField(upload_to='documenti/') # Placeholder, will be configured for S3 - Condivisibile = models.BooleanField(default=False) - - def __str__(self): - return f"{self.Nome_Documento} ({self.cliente})" \ No newline at end of file + return f"{self.nome} {self.cognome}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html deleted file mode 100644 index 2e81fe0..0000000 --- a/core/templates/base.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - {% block title %}Knowledge Base{% endblock %} - {% block head %}{% endblock %} - - - - -
{% block content %} {% endblock %}
- - diff --git a/core/templates/core/article_detail.html b/core/templates/core/article_detail.html deleted file mode 100644 index b129935..0000000 --- a/core/templates/core/article_detail.html +++ /dev/null @@ -1,151 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-
-
-

{{ object.Nome }} {{ object.Cognome }}

-
-
-

Codice Fiscale: {{ object.Codice_Fiscale }}

-

Email: {{ object.Email }}

-

Telefono: {{ object.Telefono }}

-

Data di Nascita: {{ object.Data_di_Nascita }}

-

Lavoro: {{ object.Lavoro }}

-

Stato: {{ object.Stato }}

-

Categoria: {{ object.Categoria }}

-

Importo Portafoglio Attuale: € {{ object.Importo_Portafoglio_Attuale }}

-
-
- - - -
-
- -
- - - - - - - - - - - - - {% for portafoglio in portafogli %} - - - - - - - - - {% empty %} - - - - {% endfor %} - -
Nome PortafoglioProfilo di RischioValore InizialeValore CorrenteData InizioAzioni
{{ portafoglio.Nome_Portafoglio }}{{ portafoglio.Profilo_di_Rischio }}€ {{ portafoglio.Valore_Iniziale }}€ {{ portafoglio.Valore_Corrente }}{{ portafoglio.Data_Inizio }} - Modifica - Elimina -
Nessun portafoglio trovato.
-
-
-
- -
- - - - - - - - - - - - - {% for attivita_item in attivita %} - - - - - - - - - {% empty %} - - - - {% endfor %} - -
DataOraTipoStatoNoteAzioni
{{ attivita_item.Data }}{{ attivita_item.Ora|default_if_none:'' }}{{ attivita_item.Tipo }}{{ attivita_item.Stato }}{{ attivita_item.Note }} - Modifica - Elimina -
Nessuna attività trovata.
-
-
-
- -
- - - - - - - - - - - - - {% for documento in documenti %} - - - - - - - - - {% empty %} - - - - {% endfor %} - -
Nome DocumentoTipoData CaricamentoData di ScadenzaFileAzioni
{{ documento.Nome_Documento }}{{ documento.Tipo }}{{ documento.Data_Caricamento }}{{ documento.Data_di_Scadenza|default_if_none:'' }}Scarica - Modifica - Elimina -
Nessun documento trovato.
-
-
-
- Torna alla lista -
-{% endblock %} \ No newline at end of file diff --git a/core/templates/core/attivita_confirm_delete.html b/core/templates/core/attivita_confirm_delete.html deleted file mode 100644 index 2983d44..0000000 --- a/core/templates/core/attivita_confirm_delete.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-

Sei sicuro di voler eliminare l'attività "{{ object.Tipo }}" del {{ object.Data }}?

-
- {% csrf_token %} - - Annulla -
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/core/attivita_form.html b/core/templates/core/attivita_form.html deleted file mode 100644 index f554834..0000000 --- a/core/templates/core/attivita_form.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-

{% if object %}Modifica Attività{% else %}Aggiungi Attività{% endif %}

-
- {% csrf_token %} - {{ form.as_p }} - - Annulla -
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/core/base.html b/core/templates/core/base.html new file mode 100644 index 0000000..0bd8834 --- /dev/null +++ b/core/templates/core/base.html @@ -0,0 +1,47 @@ + + + + + + + Finance Hub + + + + + + +
+ {% block content %} + {% endblock %} +
+ + + + diff --git a/core/templates/core/cliente_confirm_delete.html b/core/templates/core/cliente_confirm_delete.html index ab215c8..47f964a 100644 --- a/core/templates/core/cliente_confirm_delete.html +++ b/core/templates/core/cliente_confirm_delete.html @@ -1,13 +1,12 @@ -{% extends 'base.html' %} + +{% extends 'core/base.html' %} {% block content %} -
-

Delete Client

-

Are you sure you want to delete {{ object.Nome }} {{ object.Cognome }}?

+

Elimina Cliente

+

Sei sicuro di voler eliminare il cliente "{{ object }}"?

{% csrf_token %} - - Cancel + + Annulla
-
{% endblock %} diff --git a/core/templates/core/cliente_detail.html b/core/templates/core/cliente_detail.html new file mode 100644 index 0000000..a2c2c30 --- /dev/null +++ b/core/templates/core/cliente_detail.html @@ -0,0 +1,50 @@ + +{% extends 'core/base.html' %} + +{% block content %} +
+

Dettagli Cliente

+
+ Modifica + Elimina +
+
+ +
+
+
{{ object.nome }} {{ object.cognome }}
+

Codice Fiscale: {{ object.codice_fiscale }}

+

Email: {{ object.email }}

+

Telefono: {{ object.telefono }} (WhatsApp)

+

Data di Nascita: {{ object.data_di_nascita }}

+

Lavoro: {{ object.lavoro }}

+

Stato: {{ object.stato }}

+

Categoria: {{ object.categoria }}

+

Importo Portafoglio Attuale: €{{ object.importo_portafoglio_attuale }}

+
+
+ + +
+
+
Contenuto placeholder per i portafogli.
+
+
+
Contenuto placeholder per le attività.
+
+
+
Contenuto placeholder per i documenti.
+
+
+ +{% endblock %} diff --git a/core/templates/core/cliente_form.html b/core/templates/core/cliente_form.html index d79ae9f..b6734e8 100644 --- a/core/templates/core/cliente_form.html +++ b/core/templates/core/cliente_form.html @@ -1,13 +1,12 @@ -{% extends 'base.html' %} + +{% extends 'core/base.html' %} {% block content %} -
-

{% if form.instance.pk %}Edit Client{% else %}Add Client{% endif %}

+

{% if object %}Modifica Cliente{% else %}Aggiungi Cliente{% endif %}

{% csrf_token %} {{ form.as_p }} - - Cancel + + Annulla
-
{% endblock %} diff --git a/core/templates/core/cliente_list.html b/core/templates/core/cliente_list.html new file mode 100644 index 0000000..89d0fb5 --- /dev/null +++ b/core/templates/core/cliente_list.html @@ -0,0 +1,33 @@ + +{% extends 'core/base.html' %} + +{% block content %} +

Clienti

+ Aggiungi Cliente + + + + + + + + + + + + {% for cliente in clienti %} + + + + + + + + {% endfor %} + +
NomeCognomeEmailStatoAzioni
{{ cliente.nome }}{{ cliente.cognome }}{{ cliente.email }}{{ cliente.stato }} + Dettagli + Modifica + Elimina +
+{% endblock %} diff --git a/core/templates/core/documento_confirm_delete.html b/core/templates/core/documento_confirm_delete.html deleted file mode 100644 index 4e40417..0000000 --- a/core/templates/core/documento_confirm_delete.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-

Sei sicuro di voler eliminare il documento "{{ object.Nome_Documento }}"?

-
- {% csrf_token %} - - Annulla -
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/core/documento_form.html b/core/templates/core/documento_form.html deleted file mode 100644 index dfe2b83..0000000 --- a/core/templates/core/documento_form.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-

{% if object %}Modifica Documento{% else %}Aggiungi Documento{% endif %}

-
- {% csrf_token %} - {{ form.as_p }} - - Annulla -
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/core/index.html b/core/templates/core/index.html index e2e1b3f..4965231 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,44 +1,17 @@ -{% extends 'base.html' %} + +{% extends 'core/base.html' %} {% block content %} -
-
-

Clienti

- Add Client -
-
- - - - - - - - - - - - - - - {% for cliente in clienti %} - - - - - - - - - - - {% endfor %} - -
NomeCognomeCodice FiscaleEmailTelefonoStatoCategoriaActions
{{ cliente.Nome }}{{ cliente.Cognome }}{{ cliente.Codice_Fiscale }}{{ cliente.Email }}{{ cliente.Telefono }}{{ cliente.Stato }}{{ cliente.Categoria }} - Details - Edit - Delete -
+
+

Financial Hub

+
+

Benvenuto nel tuo CRM. Gestisci clienti, portafogli e attività da un unico posto.

+
+ Gestisci Clienti + + + +
{% endblock %} diff --git a/core/templates/core/portafoglio_confirm_delete.html b/core/templates/core/portafoglio_confirm_delete.html deleted file mode 100644 index e9eff12..0000000 --- a/core/templates/core/portafoglio_confirm_delete.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-

Sei sicuro di voler eliminare il portafoglio "{{ object.Nome_Portafoglio }}"?

-
- {% csrf_token %} - - Annulla -
-
-{% endblock %} \ No newline at end of file diff --git a/core/templates/core/portafoglio_form.html b/core/templates/core/portafoglio_form.html deleted file mode 100644 index 4421674..0000000 --- a/core/templates/core/portafoglio_form.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-

{% if object %}Modifica Portafoglio{% else %}Aggiungi Portafoglio{% endif %}

-
- {% csrf_token %} - {{ form.as_p }} - - Annulla -
-
-{% endblock %} \ No newline at end of file diff --git a/core/urls.py b/core/urls.py index af7b381..ca437e2 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,40 +1,18 @@ from django.urls import path from .views import ( + IndexView, ClienteListView, ClienteDetailView, ClienteCreateView, ClienteUpdateView, ClienteDeleteView, - PortafoglioCreateView, - PortafoglioUpdateView, - PortafoglioDeleteView, - AttivitaCreateView, - AttivitaUpdateView, - AttivitaDeleteView, - DocumentoCreateView, - DocumentoUpdateView, - DocumentoDeleteView, ) urlpatterns = [ - path('', ClienteListView.as_view(), name='cliente_list'), - path('cliente//', ClienteDetailView.as_view(), name='cliente_detail'), - path('cliente/new/', ClienteCreateView.as_view(), name='cliente_new'), - path('cliente//edit/', ClienteUpdateView.as_view(), name='cliente_edit'), - path('cliente//delete/', ClienteDeleteView.as_view(), name='cliente_delete'), - - # Portafoglio URLs - path('cliente//portafoglio/new/', PortafoglioCreateView.as_view(), name='portafoglio_new'), - path('portafoglio//edit/', PortafoglioUpdateView.as_view(), name='portafoglio_edit'), - path('portafoglio//delete/', PortafoglioDeleteView.as_view(), name='portafoglio_delete'), - - # Attivita URLs - path('cliente//attivita/new/', AttivitaCreateView.as_view(), name='attivita_new'), - path('attivita//edit/', AttivitaUpdateView.as_view(), name='attivita_edit'), - path('attivita//delete/', AttivitaDeleteView.as_view(), name='attivita_delete'), - - # Documento URLs - path('cliente//documento/new/', DocumentoCreateView.as_view(), name='documento_new'), - path('documento//edit/', DocumentoUpdateView.as_view(), name='documento_edit'), - path('documento//delete/', DocumentoDeleteView.as_view(), name='documento_delete'), + path('', IndexView.as_view(), name='index'), + path('clienti/', ClienteListView.as_view(), name='cliente_list'), + path('clienti//', ClienteDetailView.as_view(), name='cliente_detail'), + path('clienti/new/', ClienteCreateView.as_view(), name='cliente_new'), + path('clienti//edit/', ClienteUpdateView.as_view(), name='cliente_edit'), + path('clienti//delete/', ClienteDeleteView.as_view(), name='cliente_delete'), ] \ No newline at end of file diff --git a/core/views.py b/core/views.py index afcb6bf..299249a 100644 --- a/core/views.py +++ b/core/views.py @@ -1,141 +1,34 @@ from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView -from django.urls import reverse_lazy, reverse -from .models import Cliente, Portafoglio, Attivita, Documento -from .forms import ClienteForm, PortafoglioForm, AttivitaForm, DocumentoForm -from django.shortcuts import get_object_or_404 +from django.urls import reverse_lazy +from .models import Cliente + +class IndexView(ListView): + model = Cliente + template_name = "core/index.html" + context_object_name = "clienti" class ClienteListView(ListView): model = Cliente - template_name = 'core/index.html' - context_object_name = 'clienti' + template_name = "core/cliente_list.html" + context_object_name = "clienti" class ClienteDetailView(DetailView): model = Cliente - template_name = 'core/article_detail.html' - - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - cliente = self.get_object() - context['portafogli'] = cliente.portafogli.all() - context['attivita'] = cliente.attivita.all() - context['documenti'] = cliente.documenti.all() - return context + template_name = "core/cliente_detail.html" class ClienteCreateView(CreateView): model = Cliente - template_name = 'core/cliente_form.html' - form_class = ClienteForm + fields = '__all__' + template_name = "core/cliente_form.html" success_url = reverse_lazy('cliente_list') class ClienteUpdateView(UpdateView): model = Cliente - template_name = 'core/cliente_form.html' - form_class = ClienteForm + fields = '__all__' + template_name = "core/cliente_form.html" success_url = reverse_lazy('cliente_list') class ClienteDeleteView(DeleteView): model = Cliente - template_name = 'core/cliente_confirm_delete.html' - success_url = reverse_lazy('cliente_list') - -# Portafoglio Views -class PortafoglioCreateView(CreateView): - model = Portafoglio - form_class = PortafoglioForm - template_name = 'core/portafoglio_form.html' - - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - context['cliente_pk'] = self.kwargs['cliente_pk'] - return context - - def form_valid(self, form): - cliente = get_object_or_404(Cliente, pk=self.kwargs['cliente_pk']) - form.instance.cliente = cliente - return super().form_valid(form) - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.kwargs['cliente_pk']}) - -class PortafoglioUpdateView(UpdateView): - model = Portafoglio - form_class = PortafoglioForm - template_name = 'core/portafoglio_form.html' - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.object.cliente.pk}) - -class PortafoglioDeleteView(DeleteView): - model = Portafoglio - template_name = 'core/portafoglio_confirm_delete.html' - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.object.cliente.pk}) - -# Attivita Views -class AttivitaCreateView(CreateView): - model = Attivita - form_class = AttivitaForm - template_name = 'core/attivita_form.html' - - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - context['cliente_pk'] = self.kwargs['cliente_pk'] - return context - - def form_valid(self, form): - cliente = get_object_or_404(Cliente, pk=self.kwargs['cliente_pk']) - form.instance.cliente = cliente - return super().form_valid(form) - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.kwargs['cliente_pk']}) - -class AttivitaUpdateView(UpdateView): - model = Attivita - form_class = AttivitaForm - template_name = 'core/attivita_form.html' - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.object.cliente.pk}) - -class AttivitaDeleteView(DeleteView): - model = Attivita - template_name = 'core/attivita_confirm_delete.html' - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.object.cliente.pk}) - -# Documento Views -class DocumentoCreateView(CreateView): - model = Documento - form_class = DocumentoForm - template_name = 'core/documento_form.html' - - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - context['cliente_pk'] = self.kwargs['cliente_pk'] - return context - - def form_valid(self, form): - cliente = get_object_or_404(Cliente, pk=self.kwargs['cliente_pk']) - form.instance.cliente = cliente - return super().form_valid(form) - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.kwargs['cliente_pk']}) - -class DocumentoUpdateView(UpdateView): - model = Documento - form_class = DocumentoForm - template_name = 'core/documento_form.html' - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.object.cliente.pk}) - -class DocumentoDeleteView(DeleteView): - model = Documento - template_name = 'core/documento_confirm_delete.html' - - def get_success_url(self): - return reverse('cliente_detail', kwargs={'pk': self.object.cliente.pk}) + template_name = "core/cliente_confirm_delete.html" + success_url = reverse_lazy('cliente_list') \ No newline at end of file diff --git a/media/documenti/11_1_2_merged.pdf b/media/documenti/11_1_2_merged.pdf new file mode 100644 index 0000000..24b4c28 Binary files /dev/null and b/media/documenti/11_1_2_merged.pdf differ diff --git a/media/documenti/11_1_2_merged_8bN5woP.pdf b/media/documenti/11_1_2_merged_8bN5woP.pdf new file mode 100644 index 0000000..24b4c28 Binary files /dev/null and b/media/documenti/11_1_2_merged_8bN5woP.pdf differ diff --git a/media/documenti/11_1_2_merged_Sa8F4sB.pdf b/media/documenti/11_1_2_merged_Sa8F4sB.pdf new file mode 100644 index 0000000..24b4c28 Binary files /dev/null and b/media/documenti/11_1_2_merged_Sa8F4sB.pdf differ diff --git a/media/documenti/11_1_2_merged_TmPk4BJ.pdf b/media/documenti/11_1_2_merged_TmPk4BJ.pdf new file mode 100644 index 0000000..24b4c28 Binary files /dev/null and b/media/documenti/11_1_2_merged_TmPk4BJ.pdf differ diff --git a/media/documenti/IMG_6349.HEIC b/media/documenti/IMG_6349.HEIC new file mode 100644 index 0000000..c4c7a0c Binary files /dev/null and b/media/documenti/IMG_6349.HEIC differ diff --git a/media/documenti/Screenshot-20-10-2025-95722-192-168-100-98.jpg b/media/documenti/Screenshot-20-10-2025-95722-192-168-100-98.jpg new file mode 100644 index 0000000..8622a03 Binary files /dev/null and b/media/documenti/Screenshot-20-10-2025-95722-192-168-100-98.jpg differ diff --git a/media/documenti/Untitled.png b/media/documenti/Untitled.png new file mode 100644 index 0000000..ea7c93c Binary files /dev/null and b/media/documenti/Untitled.png differ diff --git a/static/css/custom.css b/static/css/custom.css new file mode 100644 index 0000000..2da5ae8 --- /dev/null +++ b/static/css/custom.css @@ -0,0 +1,37 @@ +body { + background: linear-gradient(to right, #2196F3, #64b5f6) !important; + color: #212529; +} + +.navbar-brand { + font-family: 'Roboto Slab', serif; +} + +.card { + background-color: rgba(255, 255, 255, 0.8); + border: none; + color: #212529; +} + +.list-group-item { + background-color: transparent; + border-color: rgba(0, 0, 0, 0.125); + color: #212529; +} + +a.list-group-item:hover { + background-color: rgba(0, 0, 0, 0.05); +} + +.navbar { + background-color: rgba(255, 255, 255, 0.3) !important; +} + +.nav-link { + color: #212529 !important; +} + +/* Stile per l'intestazione della tabella clienti */ +.table > thead { + background-color: #E9ECEF !important; /* Bootstrap light grey */ +}