diff --git a/tasktracking/tasks/forms.py b/tasktracking/tasks/forms.py index 62b3fe0..57427f7 100644 --- a/tasktracking/tasks/forms.py +++ b/tasktracking/tasks/forms.py @@ -1,8 +1,13 @@ from django import forms -from tasks.models import Tarefa +from tasks.models import Link, Tarefa class TarefaForm(forms.ModelForm): class Meta: model = Tarefa - fields = '__all__' \ No newline at end of file + fields = '__all__' + +class LinkForm(forms.ModelForm): + class Meta: + model = Link + fields = '__all__' diff --git a/tasktracking/tasks/migrations/0004_link_tarefa.py b/tasktracking/tasks/migrations/0004_link_tarefa.py new file mode 100644 index 0000000..6ef0222 --- /dev/null +++ b/tasktracking/tasks/migrations/0004_link_tarefa.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1.2 on 2020-11-12 11:47 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('tasks', '0003_auto_20201105_0835'), + ] + + operations = [ + migrations.AddField( + model_name='link', + name='tarefa', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='tasks.tarefa'), + ), + ] diff --git a/tasktracking/tasks/models.py b/tasktracking/tasks/models.py index e9bb52d..cf67ffc 100644 --- a/tasktracking/tasks/models.py +++ b/tasktracking/tasks/models.py @@ -15,6 +15,9 @@ class Usuario(models.Model): null=True ) + def __str__(self): + return self.nome + class Tag(models.Model): """ Jonas @@ -31,9 +34,10 @@ class Link(models.Model): """ nome = models.CharField(max_length=50) url = models.URLField() + tarefa = models.ForeignKey('Tarefa', on_delete=models.CASCADE, null=True) + def __str__(self): - self.nome - self.url + return self.nome + ' ' + self.url class Tarefa(models.Model): @@ -61,7 +65,6 @@ class Tarefa(models.Model): fechada_em = models.DateTimeField(null=True, blank=True) status = models.CharField(max_length=1, choices=STATUS_CHOICES) situacao = models.CharField(max_length=1, choices=SITUACAO_CHOICES) - usuario = models.ForeignKey(Usuario, on_delete=models.PROTECT) def __str__(self): diff --git a/tasktracking/tasks/static/css/styles.css b/tasktracking/tasks/static/css/styles.css index 5653f79..edc3b16 100644 --- a/tasktracking/tasks/static/css/styles.css +++ b/tasktracking/tasks/static/css/styles.css @@ -2,9 +2,10 @@ padding: 0; } + /* Barra de Navegação */ -.navbar { +.navbar { border-bottom: 1px solid #333; margin-bottom: 20px; } @@ -22,6 +23,7 @@ letter-spacing: 1px; } + /* Botão de adicionar */ .add-div { @@ -40,6 +42,7 @@ margin-left: 5px; } + /* Busca */ .fas.fa-search { @@ -55,6 +58,7 @@ display: inline-block; } + /* Lista de tarefas */ .list-div { @@ -82,15 +86,18 @@ } .fas.fa-edit { - color: #808080 ; + color: #808080; cursor: pointer; margin: 5px; font-size: 20px; float: right; } + /* Rodapé */ -footer { + +footer#rodape { + clear: both; background-color: #333; position: absolute; bottom: 0; @@ -99,9 +106,9 @@ footer { border-top: 2px solid #202020; } -footer p { - color: #f5f5f5; +footer#rodape p { text-align: center; + color: #f5f5f5; top: 40%; position: relative; -} +} \ No newline at end of file diff --git a/tasktracking/tasks/templates/base.html b/tasktracking/tasks/templates/base.html index 07bb395..fc76fec 100644 --- a/tasktracking/tasks/templates/base.html +++ b/tasktracking/tasks/templates/base.html @@ -17,24 +17,24 @@ - + + {% block content %} {% endblock %} -