diff --git a/project/app/admin.py b/project/app/admin.py index 8c38f3f3..2de19f67 100755 --- a/project/app/admin.py +++ b/project/app/admin.py @@ -1,3 +1,23 @@ from django.contrib import admin +from django.contrib.auth.admin import UserAdmin as BaseUserAdmin +from django.contrib.auth.models import User -# Register your models here. +from .models import Employee + + +# Define an inline admin descriptor for Employee model +# which acts a bit like a singleton +class EmployeeInline(admin.StackedInline): + model = Employee + can_delete = False + verbose_name_plural = "employee" + + +# Define a new User admin +class UserAdmin(BaseUserAdmin): + inlines = [EmployeeInline] + + +# Re-register UserAdmin +admin.site.unregister(User) +admin.site.register(User, UserAdmin) \ No newline at end of file diff --git a/project/app/migrations/0001_initial.py b/project/app/migrations/0001_initial.py old mode 100755 new mode 100644 index de25f519..0764d8aa --- a/project/app/migrations/0001_initial.py +++ b/project/app/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.5 on 2023-10-27 11:29 +# Generated by Django 4.2.4 on 2024-02-08 14:19 from django.db import migrations, models import django.db.models.deletion @@ -23,6 +23,35 @@ class Migration(migrations.Migration): ('id_projeto', models.CharField(max_length=50)), ], ), + migrations.CreateModel( + name='Lancamento', + fields=[ + ('id_mapeamento', models.IntegerField(primary_key=True, serialize=False)), + ('id_favorecido', models.CharField(max_length=200)), + ('nome_favorecido', models.CharField(max_length=200)), + ('cnpj_favorecido', models.CharField(max_length=200)), + ('tipo_favorecido', models.CharField(max_length=200)), + ('valor_lancado', models.CharField(max_length=200)), + ('valor_pago', models.CharField(max_length=200)), + ('data_vencimento', models.CharField(max_length=200)), + ('id_status', models.CharField(max_length=200)), + ('status_lancamento', models.CharField(max_length=200)), + ('flag_receita', models.CharField(max_length=200)), + ('data_baixa', models.CharField(max_length=200)), + ('his_lancamento', models.CharField(max_length=200)), + ('data_emissao', models.CharField(max_length=200)), + ('num_doc_fin', models.CharField(max_length=200)), + ('data_cria', models.CharField(max_length=200)), + ('data_pagamento', models.CharField(max_length=200)), + ('id_lancamento', models.CharField(max_length=200)), + ('id_projeto', models.CharField(max_length=200)), + ('id_rubrica', models.CharField(max_length=200)), + ('nome_rubrica', models.CharField(max_length=200)), + ('tipo_movimento', models.CharField(max_length=200)), + ('id_tp_lancamento', models.CharField(max_length=200)), + ('tipo_lancamento', models.CharField(max_length=200)), + ], + ), migrations.CreateModel( name='Mapeamento', fields=[ @@ -69,36 +98,7 @@ class Migration(migrations.Migration): ('id_departamento', models.CharField(max_length=200)), ('nome_instituicao', models.CharField(max_length=200)), ('id_instituicao_executora', models.CharField(max_length=200)), - ('id_tipo', models.CharField(max_length=201)), - ], - ), - migrations.CreateModel( - name='MapeamentoConveniar', - fields=[ - ('id_mapeamento', models.IntegerField(primary_key=True, serialize=False)), - ('id_favorecido', models.CharField(max_length=200)), - ('nome_favorecido', models.CharField(max_length=200)), - ('cnpj_favorecido', models.CharField(max_length=200)), - ('tipo_favorecido', models.CharField(max_length=200)), - ('valor_lancado', models.CharField(max_length=200)), - ('valor_pago', models.CharField(max_length=200)), - ('data_vencimento', models.CharField(max_length=200)), - ('id_status', models.CharField(max_length=200)), - ('status_lancamento', models.CharField(max_length=200)), - ('flag_receita', models.CharField(max_length=200)), - ('data_baixa', models.CharField(max_length=200)), - ('his_lancamento', models.CharField(max_length=200)), - ('data_emissao', models.CharField(max_length=200)), - ('num_doc_fin', models.CharField(max_length=200)), - ('data_cria', models.CharField(max_length=200)), - ('data_pagamento', models.CharField(max_length=200)), - ('id_lancamento', models.CharField(max_length=200)), - ('id_projeto', models.CharField(max_length=200)), - ('id_rubrica', models.CharField(max_length=200)), - ('nome_rubrica', models.CharField(max_length=200)), - ('tipo_movimento', models.CharField(max_length=200)), - ('id_tp_lancamento', models.CharField(max_length=200)), - ('tipo_lancamento', models.CharField(max_length=200)), + ('id_tipo', models.CharField(max_length=200)), ], ), migrations.CreateModel( @@ -112,6 +112,16 @@ class Migration(migrations.Migration): ('nome_usuario', models.CharField(max_length=200)), ], ), + migrations.CreateModel( + name='UserActivity', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user_id', models.CharField(max_length=255)), + ('tag', models.CharField(max_length=50)), + ('activity', models.TextField()), + ('timestamp', models.DateTimeField(auto_now_add=True)), + ], + ), migrations.CreateModel( name='Template', fields=[ diff --git a/project/app/migrations/0002_employee.py b/project/app/migrations/0002_employee.py new file mode 100644 index 00000000..480b7867 --- /dev/null +++ b/project/app/migrations/0002_employee.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.4 on 2024-02-08 14:22 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('app', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Employee', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cpf', models.CharField(max_length=11)), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/project/app/migrations/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.py b/project/app/migrations/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.py deleted file mode 100755 index 7f555884..00000000 --- a/project/app/migrations/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.2.5 on 2023-10-27 11:30 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('app', '0001_initial'), - ] - - operations = [ - migrations.RenameModel( - old_name='MapeamentoConveniar', - new_name='Lancamento', - ), - ] diff --git a/project/app/migrations/0003_alter_mapeamento_id_tipo.py b/project/app/migrations/0003_alter_mapeamento_id_tipo.py deleted file mode 100755 index 617f6ce0..00000000 --- a/project/app/migrations/0003_alter_mapeamento_id_tipo.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.7 on 2023-11-13 23:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('app', '0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more'), - ] - - operations = [ - migrations.AlterField( - model_name='mapeamento', - name='id_tipo', - field=models.CharField(max_length=200), - ), - ] diff --git a/project/app/migrations/0004_useractivity.py b/project/app/migrations/0004_useractivity.py deleted file mode 100644 index eebc2de3..00000000 --- a/project/app/migrations/0004_useractivity.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 4.2.4 on 2024-02-02 17:26 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('app', '0003_alter_mapeamento_id_tipo'), - ] - - operations = [ - migrations.CreateModel( - name='UserActivity', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('user_id', models.CharField(max_length=255)), - ('activity', models.TextField()), - ('timestamp', models.DateTimeField(auto_now_add=True)), - ], - ), - ] diff --git a/project/app/migrations/0005_useractivity_tag.py b/project/app/migrations/0005_useractivity_tag.py deleted file mode 100644 index d4adec71..00000000 --- a/project/app/migrations/0005_useractivity_tag.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.4 on 2024-02-02 18:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('app', '0004_useractivity'), - ] - - operations = [ - migrations.AddField( - model_name='useractivity', - name='tag', - field=models.CharField(default=None, max_length=50), - ), - ] diff --git a/project/app/migrations/0006_alter_useractivity_tag.py b/project/app/migrations/0006_alter_useractivity_tag.py deleted file mode 100644 index d963b341..00000000 --- a/project/app/migrations/0006_alter_useractivity_tag.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.4 on 2024-02-02 18:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('app', '0005_useractivity_tag'), - ] - - operations = [ - migrations.AlterField( - model_name='useractivity', - name='tag', - field=models.CharField(max_length=50), - ), - ] diff --git a/project/app/migrations/__init__.py b/project/app/migrations/__init__.py old mode 100755 new mode 100644 diff --git a/project/app/models.py b/project/app/models.py index 4e5a617e..5c882833 100755 --- a/project/app/models.py +++ b/project/app/models.py @@ -1,4 +1,9 @@ from django.db import models +from django.contrib.auth.models import User + +class Employee(models.Model): + user = models.OneToOneField(User, on_delete=models.CASCADE) + cpf = models.CharField(max_length=11) class Mapeamento(models.Model): id_mapeamento = models.IntegerField(primary_key=True) diff --git a/project/app/static/css/base_style.css b/project/app/static/css/base_style.css new file mode 100644 index 00000000..f6b381b3 --- /dev/null +++ b/project/app/static/css/base_style.css @@ -0,0 +1,56 @@ +* { + font-family: 'Montserrat', sans-serif; +} + +html, body { + background-image: linear-gradient(#021842 50%, #253e6c); + background-size: contain; /* Added */ + background-repeat: no-repeat; /* Added */ + height: 100vh; + margin: 0; + padding: 0; +} + +nav { + background-color: #021842; + padding-block: 25px; + box-shadow: 10px 5px 5px #021233; +} + +.link-primary { + text-decoration: none; + color: aliceblue; + padding-inline: 10px; +} + +.link-primary:hover { + color: rgb(185, 200, 212); +} + +body { + justify-content: space-between; + flex-direction: column; + display: flex; + margin: 0; +} + +footer { + color: aliceblue; + bottom: 0; + height: 2.5rem; +} + +/* tentativa de deixar a tela responsiva + se o content passa da margem da tela + a cor de fundo nao acompanha */ +/* @media (min-height: 100vh) { + html, body { + height: fit-content; + } +} + +@media (max-height: 100vh) { + html, body { + height: 100vh; + } +} */ \ No newline at end of file diff --git a/project/app/static/css/new_home.css b/project/app/static/css/new_home.css new file mode 100644 index 00000000..4a2f58de --- /dev/null +++ b/project/app/static/css/new_home.css @@ -0,0 +1,19 @@ +:root { + --btn-hover: #F39B00; + --text-color: aliceblue; +} + +.btn { + padding: 15px 50px 15px 50px; + background-color: var(--text-color); + border-radius: 20px; +} + +.btn:hover { + transition: 300ms; + background-color: var(--btn-hover); +} + +h5 { + color: rgb(212, 212, 212); +} \ No newline at end of file diff --git a/project/app/static/imagem/logo50%.svg b/project/app/static/imagem/logo50%.svg new file mode 100644 index 00000000..ab1a7bff --- /dev/null +++ b/project/app/static/imagem/logo50%.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/project/app/templates/404.html b/project/app/templates/404.html new file mode 100644 index 00000000..e88feb8c --- /dev/null +++ b/project/app/templates/404.html @@ -0,0 +1,23 @@ +{% extends 'base_reset.html' %} +{% block conteudo %} +{% load static %} + +
+
+
+
+
Erro 404 - Página não encontrada
+ +
+ + +
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/project/app/templates/base_logged.html b/project/app/templates/base_logged.html new file mode 100755 index 00000000..6caf3804 --- /dev/null +++ b/project/app/templates/base_logged.html @@ -0,0 +1,55 @@ +{% load static %} + + + + AutomaTEC + + + + + + + + + + + + + + + +
+ {% block conteudo %} + + {% endblock %} +
+ +
+ +
+ + \ No newline at end of file diff --git a/project/app/templates/base_reset.html b/project/app/templates/base_reset.html new file mode 100755 index 00000000..6ac5eeaa --- /dev/null +++ b/project/app/templates/base_reset.html @@ -0,0 +1,62 @@ +{% load static %} + + + + AutomaTEC + + + + + + + + + + + + + + + +
+ {% block conteudo %} + + {% endblock %} +
+ +
+ +
+ + \ No newline at end of file diff --git a/project/app/templates/cadastro.html b/project/app/templates/cadastro.html deleted file mode 100755 index 6b9f33f0..00000000 --- a/project/app/templates/cadastro.html +++ /dev/null @@ -1,120 +0,0 @@ - \ No newline at end of file diff --git a/project/app/templates/cadastro_legado.html b/project/app/templates/cadastro_legado.html deleted file mode 100755 index 3cc2e497..00000000 --- a/project/app/templates/cadastro_legado.html +++ /dev/null @@ -1,99 +0,0 @@ -{% load static %} - - - - AutomaTEC - - - - - - - - - - - - -
- finatec -

