Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
83001576
Commit
83001576
authored
Mar 05, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Summary stats on title page
parent
e1571b96
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
3 deletions
+29
-3
html/index.html
html/index.html
+16
-3
media/css/style.css
media/css/style.css
+6
-0
media/js/loader.js
media/js/loader.js
+1
-0
trans/models.py
trans/models.py
+6
-0
No files found.
html/index.html
View file @
83001576
...
...
@@ -5,11 +5,24 @@
<h2>
{% trans "Projects" %}
</h2>
<ul>
<table>
<thead>
<tr>
<th>
{% trans "Project" %}
</th>
<th
colspan=
"2"
>
{% trans "Translated" %}
</th>
</tr>
<tbody>
{% for prj in projects %}
<li><a
href=
"{{ prj.get_absolute_url }}"
>
{{ prj.name }}
</a></li>
{% with prj.get_translated_percent as percent %}
<tr>
<th><a
href=
"{{ prj.get_absolute_url }}"
>
{{ prj.name }}
</a></th>
<td
class=
"percent"
>
{{ percent }}%
</td>
<td
class=
"progress"
><div
class=
"progress"
id=
"{{ percent|floatformat:0 }}"
></div></td>
</tr>
{% endwith %}
{% endfor %}
</ul>
</tbody>
</table>
{% endblock %}
media/css/style.css
View file @
83001576
...
...
@@ -83,3 +83,9 @@ td.suggestions table {
.helptext
{
font-size
:
smaller
;
}
.percent
{
text-align
:
right
;
}
div
.progress
{
width
:
20em
;
}
media/js/loader.js
View file @
83001576
...
...
@@ -18,4 +18,5 @@ $(document).ready(function(){
});
$
(
'
.accordion
'
).
accordion
();
$
(
'
.errorlist
'
).
addClass
(
'
ui-state-error ui-corner-all
'
);
$
(
'
div.progress
'
).
each
(
function
f
(
i
,
e
)
{
e
=
$
(
e
);
e
.
progressbar
({
value
:
parseInt
(
e
.
attr
(
'
id
'
))
})});
});
trans/models.py
View file @
83001576
...
...
@@ -3,6 +3,7 @@ from django.db.models import Q
from
django.contrib.auth.models
import
User
from
django.conf
import
settings
from
lang.models
import
Language
from
django.db.models
import
Sum
from
django.utils.translation
import
ugettext_lazy
,
ugettext
as
_
from
django.utils.safestring
import
mark_safe
from
glob
import
glob
...
...
@@ -51,6 +52,11 @@ class Project(models.Model):
super
(
Project
,
self
).
save
(
*
args
,
**
kwargs
)
def
get_translated_percent
(
self
):
translations
=
Translation
.
objects
.
filter
(
subproject__project
=
self
).
aggregate
(
Sum
(
'translated'
),
Sum
(
'total'
))
return
round
(
translations
[
'translated__sum'
]
*
100.0
/
translations
[
'total__sum'
],
1
)
class
SubProject
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
100
,
help_text
=
_
(
'Name to display'
))
slug
=
models
.
SlugField
(
db_index
=
True
,
help_text
=
_
(
'Name used in URLs'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment