diff --git a/forum/templates/forum/forum_form.html b/forum/templates/forum/forum_form.html new file mode 100644 index 0000000..06a4b8d --- /dev/null +++ b/forum/templates/forum/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/forum_list.html b/forum/templates/forum/forum_list.html new file mode 100644 index 0000000..6845d7f --- /dev/null +++ b/forum/templates/forum/forum_list.html @@ -0,0 +1,36 @@ +{% load i18n permission_tags %} + +{% if foruns|length > 0 %} + {% for forum in foruns %} + + + +
+
+
+
+ {% endfor %} +{% else %} + +{% endif %} diff --git a/forum/templates/forum_form.html b/forum/templates/forum_form.html deleted file mode 100644 index 06a4b8d..0000000 --- a/forum/templates/forum_form.html +++ /dev/null @@ -1,30 +0,0 @@ -{% 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 deleted file mode 100644 index 6845d7f..0000000 --- a/forum/templates/forum_list.html +++ /dev/null @@ -1,36 +0,0 @@ -{% load i18n permission_tags %} - -{% if foruns|length > 0 %} - {% for forum in foruns %} - - - -
-
-
-
- {% endfor %} -{% else %} - -{% endif %} diff --git a/forum/templates/post/post_list.html b/forum/templates/post/post_list.html new file mode 100644 index 0000000..ac6e36b --- /dev/null +++ b/forum/templates/post/post_list.html @@ -0,0 +1,40 @@ +{% load i18n permission_tags %} + +{% if posts|length > 0 %} + +{% else %} +

{% trans 'No posts were made yet.' %}

+{% endif %} \ No newline at end of file diff --git a/forum/templates/post_answer_list.html b/forum/templates/post_answer_list.html deleted file mode 100644 index e24b012..0000000 --- a/forum/templates/post_answer_list.html +++ /dev/null @@ -1,47 +0,0 @@ -{% load i18n permission_tags %} - -{% if answers|length > 0 %} - -{% else %} -

{% trans 'Nobody answered this post yet.' %}

-{% endif %} \ No newline at end of file diff --git a/forum/templates/post_answers/post_answer_list.html b/forum/templates/post_answers/post_answer_list.html new file mode 100644 index 0000000..e24b012 --- /dev/null +++ b/forum/templates/post_answers/post_answer_list.html @@ -0,0 +1,47 @@ +{% load i18n permission_tags %} + +{% if answers|length > 0 %} + +{% else %} +

{% trans 'Nobody answered this post yet.' %}

+{% endif %} \ No newline at end of file diff --git a/forum/templates/post_list.html b/forum/templates/post_list.html deleted file mode 100644 index ac6e36b..0000000 --- a/forum/templates/post_list.html +++ /dev/null @@ -1,40 +0,0 @@ -{% load i18n permission_tags %} - -{% if posts|length > 0 %} - -{% else %} -

{% trans 'No posts were made yet.' %}

-{% endif %} \ No newline at end of file diff --git a/forum/views.py b/forum/views.py index 93bdc4f..77a6f1a 100644 --- a/forum/views.py +++ b/forum/views.py @@ -13,7 +13,7 @@ class ForumIndex(LoginRequiredMixin, generic.ListView): login_url = reverse_lazy("core:home") redirect_field_name = 'next' - template_name = "forum_list.html" + template_name = "forum/forum_list.html" context_object_name = 'foruns' def get_queryset(self): @@ -25,7 +25,7 @@ class ForumIndex(LoginRequiredMixin, generic.ListView): class CreateForumView(LoginRequiredMixin, generic.edit.CreateView): - template_name = 'forum_form.html' + template_name = 'forum/forum_form.html' form_class = ForumForm success_url = reverse_lazy('forum:index') @@ -33,7 +33,7 @@ class PostIndex(LoginRequiredMixin, generic.ListView): login_url = reverse_lazy("core:home") redirect_field_name = 'next' - template_name = "post_list.html" + template_name = "post/post_list.html" context_object_name = 'posts' def get_queryset(self): @@ -47,7 +47,7 @@ class PostAnswerIndex(LoginRequiredMixin, generic.ListView): login_url = reverse_lazy("core:home") redirect_field_name = 'next' - template_name = "post_answer_list.html" + template_name = "post_answers/post_answer_list.html" context_object_name = 'answers' def get_queryset(self): -- libgit2 0.21.2