Tag lists support
This commit is contained in:
parent
37388ba7be
commit
c763557e81
4 changed files with 60 additions and 3 deletions
|
@ -195,6 +195,28 @@ ul.nav-list li {
|
|||
list-style-type: none;
|
||||
}
|
||||
|
||||
ul.tag-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
max-width: 500px;
|
||||
text-indent: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
ul.tag-list li {
|
||||
display: inline-block;
|
||||
border: 1px solid #808080;
|
||||
border-radius: 12px;
|
||||
height: 18px;
|
||||
background-color: #e0e0e0;
|
||||
padding: 3px 6px 3px 6px;
|
||||
}
|
||||
|
||||
ul.tag-list li a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
table.list {
|
||||
border: 2px solid black;
|
||||
border-spacing: 0px;
|
||||
|
|
|
@ -16,8 +16,25 @@ Including another URLconf
|
|||
|
||||
from django.urls import path
|
||||
|
||||
from .views import WorkshopListView, AreaListView, BoxListView, ItemListView, ManufacturerListView, DistributorListView
|
||||
from .views import WorkshopView, AreaView, BoxView, ItemView, DistributorView, ManufacturerView, IndexView
|
||||
from .views import (
|
||||
WorkshopListView,
|
||||
AreaListView,
|
||||
BoxListView,
|
||||
ItemListView,
|
||||
ManufacturerListView,
|
||||
DistributorListView,
|
||||
TagListView
|
||||
)
|
||||
from .views import (
|
||||
WorkshopView,
|
||||
AreaView,
|
||||
BoxView,
|
||||
ItemView,
|
||||
DistributorView,
|
||||
ManufacturerView,
|
||||
IndexView,
|
||||
TagView
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
path('workshops', WorkshopListView.as_view(), name='workshop-list'),
|
||||
|
@ -33,5 +50,7 @@ urlpatterns = [
|
|||
path('manufacturer/<int:pk>', ManufacturerView.as_view(), name='manufacturer-detail'),
|
||||
path('distributors', DistributorListView.as_view(), name='distributor-list'),
|
||||
path('distributor/<int:pk>', DistributorView.as_view(), name='distributor-detail'),
|
||||
path('tags', TagListView.as_view(), name='tag-list'),
|
||||
path('tag/<int:pk>', TagView.as_view(), name='tag-detail'),
|
||||
path('', IndexView.as_view(), name='index')
|
||||
]
|
||||
|
|
|
@ -5,6 +5,7 @@ from .item import ItemView, ItemListView
|
|||
from .manufacturer import ManufacturerView, ManufacturerListView
|
||||
from .workshop import WorkshopView, WorkshopListView
|
||||
from .index import IndexView
|
||||
from .tag import TagListView, TagView
|
||||
|
||||
__all__ = [
|
||||
AreaView, AreaListView,
|
||||
|
@ -13,5 +14,6 @@ __all__ = [
|
|||
ItemView, ItemListView,
|
||||
ManufacturerView, ManufacturerListView,
|
||||
WorkshopView, WorkshopListView,
|
||||
IndexView
|
||||
IndexView,
|
||||
TagView, TagListView
|
||||
]
|
14
inventory/views/tag.py
Normal file
14
inventory/views/tag.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from django.views import View
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.views.generic import ListView, DetailView
|
||||
|
||||
from inventory.models import Tag
|
||||
|
||||
|
||||
class TagView(View):
|
||||
pass
|
||||
|
||||
@method_decorator(login_required, name='dispatch')
|
||||
class TagListView(ListView):
|
||||
model = Tag
|
Loading…
Reference in a new issue