Commit 2a3dfe3a authored by Michal Čihař's avatar Michal Čihař

Merge remote-tracking branch 'origin/master'

parents 06b31c23 2988c81d
...@@ -25,6 +25,7 @@ Relased on ? 2012. ...@@ -25,6 +25,7 @@ Relased on ? 2012.
* Documentation improvements. * Documentation improvements.
* Support for locking translation by translator. * Support for locking translation by translator.
* Optionally maintain Language-Team header in po file. * Optionally maintain Language-Team header in po file.
* Include some statistics in about page.
weblate 1.1 weblate 1.1
----------- -----------
......
...@@ -20,7 +20,7 @@ Whoosh ...@@ -20,7 +20,7 @@ Whoosh
http://bitbucket.org/mchaput/whoosh/ http://bitbucket.org/mchaput/whoosh/
PyCairo PyCairo
http://cairographics.org/pycairo/ http://cairographics.org/pycairo/
Django-south south
http://south.aeracode.org/ http://south.aeracode.org/
Installation Installation
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
<p>{% blocktrans %}Weblate is web based translation tool with tight Git integration. It features simple and clean user interface, propagation of translations across subprojects, consistency checks or automatic linking to source files.{% endblocktrans %}</p> <p>{% blocktrans %}Weblate is web based translation tool with tight Git integration. It features simple and clean user interface, propagation of translations across subprojects, consistency checks or automatic linking to source files.{% endblocktrans %}</p>
<h2>{% trans "Versions" %}</h2>
<p>{% trans "This site is built using following projects:" %}</p> <p>{% trans "This site is built using following projects:" %}</p>
<table> <table>
...@@ -29,6 +31,39 @@ ...@@ -29,6 +31,39 @@
<th><a href="http://bitbucket.org/mchaput/whoosh/">Whoosh</a></th> <th><a href="http://bitbucket.org/mchaput/whoosh/">Whoosh</a></th>
<td>{{ whoosh_version }}</td> <td>{{ whoosh_version }}</td>
</tr> </tr>
<tr>
<th><a href="http://cairographics.org/pycairo/">PyCairo</a></th>
<td>{{ cairo_version }}</td>
</tr>
<tr>
<th><a href="http://south.aeracode.org/">south</a></th>
<td>{{ south_version }}</td>
</tr>
</table>
<h2>{% trans "Statistics" %}</h2>
<table>
<tr>
<th>{% trans "Strings to translate" %}</th>
<td>{{ total_strings }}</td>
</tr>
<tr>
<th>{% trans "Used languages" %}</th>
<td>{{ total_languages }}</td>
</tr>
<tr>
<th>{% trans "Registered users" %}</th>
<td>{{ total_users }}</td>
</tr>
<tr>
<th>{% trans "Suggestions made" %}</th>
<td>{{ total_suggestions }}</td>
</tr>
<tr>
<th>{% trans "Translations made" %}</th>
<td>{{ total_translations }}</td>
</tr>
</table> </table>
{% endblock %} {% endblock %}
......
...@@ -281,7 +281,7 @@ msgstr "" ...@@ -281,7 +281,7 @@ msgstr ""
#: html/about.html:9 #: html/about.html:9
msgid "This site is built using following projects:" msgid "This site is built using following projects:"
msgstr "Tyto stránky jsou postaveny na následujících projektech:" msgstr "Tyto stránky jsou vybudovány za použití na následujících projektů:"
#: html/base.html:44 #: html/base.html:44
#, python-format #, python-format
......
...@@ -8,7 +8,7 @@ from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound ...@@ -8,7 +8,7 @@ from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
from django.contrib.auth.models import AnonymousUser from django.contrib.auth.models import AnonymousUser
from django.db.models import Q, Count from django.db.models import Q, Count, Sum
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
...@@ -1149,12 +1149,28 @@ def about(request): ...@@ -1149,12 +1149,28 @@ def about(request):
import whoosh import whoosh
import django import django
import git import git
import cairo
import south
totals = Profile.objects.aggregate(Sum('translated'), Sum('suggested'))
total_strings = 0
for p in SubProject.objects.iterator():
try:
total_strings += p.translation_set.all()[0].total
except Translation.DoesNotExist:
pass
return render_to_response('about.html', RequestContext(request, { return render_to_response('about.html', RequestContext(request, {
'title': _('About Weblate'), 'title': _('About Weblate'),
'tt_version': translate.__version__.sver, 'tt_version': translate.__version__.sver,
'whoosh_version': whoosh.versionstring(), 'whoosh_version': whoosh.versionstring(),
'django_version': django.get_version(), 'django_version': django.get_version(),
'git_version': git.__version__, 'git_version': git.__version__,
'cairo_version': cairo.version,
'south_version': south.__version__,
'total_translations': totals['translated__sum'],
'total_suggestions': totals['suggested__sum'],
'total_users': Profile.objects.count(),
'total_strings': total_strings,
'total_languages': Language.objects.filter(translation__total__gt = 0).distinct().count(),
})) }))
@user_passes_test(lambda u: u.has_perm('trans.commit_translation') or u.has_perm('trans.update_translation')) @user_passes_test(lambda u: u.has_perm('trans.commit_translation') or u.has_perm('trans.update_translation'))
......
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