Sistema de prestação automático

-
- -
- -

Cadastrar

-
- {% csrf_token %} -
-
- - -
-
- - -
-
- -
- {% if error_messages %} - - {% endif %} -

Possui uma conta? Logar

-
-
- - - - \ No newline at end of file diff --git a/project/app/templates/home.html b/project/app/templates/home.html index c66d1bd0..b6aaed5f 100755 --- a/project/app/templates/home.html +++ b/project/app/templates/home.html @@ -1,37 +1,23 @@ -{% extends 'base.html' %} +{% extends 'base_reset.html' %} {% block conteudo %} {% load static %} - - - + -
- - -
+
+
+
+
Sistema de prestação de contas automático.
Facilidade no dia a dia da FINATEC.
+ +
- -
-
-

Automatec

-

Sistema de prestação de contas automático.
Facilidade no dia a dia da FINATEC.

- + + +
-
- logo +
+ logo
- +
{% endblock %} \ No newline at end of file diff --git a/project/app/templates/login.html b/project/app/templates/login.html index 55bcc660..27a17674 100755 --- a/project/app/templates/login.html +++ b/project/app/templates/login.html @@ -1,7 +1,7 @@ -{% extends 'base.html' %} +{% extends 'base_reset.html' %} {% block conteudo %} {% load static %} - + + -
- - -
- - -
-

Login

- -
- {% csrf_token %} -
-
- - - -
-
- - + +
+
+ +
+
+
+
+

Login

+
+ logo +
+ +
+ +
+ +
+
+ {% csrf_token %} + + + +
+
+ +
+ +
+
+ + +
+
+ +
+ +
+
+ + +
+
+ +
+ +
+ + {% if error_message %} +
+

{{ error_message }}

+
+ {% endif %} + + +
-
- -
- - {% if error_message %} -

{{ error_message }}

- {% endif %} -

- Esqueci minha senha -

+
- +
{% endblock %} \ No newline at end of file diff --git a/project/app/templates/password_reset.html b/project/app/templates/password_reset.html index e69de29b..71b7f0ec 100644 --- a/project/app/templates/password_reset.html +++ b/project/app/templates/password_reset.html @@ -0,0 +1,38 @@ +{% extends 'base_reset.html' %} {% block conteudo %} {% load static %} +
+
+
+
+
+
+ Redefinição de senha +
+
+ Esqueceu sua senha? +
+

+ Forneça seu nome de usuário abaixo, e nós te enviaremos um email com instruções para configurar sua nova senha. +

+
+ +
+ +
+ {% csrf_token %} +
+
+
+ + +
+
+ +
+
+
+
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/project/app/templates/password_reset_complete.html b/project/app/templates/password_reset_complete.html index e69de29b..41c6dc63 100644 --- a/project/app/templates/password_reset_complete.html +++ b/project/app/templates/password_reset_complete.html @@ -0,0 +1,24 @@ +{% extends 'base_reset.html' %} {% block conteudo %} {% load static %} +
+
+
+
+
+
+ Redefinição de senha +
+
+ Redefinição de senha completa +
+

