Commit 57f513db authored by Michal Čihař's avatar Michal Čihař

Better formatting of dictionary

parent 6325901c
{% extends "base.html" %}
{% load i18n %}
{% load weblate %}
{% load url from future %}
{% block breadcums %}
......@@ -8,10 +9,20 @@
{% endblock %}
{% block content %}
<ul>
<table class="sort simple">
<thead>
<tr>
<th>{% trans "Language" %}</th>
<th>{% trans "Words" %}</th>
</tr>
<tbody>
{% for dict in dicts %}
<li><a href="{% url 'trans.views.show_dictionary' project=project.slug lang=dict.code %}">{{ dict }}</a></li>
<tr>
<th><a href="{% url 'trans.views.show_dictionary' project=project.slug lang=dict.code %}">{{ dict }}</a></th>
<td class="number">{% dictionary_count dict project %}</td>
</tr>
{% endfor %}
</ul>
</tbody>
</table>
{% endblock %}
......@@ -9,7 +9,7 @@ import re
from trans.util import split_plural
from lang.models import Language
from trans.models import Project, SubProject
from trans.models import Project, SubProject, Dictionary
import trans.checks
register = template.Library()
......@@ -74,3 +74,7 @@ def subproject_name(prj, subprj):
@register.simple_tag
def language_name(code):
return Language.objects.get(code = code).__unicode__()
@register.simple_tag
def dictionary_count(lang, project):
return Dictionary.objects.filter(project = project, language = lang).count()
Markdown is supported
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