From e252030e5a0fcacbaa776e8b0339de5f7ea8ac3c Mon Sep 17 00:00:00 2001
From: Fedeper
Date: Fri, 6 Oct 2017 18:42:56 -0300
Subject: [PATCH] editar tareas
---
tareas/forms.py | 4 +-
tareas/models.py | 1 +
tareas/static/css/tareas.css | 4 ++
tareas/templates/tareas/comentario.html | 55 +++++++++++++++-------
tareas/templates/tareas/editar_tareas.html | 2 +-
tareas/views.py | 49 ++++++++++++++-----
topolino/urls.py | 3 +-
7 files changed, 84 insertions(+), 34 deletions(-)
diff --git a/tareas/forms.py b/tareas/forms.py
index 91b421a..beb2e56 100644
--- a/tareas/forms.py
+++ b/tareas/forms.py
@@ -5,7 +5,7 @@
from pagedown.widgets import PagedownWidget
-# creo un formulario con el campo texto para mostrar
+# creo un formulario que hereda de Comentario y agrega el atributo fields(campo texto) con el campo texto para mostrar
class Comentarios(forms.ModelForm):
class Meta:
model= Comentario
@@ -23,7 +23,7 @@ class ComentarioForm(forms.ModelForm):
texto = forms.CharField(widget=PagedownWidget(show_preview=False))
class Meta:
model = Comentario
- fields=['texto']
+ fields = ['texto']
class TareaForm(forms.ModelForm):
descripcion = forms.CharField(widget=PagedownWidget(show_preview=False))
diff --git a/tareas/models.py b/tareas/models.py
index c1ce69d..baf4441 100644
--- a/tareas/models.py
+++ b/tareas/models.py
@@ -38,6 +38,7 @@ def __str__(self):
return self.nombre
class Comentario(models.Model):
+ # relaciono un comentario a una tarea a traves de su clave foranea
tarea = models.ForeignKey(Tarea, null=True)
usuario = models.ForeignKey(User)
fecha = models.DateTimeField(default= timezone.now)
diff --git a/tareas/static/css/tareas.css b/tareas/static/css/tareas.css
index 6e73eb1..dd62bf6 100644
--- a/tareas/static/css/tareas.css
+++ b/tareas/static/css/tareas.css
@@ -18,6 +18,10 @@
font-family: 'Lobster', cursive;
}
+ h5 {
+ font-family: 'Lobster', cursive; text-align: right;
+ }
+
.date {
float: right;
color: #828282;
diff --git a/tareas/templates/tareas/comentario.html b/tareas/templates/tareas/comentario.html
index 55ba4db..4a173c4 100644
--- a/tareas/templates/tareas/comentario.html
+++ b/tareas/templates/tareas/comentario.html
@@ -24,9 +24,29 @@
{% endif %}
- {{tarea.usuario}} {{tarea.fecha_creacion}}
+
+
- {{tarea.descripcion|markdown}}
{% block arriba %}
@@ -40,23 +60,22 @@
Comentarios
Descripción
+ {{tarea.usuario}} +{{tarea.fecha_creacion}}
+ {{tarea.descripcion|markdown}} EDITAR
+