mirror of
https://github.com/Labelbase/Labelbase.git
synced 2026-08-18 13:09:04 +02:00
.
This commit is contained in:
parent
e8228df402
commit
b613a56647
2 changed files with 9 additions and 2 deletions
|
|
@ -8,6 +8,7 @@ from two_factor.views import OTPRequiredMixin
|
|||
from two_factor.views.utils import class_view_decorator
|
||||
|
||||
from labelbase.models import Label, Labelbase
|
||||
from labelbase.froms import LabelForm
|
||||
|
||||
class HomeView(TemplateView):
|
||||
template_name = 'home.html'
|
||||
|
|
@ -16,17 +17,23 @@ class HomeView(TemplateView):
|
|||
class LabelbaseView(ListView):
|
||||
template_name = 'labelbase.html'
|
||||
context_object_name = 'label_list'
|
||||
def get_queryset(self):
|
||||
def get_queryset(self):
|
||||
qs = Label.objects.filter(labelbase__user_id=self.request.user.id, labelbase_id=self.kwargs['labelbase_id'])
|
||||
return qs.order_by("-id")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(LabelbaseView, self).get_context_data(**kwargs)
|
||||
context['labelbase'] = Labelbase.objects.filter(id=self.kwargs['labelbase_id'], user_id=self.request.user.id).first()
|
||||
context['labelform'] = LabelForm()
|
||||
return context
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class RegistrationView(FormView):
|
||||
template_name = 'registration.html'
|
||||
form_class = UserCreationForm
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Modal body text goes here.</p>
|
||||
{{ labelform.as_p }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue