From 1eb72f45ef1d366b4c8c4ac7d57b0ce73d311b4a Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Fri, 28 Aug 2020 21:55:34 +0200 Subject: [PATCH] Use css to customize article content widget --- articles/admin.py | 5 ----- articles/static/admin_articles.css | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/articles/admin.py b/articles/admin.py index f4e5e65..e8fba8f 100644 --- a/articles/admin.py +++ b/articles/admin.py @@ -1,8 +1,6 @@ -from django import forms from django.contrib import admin, messages from django.contrib.admin import register from django.contrib.auth.admin import UserAdmin -from django.db import models from django.shortcuts import redirect from .models import Article, Comment, Page, User @@ -46,9 +44,6 @@ class ArticleAdmin(admin.ModelAdmin): "status", "published_at", ] - formfield_overrides = { - models.TextField: {"widget": forms.Textarea(attrs={"style": "width: 98%"})}, - } prepopulated_fields = {"slug": ("title",)} change_form_template = "articles/article_change_form.html" diff --git a/articles/static/admin_articles.css b/articles/static/admin_articles.css index a30f3f4..5b98993 100644 --- a/articles/static/admin_articles.css +++ b/articles/static/admin_articles.css @@ -1,5 +1,7 @@ #id_content { font-family: "JetBrains Mono", monospace; + width: calc(100% - 1em); + resize: vertical; } label[for=id_content] {