damned-lies r1404 - in trunk: . languages templates/languages
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1404 - in trunk: . languages templates/languages
- Date: Tue, 27 Jan 2009 21:38:26 +0000 (UTC)
Author: claudep
Date: Tue Jan 27 21:38:26 2009
New Revision: 1404
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1404&view=rev
Log:
2009-01-27 Claude Paroz <claude 2xlibre net>
* templates/languages/language_all_modules.html:
* languages/urls.py:
* languages/views.py: Add a new URL/view/template to show stats for all
modules. Still need a link, probably from team page.
WIP for bug #415315.
Added:
trunk/templates/languages/language_all_modules.html
Modified:
trunk/ChangeLog
trunk/languages/urls.py
trunk/languages/views.py
Modified: trunk/languages/urls.py
==============================================================================
--- trunk/languages/urls.py (original)
+++ trunk/languages/urls.py Tue Jan 27 21:38:26 2009
@@ -2,6 +2,7 @@
urlpatterns = patterns('',
url(r'^$', 'languages.views.languages', name='languages'),
+ url(r'^(?P<locale>[\w\- ]+)/all/(?P<dtype>(ui|doc)+)/$', 'languages.views.language_all', name='language_all'),
url(r'^(?P<locale>[\w\- ]+)/(?P<release_name>[\w-]+)/(?P<dtype>(ui|doc)+)/$', 'languages.views.language_release', name='language_release'),
(r'^(?P<locale>[\w\- ]+)/(?P<release_name>[\w-]+).xml$', 'languages.views.language_release_xml'),
(r'^(?P<locale>[\w\- ]+)/(?P<release_name>[\w-]+)/(?P<dtype>(ui|doc)+).tar.gz$', 'languages.views.language_release_tar'),
Modified: trunk/languages/views.py
==============================================================================
--- trunk/languages/views.py (original)
+++ trunk/languages/views.py Tue Jan 27 21:38:26 2009
@@ -29,7 +29,7 @@
from django.conf import settings
from common import utils
from languages.models import Language
-from stats.models import Release
+from stats.models import Release, Statistics
def languages(request):
languages = Language.objects.select_related("team").all()
@@ -40,6 +40,19 @@
return render_to_response('languages/language_list.html', context,
context_instance=RequestContext(request))
+def language_all(request, locale, dtype):
+ language = get_object_or_404(Language, locale=Language.unslug_locale(locale))
+ stats = Statistics.objects.filter(language=language, domain__dtype=dtype).select_related('branch__module', 'domain')
+ context = {
+ 'pageSection': "languages",
+ 'language': language,
+ 'stats_title': {'ui': _("UI Translations"),
+ 'doc': _("Documentation")}.get(dtype),
+ 'stats': stats,
+ }
+ return render_to_response('languages/language_all_modules.html', context,
+ context_instance=RequestContext(request))
+
def language_release(request, locale, release_name, dtype):
language = get_object_or_404(Language, locale=Language.unslug_locale(locale))
release = get_object_or_404(Release, name=release_name)
Added: trunk/templates/languages/language_all_modules.html
==============================================================================
--- (empty file)
+++ trunk/templates/languages/language_all_modules.html Tue Jan 27 21:38:26 2009
@@ -0,0 +1,66 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %} {% trans "All modules" %} - {{ language.get_name }}{% endblock %}
+
+{% block extrahead %}
+<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.min.js"></script>
+<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function()
+ {
+ $("#stats-table").tablesorter({sortList: [[0,0]]});
+ }
+);
+</script>
+{% endblock %}
+
+{% block content %}
+<div class="mainpage">
+
+<h2>{% trans "All modules" %} - <a href="{{ language.get_team_url }}">{{ language.get_name }}</a></h2>
+
+<p id="hide">
+ <a href="#" onclick="return showHideCompleted();">{% trans "Hide completed modules" %}</a>
+</p>
+
+<p id="show" style="display:none">
+ <a href="#" onclick="return showHideCompleted();">{% trans "Show completed modules" %}</a>
+</p>
+
+<h3>{{ stats_title }}</h3>
+<table class="tablesorter" name="stats-table" id="stats-table">
+<thead>
+ <tr><th>{% trans "Module" %}</th><th>{% trans "Branch" %}</th><th>{% trans "Statistics" %}</th></tr>
+</thead>
+<tbody>
+{% for stat in stats %}
+ {% with stat.branch.module.name as modname %}
+ {% ifequal stat.tr_percentage 100 %}
+ <tr id="{{ modname }}-{{ stat.domain.id }}-complete">
+ {% else %}
+ <tr>
+ {% endifequal %}
+ <td><a href="{% url vertimus-names-view modname stat.branch.name stat.domain.name language.locale %}">{{ stat.branch.module.name }}</a></td>
+ <td>{{ stat.branch.name }}
+ {% ifnotequal stat.domain.name "po" %}
+ ({{ stat.domain.name }})
+ {% endifnotequal %}
+ </td>
+ <td><span style="display:none;">{{ stat.tr_percentage }}</span>
+ {{ stat.tr_percentage }}% ({{ stat.translated }}/{{ stat.fuzzy }}/{{ stat.untranslated }})</td>
+ <td style="width: 108px; text-align: center;">
+ <div class="graph">
+ <div class="translated" style="width: {{ stat.tr_percentage }}px;"></div>
+ <div class="fuzzy" style="{{ LANGUAGE_BIDI|yesno:"right,left" }}:{{ stat.tr_percentage }}px; width:{{ stat.fu_percentage }}px;"></div>
+ <div class="untranslated" style="{{ LANGUAGE_BIDI|yesno:"right,left" }}:{{ stat.tr_percentage|add:stat.fu_percentage }}px; width: {{ stat.un_percentage }}px;"></div>
+ </div>
+ </td>
+ </tr>
+ {% endwith %}
+{% endfor %}
+</tbody>
+</table>
+
+</div>
+{% endblock %}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]