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
fbff6ae2
Commit
fbff6ae2
authored
Mar 05, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show user translations on main page
parent
7284324b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
html/index.html
html/index.html
+23
-0
trans/views.py
trans/views.py
+7
-0
No files found.
html/index.html
View file @
fbff6ae2
...
...
@@ -3,6 +3,29 @@
{% block content %}
<h2>
{% trans "Your translations" %}
</h2>
<table>
<thead>
<tr>
<th>
{% trans "Language" %}
</th>
<th
colspan=
"2"
>
{% trans "Translated" %}
</th>
<th>
{% trans "Fuzzy" %}
</th>
</tr>
<tbody>
{% for trans in usertranslations %}
{% with trans.get_translated_percent as percent and trans.get_fuzzy_percent as fuzzy %}
<tr>
<th><a
href=
"{{ trans.get_absolute_url }}"
>
{{ trans.subproject }} - {% trans trans.language.name %}
</a></th>
<td
class=
"percent"
>
{{ percent }}%
</td>
<td
class=
"progress"
><div
class=
"progress"
id=
"{{ percent|floatformat:0 }}"
></div></td>
<td
class=
"percent"
>
{{ fuzzy }}%
</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
<h2>
{% trans "Projects" %}
</h2>
<table>
...
...
trans/views.py
View file @
fbff6ae2
...
...
@@ -20,6 +20,12 @@ logger = logging.getLogger('weblate')
def
home
(
request
):
projects
=
Project
.
objects
.
all
()
usertranslations
=
None
if
request
.
user
.
is_authenticated
():
profile
=
request
.
user
.
get_profile
()
usertranslations
=
Translation
.
objects
.
filter
(
language__in
=
profile
.
languages
.
all
())
top_translations
=
Profile
.
objects
.
order_by
(
'-translated'
)[:
10
]
top_suggestions
=
Profile
.
objects
.
order_by
(
'-suggested'
)[:
10
]
...
...
@@ -27,6 +33,7 @@ def home(request):
'projects'
:
projects
,
'top_translations'
:
top_translations
,
'top_suggestions'
:
top_suggestions
,
'usertranslations'
:
usertranslations
,
'title'
:
settings
.
SITE_TITLE
,
}))
...
...
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