Refactor news:core template paths

This commit is contained in:
sonny 2020-05-21 13:44:04 +02:00
parent 9df0a86790
commit f97e495e72
10 changed files with 11 additions and 11 deletions

View file

@ -1,6 +0,0 @@
from django.forms.widgets import CheckboxSelectMultiple
class RulesWidget(CheckboxSelectMultiple):
template_name = "collection/widgets/rules.html"
option_template_name = "collection/widgets/rule.html"

View file

@ -1,8 +1,8 @@
from django import forms from django import forms
from newsreader.news.collection.models import CollectionRule from newsreader.news.collection.models import CollectionRule
from newsreader.news.collection.widgets import RulesWidget
from newsreader.news.core.models import Category from newsreader.news.core.models import Category
from newsreader.news.core.widgets import RulesWidget
class CategoryForm(forms.ModelForm): class CategoryForm(forms.ModelForm):

View file

@ -9,7 +9,7 @@ from newsreader.news.core.models import Category
class NewsView(TemplateView): class NewsView(TemplateView):
template_name = "core/homepage.html" template_name = "news/core/views/homepage.html"
# TODO serialize objects to show filled main page # TODO serialize objects to show filled main page
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
@ -55,14 +55,14 @@ class CategoryDetailMixin:
class CategoryListView(CategoryViewMixin, ListView): class CategoryListView(CategoryViewMixin, ListView):
template_name = "core/categories.html" template_name = "news/core/views/categories.html"
context_object_name = "categories" context_object_name = "categories"
class CategoryUpdateView(CategoryViewMixin, CategoryDetailMixin, UpdateView): class CategoryUpdateView(CategoryViewMixin, CategoryDetailMixin, UpdateView):
template_name = "core/category-update.html" template_name = "news/core/views/category-update.html"
context_object_name = "category" context_object_name = "category"
class CategoryCreateView(CategoryViewMixin, CategoryDetailMixin, CreateView): class CategoryCreateView(CategoryViewMixin, CategoryDetailMixin, CreateView):
template_name = "core/category-create.html" template_name = "news/core/views/category-create.html"

View file

@ -0,0 +1,6 @@
from django.forms.widgets import CheckboxSelectMultiple
class RulesWidget(CheckboxSelectMultiple):
template_name = "news/core/widgets/rules.html"
option_template_name = "news/core/widgets/rule.html"