damned-lies r1330 - in trunk: . languages people stats stats/tests templates/languages templates/people templates/vertimus
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1330 - in trunk: . languages people stats stats/tests templates/languages templates/people templates/vertimus
- Date: Sat, 10 Jan 2009 14:38:01 +0000 (UTC)
Author: claudep
Date: Sat Jan 10 14:38:01 2009
New Revision: 1330
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1330&view=rev
Log:
2009-01-10 Claude Paroz <claude 2xlibre net>
* languages/urls.py: 'team_slug' is already used in teams/urls.py
* languages/views.py:
* people/views.py: Add dateformat to context.
* stats/tests/__init__.py: Added test for po_url
* stats/models.py:
* templates/languages/language_release_stats.html:
* templates/people/person_detail.html:
* templates/vertimus/vertimus_detail.html: Harmonize date formats.
Fixes bug #567080.
Modified:
trunk/ChangeLog
trunk/languages/urls.py
trunk/languages/views.py
trunk/people/views.py
trunk/stats/models.py
trunk/stats/tests/__init__.py
trunk/templates/languages/language_release_stats.html
trunk/templates/people/person_detail.html
trunk/templates/vertimus/vertimus_detail.html
Modified: trunk/languages/urls.py
==============================================================================
--- trunk/languages/urls.py (original)
+++ trunk/languages/urls.py Sat Jan 10 14:38:01 2009
@@ -5,5 +5,5 @@
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'),
- url(r'^(?P<team_slug>[\w\- ]+)/$', 'teams.views.team', name='team_slug'),
+ (r'^(?P<team_slug>[\w\- ]+)/$', 'teams.views.team'),
)
Modified: trunk/languages/views.py
==============================================================================
--- trunk/languages/views.py (original)
+++ trunk/languages/views.py Sat Jan 10 14:38:01 2009
@@ -23,7 +23,7 @@
import tarfile
from datetime import date, datetime
from django.shortcuts import render_to_response, get_object_or_404
-from django.utils.translation import ugettext as _
+from django.utils.translation import ugettext as _, get_date_formats
from django.template import RequestContext
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
@@ -51,6 +51,7 @@
'stats_title': {'ui': _("UI Translations"),
'doc': _("Documentation")}.get(dtype),
'stats': stats,
+ 'dateformat': get_date_formats()[0],
}
return render_to_response('languages/language_release.html', context,
context_instance=RequestContext(request))
Modified: trunk/people/views.py
==============================================================================
--- trunk/people/views.py (original)
+++ trunk/people/views.py Sat Jan 10 14:38:01 2009
@@ -19,7 +19,7 @@
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from django.shortcuts import render_to_response, get_object_or_404
-from django.utils.translation import ugettext as _
+from django.utils.translation import ugettext as _, get_date_formats
from django.template import RequestContext
from django.db import transaction, IntegrityError
from django.contrib.auth.decorators import login_required
@@ -40,6 +40,7 @@
'pageSection': "teams",
'person': person,
'states': states,
+ 'dateformat': get_date_formats()[0],
}
return render_to_response('people/person_detail.html', context,
context_instance=RequestContext(request))
Modified: trunk/stats/models.py
==============================================================================
--- trunk/stats/models.py (original)
+++ trunk/stats/models.py Sat Jan 10 14:38:01 2009
@@ -25,6 +25,7 @@
from time import tzname
from django.db import models, connection
from django.utils.translation import ungettext, ugettext as _, ugettext_noop
+from django.utils import dateformat
from django.conf import settings
from stats import utils
import potdiff
@@ -933,7 +934,8 @@
def pot_text(self):
""" Return stat table header: 'POT file (n messages) - updated on ??-??-???? tz' """
msg_text = ungettext(u"%(count)s message", "%(count)s messages", self.pot_size()) % {'count': self.pot_size()}
- upd_text = _(u"updated on %(date)s") % {'date': self.date.strftime("%Y-%m-%d %H:%M:%S ")+tzname[0]}
+ # Date format syntax is similar to PHP http://www.php.net/date
+ upd_text = _(u"updated on %(date)s") % {'date': dateformat.format(self.date, _("Y-m-d g:i a O"))}
if self.fig_count():
fig_text = ungettext(u"%(count)s figure", "%(count)s figures", self.fig_count()) % {'count': self.fig_count()}
text = _(u"POT file (%(messages)s, %(figures)s) â %(updated)s") % \
Modified: trunk/stats/tests/__init__.py
==============================================================================
--- trunk/stats/tests/__init__.py (original)
+++ trunk/stats/tests/__init__.py Sat Jan 10 14:38:01 2009
@@ -95,6 +95,7 @@
stat = Statistics.objects.get(branch=branch, domain__name='help', language__locale='fr')
warn_infos = Information.objects.filter(statistics=stat, type='warn')
self.assertEquals(len(warn_infos), 1);
+ self.assertEquals(stat.po_url(), "/POT/gnome-hello.HEAD/gnome-hello.HEAD.fr.po");
# Delete the branch (removing the repo checkout in the file system)
checkout_path = branch.co_path()
Modified: trunk/templates/languages/language_release_stats.html
==============================================================================
--- trunk/templates/languages/language_release_stats.html (original)
+++ trunk/templates/languages/language_release_stats.html Sat Jan 10 14:38:01 2009
@@ -64,7 +64,7 @@
<td>
{% if dom.1.state.name %}
{% ifnotequal dom.1.state.name "None" %}
- <em><small>{{ dom.1.state.get_state }} - {{ dom.1.state.updated|date:"Y-m-d" }}</small></em>
+ <em><small>{{ dom.1.state.get_state }} - {{ dom.1.state.updated|date:dateformat }}</small></em>
{% endifnotequal %}
{% endif %}
</td>
Modified: trunk/templates/people/person_detail.html
==============================================================================
--- trunk/templates/people/person_detail.html (original)
+++ trunk/templates/people/person_detail.html Sat Jan 10 14:38:01 2009
@@ -25,7 +25,7 @@
</tr>
{% for state in states %}
<tr>
- <td>{{ state.updated|naturalday }}</td>
+ <td>{{ state.updated|naturalday:dateformat }}</td>
<td><a href="{{ state.get_absolute_url }}">{{ state.branch.module.get_description }} - {{ state.branch.name }} - {% trans state.domain.description %} - {{ state.language.get_name }}</a></td>
<td>{{ state.get_state }}</td>
</tr>
Modified: trunk/templates/vertimus/vertimus_detail.html
==============================================================================
--- trunk/templates/vertimus/vertimus_detail.html (original)
+++ trunk/templates/vertimus/vertimus_detail.html Sat Jan 10 14:38:01 2009
@@ -30,7 +30,7 @@
<h3>{% trans "State:" %} {{ state.description }}
{% ifnotequal state.name 'none' %}
-({{ state.updated|date:"D d M Y P" }})
+({{ state.updated|date:_("Y-m-d g:i a O") }})
{% endifnotequal %}
</h3>
@@ -74,7 +74,7 @@
<div class="vertimus_action">
<div class="vertimus_action_head">
<img src="{{ MEDIA_URL }}img/nobody-16.png" alt="Person"/> <a href="{{ action.person.get_absolute_url }}">{{ action.person.name }}</a>
- , <strong>{{ action }}</strong>, {{ action.created|date:"Y-m-d H:i" }}
+ , <strong>{{ action }}</strong>, {{ action.created|date:_("Y-m-d g:i a O") }}
</div>
<div class="vertimus_action_content">
{% if action.file %}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]