From dc800b59f450dcaff98a065a7e43bbdb51c0def8 Mon Sep 17 00:00:00 2001 From: Bartuccio Antoine Date: Thu, 20 Dec 2018 15:13:59 +0100 Subject: [PATCH] com: use MarkdownInput for alert_msg, info_msg and index_page editing --- com/views.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/com/views.py b/com/views.py index 0a13fce8..803962e3 100644 --- a/com/views.py +++ b/com/views.py @@ -167,19 +167,25 @@ class ComEditView(ComTabsMixin, CanEditPropMixin, UpdateView): class AlertMsgEditView(ComEditView): - fields = ["alert_msg"] + form_class = modelform_factory( + Sith, fields=["alert_msg"], widgets={"alert_msg": MarkdownInput} + ) current_tab = "alert" success_url = reverse_lazy("com:alert_edit") class InfoMsgEditView(ComEditView): - fields = ["info_msg"] + form_class = modelform_factory( + Sith, fields=["info_msg"], widgets={"info_msg": MarkdownInput} + ) current_tab = "info" success_url = reverse_lazy("com:info_edit") class IndexEditView(ComEditView): - fields = ["index_page"] + form_class = modelform_factory( + Sith, fields=["index_page"], widgets={"index_page": MarkdownInput} + ) current_tab = "index" success_url = reverse_lazy("com:index_edit")