Commit 02ff4694 authored by Luko van der Maas's avatar Luko van der Maas
Browse files

fixed model and simplified flag

parent 39e877e9
# Generated by Django 2.1.3 on 2018-12-19 17:52
# Generated by Django 2.1.4 on 2018-12-19 20:04
from django.db import migrations, models
......@@ -18,6 +18,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='summary',
name='language',
field=models.CharField(choices=[('en', 'English'), ('nl', 'Dutch')], default='en', max_length=2),
field=models.CharField(choices=[('en', 'English'), ('nl', 'Dutch')], max_length=2, null=True),
),
]
......@@ -216,7 +216,7 @@ class Summary(models.Model, metaclass=ModelTranslateMeta):
max_length=2,
choices=settings.LANGUAGES,
blank=False,
default=settings.LANGUAGE_CODE,
null=True
)
download_count = models.IntegerField(
......
......@@ -63,9 +63,7 @@
<a href="{% url 'education:exam' item.id %}"
target="_blank">
{{ item.name }}
{% if item.language == 'en' %}
<img class="lang-flag" src="{% static 'img/flags/gb.svg' %}"/>
{% elif item.language != '' %}
{% if item.language != '' %}
<img class="lang-flag" src="{% static 'img/flags/'|add:item.language|add:'.svg' %}"/>
{% endif %}
</a>
......@@ -82,9 +80,7 @@
<a href="{% url 'education:summary' item.id %}"
target="_blank">
{{ item.name }}
{% if item.language == 'en' %}
<img class="lang-flag" src="{% static 'img/flags/gb.svg' %}"/>
{% elif item.language != '' %}
{% if item.language != '' %}
<img class="lang-flag" src="{% static 'img/flags/'|add:item.language|add:'.svg' %}"/>
{% endif %}
</a>
......
......@@ -79,7 +79,7 @@
<a href="#lang" data-next="{{ redirect_to }}" data-lang="en"
data-href="{% url 'set_language' %}"
class="btn btn-link" id="language-switcher"><img
src="{% static 'img/flags/gb.svg' %}"/></a>
src="{% static 'img/flags/en.svg' %}"/></a>
{% else %}
<a href="#lang" data-next="{{ redirect_to }}" data-lang="nl"
data-href="{% url 'set_language' %}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment