Commit e71f9c67 authored by Claude Paroz's avatar Claude Paroz Committed by Claude Paroz

Updated. Remove obsolete variables. Don't select POT files in

2008-11-10  Claude Paroz  <claude@2xlibre.net>

	* TODO: Updated.
	* stats/conf/settings_sample.py: Remove obsolete variables.
	* stats/models.py: Don't select POT files in get_global_stats.
	* stats/views.py: webroot now unused.
	* templates/stats_show.html: Hard-coded link replaced by url tag.
	* templates/teams/team_base.html: New factorized team basic display.
	* templates/languages/language_release.html:
	* templates/teams/team_detail.html: Use team_base.html.
	* urls.py: Added ending slash.

svn path=/trunk/; revision=1158
parent c1b01189
2008-11-10 Claude Paroz <claude@2xlibre.net>
* TODO: Updated.
* stats/conf/settings_sample.py: Remove obsolete variables.
* stats/models.py: Don't select POT files in get_global_stats.
* stats/views.py: webroot now unused.
* templates/stats_show.html: Hard-coded link replaced by url tag.
* templates/teams/team_base.html: New factorized team basic display.
* templates/languages/language_release.html:
* templates/teams/team_detail.html: Use team_base.html.
* urls.py: Added ending slash.
2008-11-10 Claude Paroz <claude@2xlibre.net>
* README: Fixed typos.
......
Things left to do:
* Still a webroot in stats_show.html
* team_detail.html and language_release.html should share the team detail part.
* Tests, tests, tests...
......@@ -4,7 +4,6 @@ import os
DATABASE_ENGINE = getattr(settings, "DATABASE_ENGINE")
DEBUG = getattr(settings, "DEBUG", True)
WHEREAREWE = 'http://l10n.gnome.org/'
WEBROOT = "/stats"
WHOAREWE = 'danilo@gnome.org'
# When in STRINGFREEZE, where to send notifications (gnome-i18n@gnome.org) on any POT changes
......@@ -14,12 +13,3 @@ NOTIFICATIONS_TO = 'gnome-i18n@gnome.org'
SCRATCHDIR = ""
POTDIR = os.path.join(SCRATCHDIR, "POT")
# Used for migration
OLD_DAMNEDLIES = ""
# Uncomment to migrate the old_statistics table from an external MySQL
# database.
# MYSQL_SETTINGS = dict(db='db',
# user='user',
# host='localhost',
# passwd='pwd')
......@@ -615,7 +615,7 @@ class Release(models.Model):
ON br.id = stat.branch_id
LEFT JOIN category
ON category.branch_id = br.id
WHERE category.release_id = %s
WHERE category.release_id = %s AND stat.language_id IS NOT NULL
GROUP BY domain.dtype, stat.language_id
ORDER BY domain.dtype, trans DESC"""
cursor = connection.cursor()
......
......@@ -42,7 +42,6 @@ def module(request, module_name):
mod.translated_name = _(mod.description)
context = {
'pageSection': "module",
'webroot': settings.WEBROOT,
'module': mod,
'prof': utils.Profiler()
}
......@@ -63,7 +62,7 @@ def docimages(request, module_name, potbase, branch_name, langcode):
def releases(request, format='html'):
all_releases = Release.objects.order_by('status', '-name')
if format != 'html':
if format in ('json', 'xml'):
data = serializers.serialize(format, all_releases)
return HttpResponse(data, mimetype=MIME_TYPES[format])
else:
......
......@@ -7,48 +7,18 @@
<div class="mainpage">
{% with language.locale as locale %}
{% if language.team %}
<h1>{% blocktrans with language.team.description as lang %}{{ lang }} Translation Team — {{ locale }}{% endblocktrans %}</h1>
{% with language.team as team %}
{% if team %}
<h1>{% blocktrans with team.get_description as lang %}{{ lang }} Translation Team — {{ locale }}{% endblocktrans %}</h1>
<table><tr><td valign="top" width="50%">
<h2>{% trans "Details" %}</h2>
{% include "teams/team_base.html" %}
{% if language.team.webpage_url %}
<strong>{% blocktrans with language.team.description as lang %}{{ lang }} Translation Team Page:{% endblocktrans %}</strong>
<a href="{{ language.team.webpage_url }}">{{ language.team.webpage_url }}</a><br />
{% endif %}
<br/><strong>{% trans "Bugzilla:" %}</strong>
<ul>
<li><a href="{{ language.bugs_url_enter|safe }}">{% trans "Report Bug in Translation" %}</a></li>
<li><a href="{{ language.bugs_url_show|safe }}">{% trans "Show Existing Bugs" %}</a></li>
</ul>
{% if language.team.mailing_list %}
<br/><strong>{% trans "Mailing List:" %}</strong>
<ul>
<li><a href="mailto:{{ language.team.mailing_list }}">{% trans "Send e-mail to the list" %}</a></li>
{% if language.team.mailing_list_subscribe %}
<li><a href="{{ language.team.mailing_list_subscribe }}">{% trans "Subscribe" %}</a></li>
{% endif %}
</ul>
{% endif %}
</td><td valign="top">
{% if language.team.coordinator %}
<h2>{% trans "Coordinator" %}</h2>
{% with language.team.coordinator as person %}
{% with 0 as printroles %}
{% include "person_base.html" %}
{% endwith %}
{% endwith %}
{% endif %}
</td></tr></table>
{% else %}
<h1>{% blocktrans %}Language code: {{ locale }}{% endblocktrans %}</h1>
<p>{% blocktrans %}There is no translation team in charge of '{{ locale }}' translation.{% endblocktrans %}</p>
{% endif %}
{% endwith %}
{% endwith %}
<h2>{% trans release.description %}</h2>
......
......@@ -40,7 +40,7 @@
</td>
<td>{{ line.get_translationstat|safe }}</td>
{% if stat1.fig_count %}
<td><a href="{{ webroot }}module/{{ module.name }}/{{ stat1.domain.name }}/{{ branch.name }}/{{ line.language.locale}}/images">
<td><a href="{% url stats.views.docimages module_name=module.name,potbase=stat1.domain.name,branch_name=branch.name,langcode=line.language.locale %}">
<img src="/media/img/figure.png" alt="{% trans "Display document figures" %}"></a></td>
{% endif %}
<td style="width: 108px; text-align: center;"><div class="graph">
......
{# Variables 'team' and 'language' must be defined prior to calling this template #}
{% load i18n %}
{% with team.get_description as lang %}
<table><tr><td valign="top" width="50%">
<h2>{% trans "Details" %}</h2>
{% if team.webpage_url %}
<strong>{% blocktrans %}{{ lang }} Translation Team Page:{% endblocktrans %}</strong>
<a href="{{ team.webpage_url }}">{{ team.webpage_url }}</a><br />
{% endif %}
<br/><strong>{% trans "Bugzilla:" %}</strong>
<ul>
<li><a href="{{ language.bugs_url_enter|safe }}">{% trans "Report Bug in Translation" %}</a></li>
<li><a href="{{ language.bugs_url_show|safe }}">{% trans "Show Existing Bugs" %}</a></li>
</ul>
{% if team.mailing_list %}
<br/><strong>{% trans "Mailing List:" %}</strong>
<ul>
<li><a href="mailto:{{ team.mailing_list }}">{% trans "Send e-mail to the list" %}</a></li>
{% if team.mailing_list_subscribe %}
<li><a href="{{ team.mailing_list_subscribe }}">{% trans "Subscribe" %}</a></li>
{% endif %}
</ul>
{% endif %}
</td><td valign="top">
{% if team.coordinator %}
<h2>{% trans "Coordinator" %}</h2>
{% with team.coordinator as person %}
{% with 0 as printroles %}
{% include "person_base.html" %}
{% endwith %}
{% endwith %}
{% endif %}
</td></tr></table>
{% endwith %}
......@@ -6,50 +6,15 @@
{% block content %}
<div class="mainpage">
{% with team.get_description as lang %}
{% if not team.fake %}
<h1>{% blocktrans %}{{ lang }} Translation Team{% endblocktrans %}</h1>
<h1>{% blocktrans with team.get_description as lang %}{{ lang }} Translation Team{% endblocktrans %}</h1>
<table><tr><td valign="top" width="50%">
<h2>{% trans "Details" %}</h2>
{% if team.webpage_url %}
<strong>{% blocktrans %}{{ lang }} Translation Team Page:{% endblocktrans %}</strong>
<a href="{{ team.webpage_url }}">{{ team.webpage_url }}</a><br />
{% endif %}
<br/><strong>{% trans "Bugzilla:" %}</strong>
<ul>
{% with team.get_languages.0 as language %}
<li><a href="{{ language.bugs_url_enter|safe }}">{% trans "Report Bug in Translation" %}</a></li>
<li><a href="{{ language.bugs_url_show|safe }}">{% trans "Show Existing Bugs" %}</a></li>
{% endwith %}
</ul>
{% if team.mailing_list %}
<br/><strong>{% trans "Mailing List:" %}</strong>
<ul>
<li><a href="mailto:{{ team.mailing_list }}">{% trans "Send e-mail to the list" %}</a></li>
{% if team.mailing_list_subscribe %}
<li><a href="{{ team.mailing_list_subscribe }}">{% trans "Subscribe" %}</a></li>
{% endif %}
</ul>
{% endif %}
</td><td valign="top">
{% if team.coordinator %}
<h2>{% trans "Coordinator" %}</h2>
{% with team.coordinator as person %}
{% with 0 as printroles %}
{% include "person_base.html" %}
{% endwith %}
{% endwith %}
{% endif %}
</td></tr></table>
{% with team.get_languages.0 as language %}
{% include "teams/team_base.html" %}
{% endwith %}
{% else %}
<h1>{{ lang }}</h1>
<h1>{{ team.get_description }}</h1>
{% endif %}
{% endwith %}
{% for lang in team.get_languages %}
<h2>{% trans lang.name %}</h2>
......
......@@ -16,7 +16,7 @@ urlpatterns = patterns('',
urlpatterns += patterns('stats.views',
url(r'^module/$', 'modules', name='modules'),
(r'^module/(?P<module_name>[\w\-\+]+)$', 'module'),
(r'^module/(?P<module_name>[\w\-\+]+)/$', 'module'),
(r'^module/(?P<module_name>[\w\-\+]+)/(?P<potbase>\w+)/(?P<branch_name>[\w-]+)/(?P<langcode>\w+)/images/$', 'docimages'),
url(r'^releases/(?P<format>(html|json|xml))?/?$', 'releases', name='releases'),
(r'^releases/(?P<release_name>[\w-]+)$', 'release'),
......
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