V1
This commit is contained in:
parent
62acb941dc
commit
d763265cc1
Binary file not shown.
Binary file not shown.
@ -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 = [
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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)
|
||||
@ -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(),
|
||||
}
|
||||
@ -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')),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
@ -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')),
|
||||
],
|
||||
),
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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})"
|
||||
return f"{self.nome} {self.cognome}"
|
||||
@ -1,35 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Knowledge Base{% endblock %}</title>
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{% url 'cliente_list' %}">Financial CRM</a>
|
||||
<button
|
||||
class="navbar-toggler"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarNav"
|
||||
aria-controls="navbarNav"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
>
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'cliente_list' %}">Clienti</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="container mt-4">{% block content %} {% endblock %}</main>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,151 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>{{ object.Nome }} {{ object.Cognome }}</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><strong>Codice Fiscale:</strong> {{ object.Codice_Fiscale }}</p>
|
||||
<p><strong>Email:</strong> {{ object.Email }}</p>
|
||||
<p><strong>Telefono:</strong> {{ object.Telefono }}</p>
|
||||
<p><strong>Data di Nascita:</strong> {{ object.Data_di_Nascita }}</p>
|
||||
<p><strong>Lavoro:</strong> {{ object.Lavoro }}</p>
|
||||
<p><strong>Stato:</strong> {{ object.Stato }}</p>
|
||||
<p><strong>Categoria:</strong> {{ object.Categoria }}</p>
|
||||
<p><strong>Importo Portafoglio Attuale:</strong> € {{ object.Importo_Portafoglio_Attuale }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="nav nav-tabs mt-4" id="myTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="portafogli-tab" data-bs-toggle="tab" data-bs-target="#portafogli" type="button" role="tab" aria-controls="portafogli" aria-selected="true">Portafogli</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="attivita-tab" data-bs-toggle="tab" data-bs-target="#attivita" type="button" role="tab" aria-controls="attivita" aria-selected="false">Attività</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="documenti-tab" data-bs-toggle="tab" data-bs-target="#documenti" type="button" role="tab" aria-controls="documenti" aria-selected="false">Documenti</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="portafogli" role="tabpanel" aria-labelledby="portafogli-tab">
|
||||
<div class="d-flex justify-content-end mt-3">
|
||||
<a href="{% url 'portafoglio_new' object.pk %}" class="btn btn-primary mb-3">Aggiungi Portafoglio</a>
|
||||
</div>
|
||||
<div class="table-responsive mt-3">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome Portafoglio</th>
|
||||
<th>Profilo di Rischio</th>
|
||||
<th>Valore Iniziale</th>
|
||||
<th>Valore Corrente</th>
|
||||
<th>Data Inizio</th>
|
||||
<th>Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for portafoglio in portafogli %}
|
||||
<tr>
|
||||
<td>{{ portafoglio.Nome_Portafoglio }}</td>
|
||||
<td>{{ portafoglio.Profilo_di_Rischio }}</td>
|
||||
<td>€ {{ portafoglio.Valore_Iniziale }}</td>
|
||||
<td>€ {{ portafoglio.Valore_Corrente }}</td>
|
||||
<td>{{ portafoglio.Data_Inizio }}</td>
|
||||
<td>
|
||||
<a href="{% url 'portafoglio_edit' portafoglio.pk %}" class="btn btn-sm btn-outline-primary">Modifica</a>
|
||||
<a href="{% url 'portafoglio_delete' portafoglio.pk %}" class="btn btn-sm btn-outline-danger">Elimina</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="6">Nessun portafoglio trovato.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="attivita" role="tabpanel" aria-labelledby="attivita-tab">
|
||||
<div class="d-flex justify-content-end mt-3">
|
||||
<a href="{% url 'attivita_new' object.pk %}" class="btn btn-primary mb-3">Aggiungi Attività</a>
|
||||
</div>
|
||||
<div class="table-responsive mt-3">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data</th>
|
||||
<th>Ora</th>
|
||||
<th>Tipo</th>
|
||||
<th>Stato</th>
|
||||
<th>Note</th>
|
||||
<th>Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for attivita_item in attivita %}
|
||||
<tr>
|
||||
<td>{{ attivita_item.Data }}</td>
|
||||
<td>{{ attivita_item.Ora|default_if_none:'' }}</td>
|
||||
<td>{{ attivita_item.Tipo }}</td>
|
||||
<td>{{ attivita_item.Stato }}</td>
|
||||
<td>{{ attivita_item.Note }}</td>
|
||||
<td>
|
||||
<a href="{% url 'attivita_edit' attivita_item.pk %}" class="btn btn-sm btn-outline-primary">Modifica</a>
|
||||
<a href="{% url 'attivita_delete' attivita_item.pk %}" class="btn btn-sm btn-outline-danger">Elimina</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="6">Nessuna attività trovata.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="documenti" role="tabpanel" aria-labelledby="documenti-tab">
|
||||
<div class="d-flex justify-content-end mt-3">
|
||||
<a href="{% url 'documento_new' object.pk %}" class="btn btn-primary mb-3">Aggiungi Documento</a>
|
||||
</div>
|
||||
<div class="table-responsive mt-3">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome Documento</th>
|
||||
<th>Tipo</th>
|
||||
<th>Data Caricamento</th>
|
||||
<th>Data di Scadenza</th>
|
||||
<th>File</th>
|
||||
<th>Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for documento in documenti %}
|
||||
<tr>
|
||||
<td>{{ documento.Nome_Documento }}</td>
|
||||
<td>{{ documento.Tipo }}</td>
|
||||
<td>{{ documento.Data_Caricamento }}</td>
|
||||
<td>{{ documento.Data_di_Scadenza|default_if_none:'' }}</td>
|
||||
<td><a href="{{ documento.File.url }}">Scarica</a></td>
|
||||
<td>
|
||||
<a href="{% url 'documento_edit' documento.pk %}" class="btn btn-sm btn-outline-primary">Modifica</a>
|
||||
<a href="{% url 'documento_delete' documento.pk %}" class="btn btn-sm btn-outline-danger">Elimina</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="6">Nessun documento trovato.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'cliente_list' %}" class="btn btn-secondary mt-4">Torna alla lista</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,12 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2>Sei sicuro di voler eliminare l'attività "{{ object.Tipo }}" del {{ object.Data }}?</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger">Conferma</button>
|
||||
<a href="{% url 'cliente_detail' object.cliente.pk %}" class="btn btn-secondary">Annulla</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,13 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2>{% if object %}Modifica Attività{% else %}Aggiungi Attività{% endif %}</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Salva</button>
|
||||
<a href="{% url 'cliente_detail' view.kwargs.cliente_pk|default:object.cliente.pk %}" class="btn btn-secondary">Annulla</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
47
core/templates/core/base.html
Normal file
47
core/templates/core/base.html
Normal file
@ -0,0 +1,47 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Finance Hub</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bs-primary: #2196F3;
|
||||
--bs-primary-rgb: 33, 150, 243;
|
||||
}
|
||||
.navbar-brand {
|
||||
font-weight: bold;
|
||||
}
|
||||
.btn-primary {
|
||||
background-color: var(--bs-primary);
|
||||
border-color: var(--bs-primary);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="{% url 'index' %}">Finance Hub</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'cliente_list' %}">Clienti</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container mt-4">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,13 +1,12 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% extends 'core/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h1>Delete Client</h1>
|
||||
<p>Are you sure you want to delete {{ object.Nome }} {{ object.Cognome }}?</p>
|
||||
<h1>Elimina Cliente</h1>
|
||||
<p>Sei sicuro di voler eliminare il cliente "{{ object }}"?</p>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{% url 'cliente_list' %}" class="btn btn-secondary">Cancel</a>
|
||||
<button type="submit" class="btn btn-danger">Conferma Eliminazione</button>
|
||||
<a href="{% url 'cliente_list' %}" class="btn btn-secondary">Annulla</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
50
core/templates/core/cliente_detail.html
Normal file
50
core/templates/core/cliente_detail.html
Normal file
@ -0,0 +1,50 @@
|
||||
|
||||
{% extends 'core/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h1>Dettagli Cliente</h1>
|
||||
<div>
|
||||
<a href="{% url 'cliente_edit' object.pk %}" class="btn btn-warning">Modifica</a>
|
||||
<a href="{% url 'cliente_delete' object.pk %}" class="btn btn-danger">Elimina</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ object.nome }} {{ object.cognome }}</h5>
|
||||
<p class="card-text"><strong>Codice Fiscale:</strong> {{ object.codice_fiscale }}</p>
|
||||
<p class="card-text"><strong>Email:</strong> {{ object.email }}</p>
|
||||
<p class="card-text"><strong>Telefono:</strong> {{ object.telefono }} <a href="https://wa.me/{{ object.telefono }}" target="_blank">(WhatsApp)</a></p>
|
||||
<p class="card-text"><strong>Data di Nascita:</strong> {{ object.data_di_nascita }}</p>
|
||||
<p class="card-text"><strong>Lavoro:</strong> {{ object.lavoro }}</p>
|
||||
<p class="card-text"><strong>Stato:</strong> {{ object.stato }}</p>
|
||||
<p class="card-text"><strong>Categoria:</strong> {{ object.categoria }}</p>
|
||||
<p class="card-text"><strong>Importo Portafoglio Attuale:</strong> €{{ object.importo_portafoglio_attuale }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="portafogli-tab" data-bs-toggle="tab" data-bs-target="#portafogli" type="button" role="tab" aria-controls="portafogli" aria-selected="true">Portafogli</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="attivita-tab" data-bs-toggle="tab" data-bs-target="#attivita" type="button" role="tab" aria-controls="attivita" aria-selected="false">Attività</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="documenti-tab" data-bs-toggle="tab" data-bs-target="#documenti" type="button" role="tab" aria-controls="documenti" aria-selected="false">Documenti</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="portafogli" role="tabpanel" aria-labelledby="portafogli-tab">
|
||||
<div class="p-3">Contenuto placeholder per i portafogli.</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="attivita" role="tabpanel" aria-labelledby="attivita-tab">
|
||||
<div class="p-3">Contenuto placeholder per le attività.</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="documenti" role="tabpanel" aria-labelledby="documenti-tab">
|
||||
<div class="p-3">Contenuto placeholder per i documenti.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@ -1,13 +1,12 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% extends 'core/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h1>{% if form.instance.pk %}Edit Client{% else %}Add Client{% endif %}</h1>
|
||||
<h1>{% if object %}Modifica Cliente{% else %}Aggiungi Cliente{% endif %}</h1>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<a href="{% url 'cliente_list' %}" class="btn btn-secondary">Cancel</a>
|
||||
<button type-="submit" class="btn btn-primary">Salva</button>
|
||||
<a href="{% url 'cliente_list' %}" class="btn btn-secondary">Annulla</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
33
core/templates/core/cliente_list.html
Normal file
33
core/templates/core/cliente_list.html
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
{% extends 'core/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Clienti</h1>
|
||||
<a href="{% url 'cliente_new' %}" class="btn btn-primary mb-3">Aggiungi Cliente</a>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th>Cognome</th>
|
||||
<th>Email</th>
|
||||
<th>Stato</th>
|
||||
<th>Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for cliente in clienti %}
|
||||
<tr>
|
||||
<td>{{ cliente.nome }}</td>
|
||||
<td>{{ cliente.cognome }}</td>
|
||||
<td>{{ cliente.email }}</td>
|
||||
<td>{{ cliente.stato }}</td>
|
||||
<td>
|
||||
<a href="{% url 'cliente_detail' cliente.pk %}" class="btn btn-sm btn-info">Dettagli</a>
|
||||
<a href="{% url 'cliente_edit' cliente.pk %}" class="btn btn-sm btn-warning">Modifica</a>
|
||||
<a href="{% url 'cliente_delete' cliente.pk %}" class="btn btn-sm btn-danger">Elimina</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
@ -1,12 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2>Sei sicuro di voler eliminare il documento "{{ object.Nome_Documento }}"?</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger">Conferma</button>
|
||||
<a href="{% url 'cliente_detail' object.cliente.pk %}" class="btn btn-secondary">Annulla</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,13 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2>{% if object %}Modifica Documento{% else %}Aggiungi Documento{% endif %}</h2>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Salva</button>
|
||||
<a href="{% url 'cliente_detail' view.kwargs.cliente_pk|default:object.cliente.pk %}" class="btn btn-secondary">Annulla</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,44 +1,17 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% extends 'core/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>Clienti</h1>
|
||||
<a href="{% url 'cliente_new' %}" class="btn btn-primary">Add Client</a>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th>Cognome</th>
|
||||
<th>Codice Fiscale</th>
|
||||
<th>Email</th>
|
||||
<th>Telefono</th>
|
||||
<th>Stato</th>
|
||||
<th>Categoria</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for cliente in clienti %}
|
||||
<tr>
|
||||
<td>{{ cliente.Nome }}</td>
|
||||
<td>{{ cliente.Cognome }}</td>
|
||||
<td>{{ cliente.Codice_Fiscale }}</td>
|
||||
<td>{{ cliente.Email }}</td>
|
||||
<td>{{ cliente.Telefono }}</td>
|
||||
<td>{{ cliente.Stato }}</td>
|
||||
<td>{{ cliente.Categoria }}</td>
|
||||
<td>
|
||||
<a href="{% url 'cliente_detail' cliente.pk %}" class="btn btn-sm btn-outline-info">Details</a>
|
||||
<a href="{% url 'cliente_edit' cliente.pk %}" class="btn btn-sm btn-outline-primary">Edit</a>
|
||||
<a href="{% url 'cliente_delete' cliente.pk %}" class="btn btn-sm btn-outline-danger">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="px-4 py-5 my-5 text-center">
|
||||
<h1 class="display-5 fw-bold">Financial Hub</h1>
|
||||
<div class="col-lg-6 mx-auto">
|
||||
<p class="lead mb-4">Benvenuto nel tuo CRM. Gestisci clienti, portafogli e attività da un unico posto.</p>
|
||||
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
|
||||
<a href="{% url 'cliente_list' %}" class="btn btn-primary btn-lg px-4 gap-3">Gestisci Clienti</a>
|
||||
<button type="button" class="btn btn-outline-secondary btn-lg px-4" disabled>Portafogli</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-lg px-4" disabled>Attività</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-lg px-4" disabled>Documenti</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2>Sei sicuro di voler eliminare il portafoglio "{{ object.Nome_Portafoglio }}"?</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger">Conferma</button>
|
||||
<a href="{% url 'cliente_detail' object.cliente.pk %}" class="btn btn-secondary">Annulla</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,13 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<h2>{% if object %}Modifica Portafoglio{% else %}Aggiungi Portafoglio{% endif %}</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary">Salva</button>
|
||||
<a href="{% url 'cliente_detail' view.kwargs.cliente_pk|default:object.cliente.pk %}" class="btn btn-secondary">Annulla</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
36
core/urls.py
36
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/<int:pk>/', ClienteDetailView.as_view(), name='cliente_detail'),
|
||||
path('cliente/new/', ClienteCreateView.as_view(), name='cliente_new'),
|
||||
path('cliente/<int:pk>/edit/', ClienteUpdateView.as_view(), name='cliente_edit'),
|
||||
path('cliente/<int:pk>/delete/', ClienteDeleteView.as_view(), name='cliente_delete'),
|
||||
|
||||
# Portafoglio URLs
|
||||
path('cliente/<int:cliente_pk>/portafoglio/new/', PortafoglioCreateView.as_view(), name='portafoglio_new'),
|
||||
path('portafoglio/<int:pk>/edit/', PortafoglioUpdateView.as_view(), name='portafoglio_edit'),
|
||||
path('portafoglio/<int:pk>/delete/', PortafoglioDeleteView.as_view(), name='portafoglio_delete'),
|
||||
|
||||
# Attivita URLs
|
||||
path('cliente/<int:cliente_pk>/attivita/new/', AttivitaCreateView.as_view(), name='attivita_new'),
|
||||
path('attivita/<int:pk>/edit/', AttivitaUpdateView.as_view(), name='attivita_edit'),
|
||||
path('attivita/<int:pk>/delete/', AttivitaDeleteView.as_view(), name='attivita_delete'),
|
||||
|
||||
# Documento URLs
|
||||
path('cliente/<int:cliente_pk>/documento/new/', DocumentoCreateView.as_view(), name='documento_new'),
|
||||
path('documento/<int:pk>/edit/', DocumentoUpdateView.as_view(), name='documento_edit'),
|
||||
path('documento/<int:pk>/delete/', DocumentoDeleteView.as_view(), name='documento_delete'),
|
||||
path('', IndexView.as_view(), name='index'),
|
||||
path('clienti/', ClienteListView.as_view(), name='cliente_list'),
|
||||
path('clienti/<int:pk>/', ClienteDetailView.as_view(), name='cliente_detail'),
|
||||
path('clienti/new/', ClienteCreateView.as_view(), name='cliente_new'),
|
||||
path('clienti/<int:pk>/edit/', ClienteUpdateView.as_view(), name='cliente_edit'),
|
||||
path('clienti/<int:pk>/delete/', ClienteDeleteView.as_view(), name='cliente_delete'),
|
||||
]
|
||||
139
core/views.py
139
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')
|
||||
BIN
media/documenti/11_1_2_merged.pdf
Normal file
BIN
media/documenti/11_1_2_merged.pdf
Normal file
Binary file not shown.
BIN
media/documenti/11_1_2_merged_8bN5woP.pdf
Normal file
BIN
media/documenti/11_1_2_merged_8bN5woP.pdf
Normal file
Binary file not shown.
BIN
media/documenti/11_1_2_merged_Sa8F4sB.pdf
Normal file
BIN
media/documenti/11_1_2_merged_Sa8F4sB.pdf
Normal file
Binary file not shown.
BIN
media/documenti/11_1_2_merged_TmPk4BJ.pdf
Normal file
BIN
media/documenti/11_1_2_merged_TmPk4BJ.pdf
Normal file
Binary file not shown.
BIN
media/documenti/IMG_6349.HEIC
Normal file
BIN
media/documenti/IMG_6349.HEIC
Normal file
Binary file not shown.
BIN
media/documenti/Screenshot-20-10-2025-95722-192-168-100-98.jpg
Normal file
BIN
media/documenti/Screenshot-20-10-2025-95722-192-168-100-98.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 179 KiB |
BIN
media/documenti/Untitled.png
Normal file
BIN
media/documenti/Untitled.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
37
static/css/custom.css
Normal file
37
static/css/custom.css
Normal file
@ -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 */
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user