From 8be59ecff7f0e0cf4a29ee74b754dc0a7fe65af2 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 20 May 2021 18:00:12 -0400 Subject: [PATCH] Reduce the height of the notes field in taskDetail --- tasks/forms.py | 4 ++++ tasks/templates/tasks/taskDetail.djhtml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks/forms.py b/tasks/forms.py index eef1f93..14e7c93 100644 --- a/tasks/forms.py +++ b/tasks/forms.py @@ -1,6 +1,7 @@ from datetime import datetime from django import forms +from markdownx.widgets import MarkdownxWidget from .models import Event @@ -8,6 +9,9 @@ class EventForm(forms.ModelForm): class Meta: model = Event fields = ['date', 'user', 'notes'] + widgets = { + 'notes': MarkdownxWidget(attrs={'rows': 2}), + } def __init__(self, *args, **kwargs): user = kwargs.pop('user') diff --git a/tasks/templates/tasks/taskDetail.djhtml b/tasks/templates/tasks/taskDetail.djhtml index 7203700..d98e121 100644 --- a/tasks/templates/tasks/taskDetail.djhtml +++ b/tasks/templates/tasks/taskDetail.djhtml @@ -82,7 +82,7 @@ {% csrf_token %} {% render_field form.date type="date" class="form-control" %} {% render_field form.user class="form-control" style="width: initial;" %} - {% render_field form.notes class="form-control form-control-sm" rows="2" %} + {% render_field form.notes class="form-control form-control-sm" %}