Skip to content

Commit

Permalink
aplicações e modelos implementados
Browse files Browse the repository at this point in the history
Co-authored-by: vinialves2020 <[email protected]>
Co-authored-by: bolzanMGB <[email protected]>
  • Loading branch information
3 people committed Dec 23, 2024
1 parent d73ab51 commit b5e3629
Show file tree
Hide file tree
Showing 37 changed files with 567 additions and 7 deletions.
Binary file modified mamutes/Users/__pycache__/models.cpython-312.pyc
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 5.1.4 on 2024-12-22 23:23

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('Users', '0007_remove_membroequipe_profile_picture'),
]

operations = [
migrations.RemoveField(
model_name='membroequipe',
name='areas',
),
migrations.RemoveField(
model_name='membroequipe',
name='functions',
),
]
4 changes: 2 additions & 2 deletions mamutes/Users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class MembroEquipe(AbstractUser):
email = models.EmailField(max_length=200, blank=False, null=False)
phone = models.CharField(max_length=20, blank=False, null=False)

areas = models.ManyToManyField(Area, related_name='membros', blank=True)
functions = models.ManyToManyField(Function, related_name='membros', blank=True)
#areas = models.ManyToManyField(Area, related_name='membros', blank=True)
#functions = models.ManyToManyField(Function, related_name='membros', blank=True)

def __str__(self):
return self.username
Binary file modified mamutes/db.sqlite3
Binary file not shown.
6 changes: 3 additions & 3 deletions mamutes/guest/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<meta property="og:description" content="Saiba mais sobre a equipe Mamutes do Cerrado, nossa participação na competição SAE AeroDesign e como fazemos a diferença na engenharia aeroespacial.">
<meta property="og:image" content="{% static 'img/hero-alterar.css' %}"><!--ALTERARRRRRRRRRRR-->
<meta property="og:url" content="https://www.seusite.com">
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
</style>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
<meta property="og:type" content="website">
{% block css %}{% endblock %}
</head>
Expand Down
3 changes: 3 additions & 0 deletions mamutes/mamutes/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
'django.contrib.messages',
'Users',
'guest',
'report',
'members',
'stock',
'django.contrib.staticfiles',
]

Expand Down
16 changes: 14 additions & 2 deletions mamutes/mamutes/urls.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
from django.contrib import admin
from django.urls import path
from django.urls import path, include
from Users.views import login, register, recoverAccount, redefinePassword
from guest.views import index, competition, admission


