Compare commits

..

No commits in common. "a9e39dcd3d9768d62079761cd39cd91fbd29ffd1" and "9badf494a6ff5fc46bb474ae626d3226b0e092dc" have entirely different histories.

3 changed files with 3 additions and 15 deletions

View File

@ -31,7 +31,7 @@ class Lot(models.Model):
name = models.CharField(max_length=STR_SIZE, blank=True, null=True)
code = models.CharField(max_length=STR_SIZE, blank=True, null=True)
description = models.CharField(max_length=STR_SIZE, blank=True, null=True)
closed = models.BooleanField(default=False)
closed = models.BooleanField(default=True)
owner = models.ForeignKey(Institution, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True)
type = models.ForeignKey(LotTag, on_delete=models.CASCADE)

View File

@ -7,16 +7,6 @@
<h3>{{ subtitle }}</h3>
</div>
<div class="col text-center">
{% if show_closed %}
<a href="?show_closed=false" class="btn btn-green-admin">
{% trans 'Hide closed lots' %}
</a>
{% else %}
<a href="?show_closed=true" class="btn btn-green-admin">
{% trans 'Show closed lots' %}
</a>
{% endif %}
<a href="{% url 'lot:add' %}" type="button" class="btn btn-green-admin">
<i class="bi bi-plus"></i>
{% trans 'Add new lot' %}

View File

@ -131,13 +131,11 @@ class LotsTagsView(DashboardView, TemplateView):
tag = get_object_or_404(LotTag, owner=self.request.user.institution, id=self.pk)
self.title += " {}".format(tag.name)
self.breadcrumb += " {}".format(tag.name)
show_closed = self.request.GET.get('show_closed', 'false') == 'true'
lots = Lot.objects.filter(owner=self.request.user.institution).filter(type=tag, closed=show_closed)
lots = Lot.objects.filter(owner=self.request.user.institution).filter(type=tag)
context.update({
'lots': lots,
'title': self.title,
'breadcrumb': self.breadcrumb,
'show_closed': show_closed
'breadcrumb': self.breadcrumb
})
return context