+ Sua senha foi definida. Você pode prosseguir e se autenticar agora. +

+
+ Acessar +
+
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/project/app/templates/password_reset_confirm.html b/project/app/templates/password_reset_confirm.html index e69de29b..589248af 100644 --- a/project/app/templates/password_reset_confirm.html +++ b/project/app/templates/password_reset_confirm.html @@ -0,0 +1,3 @@ +{% extends 'base_reset.html' %} {% block conteudo %} {% load static %} + +{% endblock %} \ No newline at end of file diff --git a/project/app/templates/password_reset_done.html b/project/app/templates/password_reset_done.html index e69de29b..ff324497 100644 --- a/project/app/templates/password_reset_done.html +++ b/project/app/templates/password_reset_done.html @@ -0,0 +1,38 @@ +{% extends 'base_reset.html' %} {% block conteudo %} {% load static %} {% load static custom_filters %} +
+
+
+
+
+
+ Redefinição de senha +
+
+ Link enviado +
+

+ O link de redefinição de senha foi enviado para o seguinte endereço de email: +

+
+ {{ request.user.email }} +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/project/app/templates/projeto.html b/project/app/templates/projeto.html index 1202171c..f6cdaf27 100755 --- a/project/app/templates/projeto.html +++ b/project/app/templates/projeto.html @@ -1,169 +1,127 @@ -{% extends 'base.html' %} {% block conteudo %} {% load static %} - - - -
- - - - -
+ - -
- -

Selecione o projeto

-
- {% csrf_token %} -
-
- - -
-
- - -
-
- - -
-
- - - - -
-
-
- + +
+
+
+
+
+
+ + logo +

Selecione o projeto

+ +
+
+ +
+ + + {% csrf_token %} +
+ + +
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ +
- - +
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/project/app/templates/user_activity_logs.html b/project/app/templates/user_activity_logs.html index d8b97e50..26ff0533 100644 --- a/project/app/templates/user_activity_logs.html +++ b/project/app/templates/user_activity_logs.html @@ -1,4 +1,5 @@ +{% extends 'base.html' %} {% block conteudo %} {% load static %} @@ -11,7 +12,7 @@