-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from labens-ufrn/AttLink
Implementação do Cadastrar Link e do Detalhar Tarefa.
- Loading branch information
Showing
10 changed files
with
180 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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__' | ||
fields = '__all__' | ||
|
||
class LinkForm(forms.ModelForm): | ||
class Meta: | ||
model = Link | ||
fields = '__all__' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tasktracking/tasks/templates/tasks/link/cadastrar_link.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block titulo %} | ||
<title>PWeb 2020.6 - Adicionar Link</title> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="container"> | ||
<form method="post"> | ||
{% csrf_token %} | ||
|
||
<table class="table table-sm table-responsive-sm"> | ||
{% for field in form_link.visible_fields %} | ||
<tr> | ||
<th class="align-middle"> | ||
<label>{{ field.label_tag }}</label> | ||
</th> | ||
<td class="align-middle">{{ field }} | ||
{% if field.help_text %} | ||
<small style="color: grey">{{ field.help_text }}</small> | ||
{% endif %} | ||
{% for error in field.errors %} | ||
<p style="color: red">{{ error }}</p> | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
|
||
<div> | ||
<input type="submit" value="Salvar"> | ||
</div> | ||
</form> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block titulo %} | ||
<title>PWeb 2020.6 - Detalhar Tarefa</title> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="content"> | ||
<table class="table table-striped table-sm table-bordered"> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Identificador</td> | ||
<td>{{ object.identificador }}</td> | ||
</tr> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Nome</td> | ||
<td>{{ object.nome }}</td> | ||
</tr> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Descrição</td> | ||
<td>{{ object.descrição }}</td> | ||
</tr> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Criação</td> | ||
<td>{{ object.criada_em }}</td> | ||
</tr> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Fechamento</td> | ||
<td>{{ object.fechada_em }}</td> | ||
</tr> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Status</td> | ||
<td>{{ object.status }}</td> | ||
</tr> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Situação</td> | ||
<td>{{ object.situacao }}</td> | ||
</tr> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Criador</td> | ||
<td>{{ object.usuario }}</td> | ||
</tr> | ||
<tr> | ||
<td class="font-weight-bold" width="20%">Links</td> | ||
<td> | ||
<ul> | ||
{% for link in object.link_set.all %} | ||
<li>{{ link }}</li> | ||
{% endfor %} | ||
</ul> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
{% endblock%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters