From 397d0bf62d00a48bed3395fa122b1812907929b0 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Sun, 4 Feb 2018 20:40:41 +0100 Subject: [PATCH] Allow to set the locale on navbar links --- navbar/migrations/0003_auto_20180204_2035.py | 29 ++++++++++++++++++++ navbar/models.py | 1 + navbar/templates/navbar/navbar.html | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 navbar/migrations/0003_auto_20180204_2035.py diff --git a/navbar/migrations/0003_auto_20180204_2035.py b/navbar/migrations/0003_auto_20180204_2035.py new file mode 100644 index 0000000..b50e3c3 --- /dev/null +++ b/navbar/migrations/0003_auto_20180204_2035.py @@ -0,0 +1,29 @@ +# Generated by Django 2.0.1 on 2018-02-04 19:35 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('navbar', '0002_elementseparator'), + ] + + operations = [ + migrations.AddField( + model_name='element', + name='add_locale', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='element', + name='parent', + field=models.ForeignKey(blank=True, limit_choices_to={'parent': None}, null=True, on_delete=django.db.models.deletion.CASCADE, to='navbar.Element'), + ), + migrations.AlterField( + model_name='elementseparator', + name='parent', + field=models.ForeignKey(limit_choices_to={'parent': None}, on_delete=django.db.models.deletion.CASCADE, to='navbar.Element'), + ), + ] diff --git a/navbar/models.py b/navbar/models.py index c0e72ca..6f6f62e 100644 --- a/navbar/models.py +++ b/navbar/models.py @@ -14,6 +14,7 @@ class Element(models.Model): ) link = models.CharField(max_length=512, blank=True) new_window = models.BooleanField(default=False) + add_locale = models.BooleanField(default=False) icon = models.FilePathField( path=os.path.join(settings.BASE_DIR, 'navbar/static/icons'), match=".png", diff --git a/navbar/templates/navbar/navbar.html b/navbar/templates/navbar/navbar.html index eacc119..89c8d26 100644 --- a/navbar/templates/navbar/navbar.html +++ b/navbar/templates/navbar/navbar.html @@ -22,7 +22,7 @@ {% if c.is_separator %}
{% else %} - + {{ c }} {% endif %}