Tobacco is in stock by default, make voting lockable
This commit is contained in:
parent
c7a661da05
commit
ba56e79887
@ -43,8 +43,8 @@ class EventDateInline(admin.StackedInline):
|
|||||||
|
|
||||||
@admin.register(ClubhausEvent)
|
@admin.register(ClubhausEvent)
|
||||||
class ClubhausEventAdmin(admin.ModelAdmin):
|
class ClubhausEventAdmin(admin.ModelAdmin):
|
||||||
list_display = ("id", "name", "date", "active")
|
list_display = ("id", "name", "date", "active", "voting_locked")
|
||||||
list_editable = ('active',)
|
list_editable = ('active', "voting_locked")
|
||||||
ordering = ("date",)
|
ordering = ("date",)
|
||||||
inlines = [
|
inlines = [
|
||||||
EventDateInline
|
EventDateInline
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 4.0.7 on 2022-08-17 15:04
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('homepage', '0018_eventdatevotes_available'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='clubhausevent',
|
||||||
|
name='voting_locked',
|
||||||
|
field=models.BooleanField(default=False),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='tobacco',
|
||||||
|
name='in_stock',
|
||||||
|
field=models.BooleanField(default=True),
|
||||||
|
),
|
||||||
|
]
|
@ -15,7 +15,7 @@ class Tobacco(models.Model):
|
|||||||
name = models.CharField(max_length=200, unique=True, blank=False, null=False)
|
name = models.CharField(max_length=200, unique=True, blank=False, null=False)
|
||||||
description = models.TextField(blank=True, null=False)
|
description = models.TextField(blank=True, null=False)
|
||||||
category = models.ForeignKey("TobaccoCategory", on_delete=models.CASCADE, blank=False, null=False)
|
category = models.ForeignKey("TobaccoCategory", on_delete=models.CASCADE, blank=False, null=False)
|
||||||
in_stock = models.BooleanField()
|
in_stock = models.BooleanField(default=True)
|
||||||
picture = models.ImageField(upload_to="tobacco_images/", null=False, blank=True)
|
picture = models.ImageField(upload_to="tobacco_images/", null=False, blank=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
@ -34,6 +34,7 @@ class ClubhausEvent(models.Model):
|
|||||||
name = models.CharField(max_length=200, blank=True)
|
name = models.CharField(max_length=200, blank=True)
|
||||||
date = models.DateTimeField(blank=True, null=True)
|
date = models.DateTimeField(blank=True, null=True)
|
||||||
active = models.BooleanField(default=False)
|
active = models.BooleanField(default=False)
|
||||||
|
voting_locked = models.BooleanField(default=False)
|
||||||
location = models.TextField(blank=True)
|
location = models.TextField(blank=True)
|
||||||
beverages = models.TextField(blank=True)
|
beverages = models.TextField(blank=True)
|
||||||
food = models.TextField(blank=True)
|
food = models.TextField(blank=True)
|
||||||
|
@ -131,10 +131,13 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<h1>Es hat noch keiner abgestimmt!</h1>
|
<h1>Es hat noch keiner abgestimmt!</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button type="button" class="btn btn-primary mt-3 mt-md-1 float-end" data-bs-toggle="modal"
|
{% if not next_event.voting_locked %}
|
||||||
|
<button type="button" class="btn btn-primary mt-3 mt-md-1 float-end"
|
||||||
|
data-bs-toggle="modal"
|
||||||
data-bs-target="#votingModal">
|
data-bs-target="#votingModal">
|
||||||
Jetzt abstimmen
|
Jetzt abstimmen
|
||||||
</button>
|
</button>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user