urlpatterns = [

path('admin/', admin.site.urls),

# Users
path('login/', login, name='login'),
path('register/', register, name='register'),
path('account_recovery/', recoverAccount, name='recoverAccount'),
path('redefine_password/<str:username>/<str:token>', redefinePassword, name="redefinePassword"),

# guest
path('', index, name="index"),
path('competition/', competition, name="competition"),
path('admission/', admission, name="admission"),

# report
path('report/', include('report.urls')),

# members

# stock

]
Empty file added mamutes/members/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions mamutes/members/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions mamutes/members/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class MembersConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'members'
28 changes: 28 additions & 0 deletions mamutes/members/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.1.4 on 2024-12-22 23:23

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('description', models.TextField()),
('status', models.CharField(choices=[('Pendente', 'Pendente'), ('Em Progresso', 'Em Progresso'), ('Concluída', 'Concluída')], max_length=15)),
('creation_date', models.DateTimeField(auto_now_add=True)),
('completion_date', models.DateTimeField(blank=True, null=True)),
('responsible', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
Empty file.
19 changes: 19 additions & 0 deletions mamutes/members/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from django.db import models
from Users.models import MembroEquipe

# Create your models here.
class Task(models.Model):
id = models.AutoField(primary_key=True)
STATUS_CHOICES = [
('Pendente', 'Pendente'),
('Em Progresso', 'Em Progresso'),
('Concluída', 'Concluída'),
]
description = models.TextField()
status = models.CharField(max_length=15, choices=STATUS_CHOICES)
creation_date = models.DateTimeField(auto_now_add=True)
completion_date = models.DateTimeField(null=True, blank=True)
responsible = models.ForeignKey(MembroEquipe, on_delete=models.CASCADE)

def __str__(self):
return f"{self.description} - {self.status}"
3 changes: 3 additions & 0 deletions mamutes/members/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions mamutes/members/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
Empty file added mamutes/report/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions mamutes/report/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.contrib import admin
from .models import FlightLog
from .models import Minutes
from .models import AccidentLog
# Register your models here.
admin.site.register(FlightLog)
admin.site.register(Minutes)
admin.site.register(AccidentLog)
6 changes: 6 additions & 0 deletions mamutes/report/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ReportConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'report'
7 changes: 7 additions & 0 deletions mamutes/report/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django import forms
from .models import FlightLog

class FlightForm(forms.ModelForm):
class Meta:
model = FlightLog
fields = '__all__' # Inclui todos os campos do modelo Voo
66 changes: 66 additions & 0 deletions mamutes/report/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Generated by Django 5.1.4 on 2024-12-22 23:23

import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='FlightLog',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('date', models.DateField()),
('start_time', models.TimeField()),
('end_time', models.TimeField()),
('document_username', models.CharField(max_length=255)),
('pilot_name', models.CharField(max_length=255)),
('location', models.CharField(max_length=255)),
('team_members', models.TextField()),
('flight_success_rating', models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)])),
('flight_objective_description', models.TextField()),
('results', models.TextField()),
('pilot_impressions', models.TextField()),
('improvements', models.TextField()),
('wind_speed', models.DecimalField(decimal_places=3, max_digits=4)),
('wind_direction', models.CharField(max_length=100)),
('atmospheric_pressure', models.DecimalField(decimal_places=3, max_digits=4)),
('total_takeoff_weight', models.DecimalField(decimal_places=3, max_digits=4)),
('flight_cycles', models.PositiveIntegerField()),
('telemetry_link', models.URLField()),
('occurred_accident', models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name='AccidentLog',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('description', models.TextField()),
('damaged_parts', models.TextField()),
('damaged_parts_photo', models.URLField()),
('was_turbulent', models.BooleanField(default=False)),
('pilot_flight_count', models.PositiveIntegerField()),
('pilot_impressions', models.TextField()),
('id_flightLog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='report.flightlog')),
],
),
migrations.CreateModel(
name='Minutes',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('date', models.DateField()),
('title', models.CharField(max_length=200)),
('content', models.TextField()),
('responsible', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
Empty file.
56 changes: 56 additions & 0 deletions mamutes/report/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from django.db import models
from Users.models import MembroEquipe
from django.core.validators import MinValueValidator, MaxValueValidator

class Minutes(models.Model):
id = models.AutoField(primary_key=True)
date = models.DateField()
title = models.CharField(max_length=200)
content = models.TextField()
responsible = models.ForeignKey(MembroEquipe, on_delete=models.CASCADE)

def __str__(self):
return self.title

class FlightLog(models.Model):
id = models.AutoField(primary_key=True)
date = models.DateField()
start_time = models.TimeField()
end_time = models.TimeField()
document_username = models.CharField(max_length=255)
pilot_name = models.CharField(max_length=255)
location = models.CharField(max_length=255)
team_members = models.TextField()
flight_success_rating = models.IntegerField(validators=[MinValueValidator(1),MaxValueValidator(5)])
flight_objective_description = models.TextField() #########
results = models.TextField()
pilot_impressions = models.TextField()
improvements = models.TextField()
wind_speed = models.DecimalField(max_digits=4, decimal_places=3)
wind_direction = models.CharField(max_length=100)
atmospheric_pressure = models.DecimalField(max_digits=4, decimal_places=3)
total_takeoff_weight = models.DecimalField(max_digits=4, decimal_places=3)
flight_cycles = models.PositiveIntegerField()
telemetry_link = models.URLField()
occurred_accident = models.BooleanField(default=False)

def __str__(self):
return f"Flight Log {self.id} - {self.date} by {self.pilot_name}"

class AccidentLog(models.Model):
id = models.AutoField(primary_key=True)
id_flightLog = models.ForeignKey(FlightLog, on_delete=models.CASCADE)
description = models.TextField()
damaged_parts = models.TextField()
damaged_parts_photo = models.URLField()
was_turbulent = models.BooleanField(default=False)
pilot_flight_count = models.PositiveIntegerField()
pilot_impressions = models.TextField()

def __str__(self):
return f"Accident Log {self.id} - Flight {self.flight_log.id}"





92 changes: 92 additions & 0 deletions mamutes/report/static/css/voolist.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
body {
font-family: Arial, sans-serif;
background-color: #121212;
color: #f5f5f5;
margin: 0;
padding: 20px;
}

h1 {
text-align: center;
color: #1e90ff;
margin-bottom: 20px;
}

table {
width: 100%;
border-collapse: collapse;
background-color: #1c1c1c;
margin: 0 auto;
border-radius: 8px;
overflow: hidden;
}

thead {
background-color: #1e90ff;
}

thead th {
color: white;
text-align: left;
padding: 12px;
}

tbody tr {
border-bottom: 1px solid #333;
}

tbody tr:nth-child(even) {
background-color: #181818;
}

tbody tr:hover {
background-color: #1e90ff;
color: white;
}

tbody td {
padding: 12px;
}

a {
color: #1e90ff;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

.btn {
padding: 6px 12px;
border-radius: 4px;
text-decoration: none;
color: #fff;
font-weight: bold;
}

.btn-editar {
background-color: #007bff;
}

.btn-editar:hover {
background-color: #0056b3;
}

.btn-excluir {
background-color: #dc3545;
}

.btn-excluir:hover {
background-color: #a71d2a;
}

@media (max-width: 768px) {
table {
font-size: 14px;
}

thead {
font-size: 16px;
}
}
Loading

0 comments on commit b5e3629

Please sign in to comment.