mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 11:04:20 +00:00
com: use MarkdownInput for weekmail
This commit is contained in:
parent
d53d725415
commit
d2021ecf7e
20
com/views.py
20
com/views.py
@ -49,7 +49,7 @@ from core.views import (
|
|||||||
CanCreateMixin,
|
CanCreateMixin,
|
||||||
QuickNotifMixin,
|
QuickNotifMixin,
|
||||||
)
|
)
|
||||||
from core.views.forms import SelectDateTime
|
from core.views.forms import SelectDateTime, MarkdownInput
|
||||||
from core.models import Notification, RealGroup, User
|
from core.models import Notification, RealGroup, User
|
||||||
from club.models import Club, Mailing
|
from club.models import Club, Mailing
|
||||||
|
|
||||||
@ -461,6 +461,12 @@ class WeekmailEditView(ComTabsMixin, QuickNotifMixin, CanEditPropMixin, UpdateVi
|
|||||||
Weekmail,
|
Weekmail,
|
||||||
fields=["title", "intro", "joke", "protip", "conclusion"],
|
fields=["title", "intro", "joke", "protip", "conclusion"],
|
||||||
help_texts={"title": _("Delete and save to regenerate")},
|
help_texts={"title": _("Delete and save to regenerate")},
|
||||||
|
widgets={
|
||||||
|
"intro": MarkdownInput,
|
||||||
|
"joke": MarkdownInput,
|
||||||
|
"protip": MarkdownInput,
|
||||||
|
"conclusion": MarkdownInput,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
success_url = reverse_lazy("com:weekmail")
|
success_url = reverse_lazy("com:weekmail")
|
||||||
current_tab = "weekmail"
|
current_tab = "weekmail"
|
||||||
@ -533,7 +539,11 @@ class WeekmailArticleEditView(
|
|||||||
"""Edit an article"""
|
"""Edit an article"""
|
||||||
|
|
||||||
model = WeekmailArticle
|
model = WeekmailArticle
|
||||||
fields = ["title", "club", "content"]
|
form_class = modelform_factory(
|
||||||
|
WeekmailArticle,
|
||||||
|
fields=["title", "club", "content"],
|
||||||
|
widgets={"content": MarkdownInput},
|
||||||
|
)
|
||||||
pk_url_kwarg = "article_id"
|
pk_url_kwarg = "article_id"
|
||||||
template_name = "core/edit.jinja"
|
template_name = "core/edit.jinja"
|
||||||
success_url = reverse_lazy("com:weekmail")
|
success_url = reverse_lazy("com:weekmail")
|
||||||
@ -545,7 +555,11 @@ class WeekmailArticleCreateView(QuickNotifMixin, CreateView):
|
|||||||
"""Post an article"""
|
"""Post an article"""
|
||||||
|
|
||||||
model = WeekmailArticle
|
model = WeekmailArticle
|
||||||
fields = ["title", "club", "content"]
|
form_class = modelform_factory(
|
||||||
|
WeekmailArticle,
|
||||||
|
fields=["title", "club", "content"],
|
||||||
|
widgets={"content": MarkdownInput},
|
||||||
|
)
|
||||||
template_name = "core/create.jinja"
|
template_name = "core/create.jinja"
|
||||||
success_url = reverse_lazy("core:user_tools")
|
success_url = reverse_lazy("core:user_tools")
|
||||||
quick_notif_url_arg = "qn_weekmail_new_article"
|
quick_notif_url_arg = "qn_weekmail_new_article"
|
||||||
|
Loading…
Reference in New Issue
Block a user