diff --git a/courses/templates/subject/form_view_teacher.html b/courses/templates/subject/form_view_teacher.html index 9acd26c..11ee35a 100644 --- a/courses/templates/subject/form_view_teacher.html +++ b/courses/templates/subject/form_view_teacher.html @@ -2,20 +2,31 @@ {% block javascript %} {% endblock %} @@ -43,10 +54,15 @@ diff --git a/forum/forms.py b/forum/forms.py new file mode 100644 index 0000000..945ea8a --- /dev/null +++ b/forum/forms.py @@ -0,0 +1,20 @@ +from django import forms +from django.utils.translation import ugettext_lazy as _ +from .models import Forum + +class ForumForm(forms.ModelForm): + + class Meta: + model = Forum + fields = ('title', 'description') + labels = { + 'title': _('Title'), + 'description': _('Description') + } + help_texts = { + 'title': _('Forum title'), + 'description': _('What is this forum about?') + } + widgets = { + 'description': forms.Textarea(attrs={'cols': 80, 'rows': 5}), + } \ No newline at end of file diff --git a/forum/templates/forum_form.html b/forum/templates/forum_form.html new file mode 100644 index 0000000..06a4b8d --- /dev/null +++ b/forum/templates/forum_form.html @@ -0,0 +1,30 @@ +{% load static i18n %} +{% load widget_tweaks %} + +
+ {% csrf_token %} + {% for field in form %} +
+ + {% render_field field class='form-control' %} + {{ field.help_text }} + {% if field.errors %} +
+
+ +
+ {% endif %} +
+ {% endfor %} + + +
\ No newline at end of file diff --git a/forum/templates/forum_list.html b/forum/templates/forum_list.html index 0556598..873bbe3 100644 --- a/forum/templates/forum_list.html +++ b/forum/templates/forum_list.html @@ -1,9 +1,19 @@ - -