diff --git a/items/migrations/0001_initial.py b/items/migrations/0001_initial.py index 36c0891..12132be 100644 --- a/items/migrations/0001_initial.py +++ b/items/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.0.6 on 2020-10-06 13:45 +# Generated by Django 3.2.4 on 2024-07-27 17:32 import django.db.models.deletion import django.utils.timezone @@ -25,6 +25,7 @@ class Migration(migrations.Migration): ), ), ("name", models.CharField(max_length=140)), + ("name_dk", models.CharField(blank=True, max_length=140, null=True)), ("description", models.TextField(blank=True)), ("link", models.CharField(blank=True, max_length=255)), ], @@ -77,27 +78,19 @@ class Migration(migrations.Migration): ), ), ("name", models.CharField(max_length=140)), + ("name_dk", models.CharField(blank=True, max_length=140, null=True)), ("description", models.TextField(blank=True)), ("country", models.CharField(blank=True, max_length=140)), - ("priceInDKK", models.DecimalField(decimal_places=2, max_digits=11)), + ("priceInDKK", models.DecimalField(decimal_places=0, max_digits=11)), ("abv", models.FloatField(blank=True, null=True)), + ("container", models.CharField(blank=True, max_length=140, null=True)), ( - "container", - models.CharField( - blank=True, - choices=[ - ("DRAFT", "Fad"), - ("BOTTLE", "Flaske"), - ("SHOT", "Shot"), - ("FOOD", "Madvare"), - ("OTHER", "Andet"), - ], - max_length=140, - ), + "container_dk", + models.CharField(blank=True, max_length=140, null=True), ), ("volumeInCentiliters", models.IntegerField(blank=True, null=True)), ("inStock", models.BooleanField(default=True)), - ("imageUrl", models.CharField(blank=True, max_length=255)), + ("image", models.ImageField(blank=True, null=True, upload_to="items")), ( "barcode", models.CharField( @@ -113,7 +106,7 @@ class Migration(migrations.Migration): blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, - to="items.Brewery", + to="items.brewery", ), ), ( @@ -122,7 +115,7 @@ class Migration(migrations.Migration): blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, - to="items.BeerType", + to="items.beertype", ), ), ], @@ -148,7 +141,7 @@ class Migration(migrations.Migration): models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="entries", - to="items.Item", + to="items.item", ), ), ( @@ -156,7 +149,7 @@ class Migration(migrations.Migration): models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="entries", - to="items.InventorySnapshot", + to="items.inventorysnapshot", ), ), ], diff --git a/items/migrations/0002_auto_20240727_0123.py b/items/migrations/0002_auto_20240727_0123.py deleted file mode 100644 index ec07b93..0000000 --- a/items/migrations/0002_auto_20240727_0123.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generated by Django 3.2.4 on 2024-07-26 23:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("items", "0001_initial"), - ] - - operations = [ - migrations.RemoveField( - model_name="item", - name="imageUrl", - ), - migrations.AddField( - model_name="beertype", - name="name_dk", - field=models.CharField(blank=True, max_length=140, null=True), - ), - migrations.AddField( - model_name="item", - name="container_dk", - field=models.CharField(blank=True, max_length=140), - ), - migrations.AddField( - model_name="item", - name="image", - field=models.ImageField(blank=True, null=True, upload_to="items"), - ), - migrations.AddField( - model_name="item", - name="name_dk", - field=models.CharField(blank=True, max_length=140, null=True), - ), - migrations.AlterField( - model_name="item", - name="container", - field=models.CharField(blank=True, max_length=140), - ), - ] diff --git a/items/models.py b/items/models.py index 7bed370..b0567d5 100644 --- a/items/models.py +++ b/items/models.py @@ -14,10 +14,10 @@ class Item(models.Model): name_dk = models.CharField(max_length=140, null=True, blank=True) description = models.TextField(blank=True) country = models.CharField(blank=True, max_length=140) - priceInDKK = models.DecimalField(max_digits=9 + 2, decimal_places=2) + priceInDKK = models.DecimalField(max_digits=9 + 2, decimal_places=0) abv = models.FloatField(null=True, blank=True) - container = models.CharField(blank=True, max_length=140) - container_dk = models.CharField(blank=True, max_length=140) + container = models.CharField(null=True, blank=True, max_length=140) + container_dk = models.CharField(null=True, blank=True, max_length=140) volumeInCentiliters = models.IntegerField(null=True, blank=True) inStock = models.BooleanField(default=True) image = models.ImageField(upload_to="items", blank=True, null=True) diff --git a/items/templates/items.html b/items/templates/items.html index 90a71e3..2da1a2d 100644 --- a/items/templates/items.html +++ b/items/templates/items.html @@ -4,10 +4,20 @@ {% load static %} {% load i18n %} + +

+ {% blocktrans %} + Her kan du se Fredagscaféens faste sortiment, og mange af de ting vi er kendte for at sælge. + Men derudover finder du altid et stort sortiment af spændende og nye specialøl, for enhver smag, i baren. + Vi har i Fredagscaféen et stort fokus på at have noget for alle, så derfor finder du også flere + glutenfrie og alkoholfrie øl. + {% endblocktrans %} +

+

- {% translate "Standardsortiment" %} + {% translate "Fast sortiment" %} {% if items_data %}
({{ items_data | length }}) @@ -50,9 +60,9 @@

{% get_current_language as LANGUAGE_CODE %} {% for item in items_data %} - {% if item.brewery_url %}{% endif %}{{ item.brewery|default_if_none:"" }}{% if item.brewery_url %}{% endif %} + {% if item.brewery_url %}{% endif %}{{ item.brewery|default_if_none:"" }}{% if item.brewery_url %} {% endif %} {% if LANGUAGE_CODE == 'da' %}{{ item.name_dk|default_if_none:item.name }}{% else %}{{ item.name|default_if_none:"" }}{% endif %} - {{ item.type|default_if_none:"" }} + {% if LANGUAGE_CODE == 'da' %}{{ item.type.name_dk|default_if_none:item.type.name }}{% else %}{{ item.type|default_if_none:"" }}{% endif %} {% if LANGUAGE_CODE == 'da' %}{{ item.container_dk|default_if_none:item.container }}{% else %}{{ item.container|default_if_none:"" }}{% endif %} {{ item.price|floatformat:-2 }},- {% if item.inStock %}{% translate "På lager" %}{% else %}{% translate "Ikke på lager" %}{% endif %} diff --git a/locale/da/LC_MESSAGES/django.po b/locale/da/LC_MESSAGES/django.po index 15ccc27..de2ae27 100644 --- a/locale/da/LC_MESSAGES/django.po +++ b/locale/da/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-27 01:21+0200\n" +"POT-Creation-Date: 2024-07-27 19:16+0200\n" "PO-Revision-Date: 2024-07-27 00:47+0050\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -88,7 +88,7 @@ msgid "Result" msgstr "Resultat" #: bartab/templates/bartab/consumption.html:15 events/templates/events.html:69 -#: items/templates/items.html:38 +#: items/templates/items.html:48 msgid "Navn" msgstr "" @@ -170,7 +170,7 @@ msgid "Bartender's first shift" msgstr "Bartenderens første vagt" #: bartenders/templates/barplan.html:38 bartenders/templates/barplan.html:78 -#: bartenders/templates/board.html:34 items/templates/items.html:67 +#: bartenders/templates/board.html:34 items/templates/items.html:77 msgid "Edit" msgstr "Rediger" @@ -516,55 +516,68 @@ msgid "" "virkeligheden fuldt ud." msgstr "" -#: items/templates/items.html:10 -msgid "Standardsortiment" +#: items/templates/items.html:9 +msgid "" +"\n" +"\tHer kan du se Fredagscaféens faste sortiment, og mange af de ting vi er " +"kendte for at sælge. \n" +"\tMen derudover finder du altid et stort sortiment af spændende og nye " +"specialøl, for enhver smag, i baren. \n" +"\tVi har i Fredagscaféen et stort fokus på at have noget for alle, så derfor " +"finder du også flere \n" +"\tglutenfrie og alkoholfrie øl.\n" +"\t" +msgstr "" + +#: items/templates/items.html:20 +msgid "Fast sortiment" msgstr "" -#: items/templates/items.html:21 +#: items/templates/items.html:31 msgid "Søg" msgstr "" -#: items/templates/items.html:27 +#: items/templates/items.html:37 msgid "Vis kun ting på lager" msgstr "" -#: items/templates/items.html:29 +#: items/templates/items.html:39 msgid "Vis også ting ikke på lager" msgstr "" -#: items/templates/items.html:37 +#: items/templates/items.html:47 msgid "Bryghus" msgstr "" -#: items/templates/items.html:39 +#: items/templates/items.html:49 msgid "Type" msgstr "" -#: items/templates/items.html:40 +#: items/templates/items.html:50 msgid "Container" msgstr "Beholder" -#: items/templates/items.html:41 +#: items/templates/items.html:51 msgid "Pris" msgstr "" -#: items/templates/items.html:42 +#: items/templates/items.html:52 msgid "Status" msgstr "" -#: items/templates/items.html:43 +#: items/templates/items.html:53 msgid "Image" msgstr "Billede" -#: items/templates/items.html:58 +#: items/templates/items.html:68 msgid "På lager" msgstr "" -#: items/templates/items.html:58 +#: items/templates/items.html:68 msgid "Ikke på lager" msgstr "" -#: items/templates/items.html:78 +#: items/templates/items.html:88 msgid "Sortimentet er desværre tomt" msgstr "" diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index b0d74ba..9ffb910 100644 Binary files a/locale/en/LC_MESSAGES/django.mo and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index acb5059..8291c77 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-27 01:21+0200\n" -"PO-Revision-Date: 2024-07-27 01:21+0050\n" +"POT-Creation-Date: 2024-07-27 19:16+0200\n" +"PO-Revision-Date: 2024-07-27 19:23+0050\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -88,7 +88,7 @@ msgid "Result" msgstr "Result" #: bartab/templates/bartab/consumption.html:15 events/templates/events.html:69 -#: items/templates/items.html:38 +#: items/templates/items.html:48 msgid "Navn" msgstr "Name" @@ -170,7 +170,7 @@ msgid "Bartender's first shift" msgstr "Bartender's first shift" #: bartenders/templates/barplan.html:38 bartenders/templates/barplan.html:78 -#: bartenders/templates/board.html:34 items/templates/items.html:67 +#: bartenders/templates/board.html:34 items/templates/items.html:77 msgid "Edit" msgstr "Edit" @@ -284,7 +284,7 @@ msgid "" "Velkommen til Fredagscaféens webside, her kan du finde information om " "åbningstider, sortiment, udlejning af fadølsanlæg og grill mm." msgstr "" -"Welcome to Fredagscaféens website. Here you can find information about " +"Welcome to Fredagscaféen's website. Here you can find information about " "openning hours, selection, rental of kegerator and grill etc." #: bartenders/templates/index.html:12 @@ -545,58 +545,73 @@ msgstr "" "We try to update them continuously, but understand that they do not always " "fully reflect reality." -#: items/templates/items.html:10 -#| msgid "Standard sortiment" -msgid "Standardsortiment" -msgstr "Standard assortment" - -#: items/templates/items.html:21 +#: items/templates/items.html:9 +msgid "" +"\n" +"\tHer kan du se Fredagscaféens faste sortiment, og mange af de ting vi er kendte for at sælge. \n" +"\tMen derudover finder du altid et stort sortiment af spændende og nye specialøl, for enhver smag, i baren. \n" +"\tVi har i Fredagscaféen et stort fokus på at have noget for alle, så derfor finder du også flere \n" +"\tglutenfrie og alkoholfrie øl.\n" +"\t" +msgstr "" +"\n" +"Here you can see Fredagscaféen's fixed selection and many of the things we are known for selling.\n" +"But in addition, you will always find a large range of exciting and new specialty beers, for every taste, in the bar.\n" +"At Fredagscaféen, we have a big focus on having something for everyone, so you will also find more\n" +"gluten-free and alcohol-free beers." + +#: items/templates/items.html:20 +#| msgid "Sortiment" +msgid "Fast sortiment" +msgstr "Fixed selection" + +#: items/templates/items.html:31 msgid "Søg" msgstr "Search" -#: items/templates/items.html:27 +#: items/templates/items.html:37 msgid "Vis kun ting på lager" msgstr "Only show items in stock" -#: items/templates/items.html:29 +#: items/templates/items.html:39 msgid "Vis også ting ikke på lager" msgstr "Also show items not in stock" -#: items/templates/items.html:37 +#: items/templates/items.html:47 msgid "Bryghus" msgstr "Brewery" -#: items/templates/items.html:39 +#: items/templates/items.html:49 msgid "Type" msgstr "Type" -#: items/templates/items.html:40 +#: items/templates/items.html:50 msgid "Container" msgstr "Container" -#: items/templates/items.html:41 +#: items/templates/items.html:51 msgid "Pris" msgstr "Price" -#: items/templates/items.html:42 +#: items/templates/items.html:52 msgid "Status" msgstr "Status" -#: items/templates/items.html:43 +#: items/templates/items.html:53 msgid "Image" msgstr "Image" -#: items/templates/items.html:58 +#: items/templates/items.html:68 msgid "På lager" msgstr "In stock" -#: items/templates/items.html:58 +#: items/templates/items.html:68 msgid "Ikke på lager" msgstr "Not in stock" -#: items/templates/items.html:78 +#: items/templates/items.html:88 msgid "Sortimentet er desværre tomt" -msgstr "The assortment is unfortunately empty" +msgstr "The selection is unfortunately empty" #: udlejning/models.py:12 msgid "EAN" @@ -1165,7 +1180,7 @@ msgstr "Events" #: web/templates/base.html:93 msgid "Sortiment" -msgstr "Assortment" +msgstr "Selection" #: web/templates/base.html:94 msgid "Om baren" @@ -1204,6 +1219,9 @@ msgid "" "Login mail sendt: Tryk på linket i din modtagede mail for at logge ind." msgstr "Login email sent: Press the link in your received email to log in." +#~ msgid "Standardsortiment" +#~ msgstr "Standard assortment" + #~ msgid "Fad" #~ msgstr "Draft beer" diff --git a/web/templates/base.html b/web/templates/base.html index f5fb058..d8a21b9 100644 --- a/web/templates/base.html +++ b/web/templates/base.html @@ -37,7 +37,7 @@