[damned-lies] Improve statistics display (non right-aligned) on vertimus page (Refs #657460)
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Improve statistics display (non right-aligned) on vertimus page (Refs #657460)
- Date: Thu, 1 Sep 2011 14:11:21 +0000 (UTC)
commit 9ec5d4e5e7255793388893cea900d9254b09e41d
Author: Claude Paroz <claude 2xlibre net>
Date: Thu Sep 1 16:10:47 2011 +0200
Improve statistics display (non right-aligned) on vertimus page (Refs #657460)
media/css/main.css | 13 +++++++++++++
stats/templatetags/stats_extras.py | 6 +++---
2 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/media/css/main.css b/media/css/main.css
index 19a559c..1434101 100644
--- a/media/css/main.css
+++ b/media/css/main.css
@@ -323,6 +323,19 @@ p#show, p#hide {
div#vertimus_stats {
line-height: 1.7em;
}
+
+div#vertimus_stats pre.stats {
+ white-space: normal;
+ font-family: sans-serif;
+ font-size: 100%;
+}
+
+div#vertimus_stats pre.stats b {
+ font-size: 100%;
+}
+div#vertimus_stats span.num1:after {content: " /";}
+div#vertimus_stats span.num2:after {content: " /";}
+
/* Trick to clear floats after div */
div#vertimus_stats:after {
content: ".";
diff --git a/stats/templatetags/stats_extras.py b/stats/templatetags/stats_extras.py
index fd612e8..e4162b6 100644
--- a/stats/templatetags/stats_extras.py
+++ b/stats/templatetags/stats_extras.py
@@ -59,10 +59,10 @@ def num_stats(stat, scope='full'):
if 'translated_perc' in stats:
stats['prc'] = stats['translated_perc']
if 'prc' in stats:
- result = '<pre class="stats"><b>%(prc)3s%%</b> %(translated)6s %(fuzzy)5s %(untranslated)5s </pre>' % stats
- result = result.replace(" 0 ", '<span class="zero"> 0 </span>')
+ result = '<pre class="stats"><b>%(prc)3s%%</b> <span class="num1">%(translated)6s</span> <span class="num2">%(fuzzy)5s</span> <span class="num3">%(untranslated)5s</span> </pre>' % stats
+ result = result.replace('">0</span>', ' zero">0</span>')
else:
- result = "(%(translated)s/%(fuzzy)s/%(untranslated)s)" % stats
+ result = "%(translated)s/%(fuzzy)s/%(untranslated)s" % stats
return mark_safe(result)
@register.filter
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]