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
375af10a
Commit
375af10a
authored
Apr 18, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
6d18f9e5
68a04c99
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
60 additions
and
23 deletions
+60
-23
accounts/views.py
accounts/views.py
+3
-3
docs/changes.rst
docs/changes.rst
+12
-0
docs/conf.py
docs/conf.py
+1
-1
trans/models/changes.py
trans/models/changes.py
+17
-0
trans/util.py
trans/util.py
+3
-4
trans/views/basic.py
trans/views/basic.py
+8
-8
trans/views/changes.py
trans/views/changes.py
+10
-1
trans/views/edit.py
trans/views/edit.py
+1
-1
weblate.spec
weblate.spec
+1
-1
weblate/__init__.py
weblate/__init__.py
+1
-1
weblate/html/last-changes.html
weblate/html/last-changes.html
+1
-1
weblate/html/trans/change_list.html
weblate/html/trans/change_list.html
+1
-1
weblate/media/loader.js
weblate/media/loader.js
+1
-1
No files found.
accounts/views.py
View file @
375af10a
...
...
@@ -184,7 +184,7 @@ def user_page(request, user):
acl_projects
=
Project
.
objects
.
all_acl
(
request
.
user
)
# Filter all user activity
all_changes
=
Change
.
objects
.
filter
(
all_changes
=
Change
.
objects
.
all_related
().
filter
(
user
=
user
,
translation__subproject__project__in
=
acl_projects
,
)
...
...
@@ -193,9 +193,9 @@ def user_page(request, user):
last_changes
=
all_changes
[:
10
]
# Filter where project is active
user_projects_ids
=
lis
t
(
all_changes
.
values_list
(
user_projects_ids
=
se
t
(
all_changes
.
values_list
(
'translation__subproject__project'
,
flat
=
True
)
.
distinct
()
)
))
user_projects
=
Project
.
objects
.
filter
(
id__in
=
user_projects_ids
)
return
render_to_response
(
...
...
docs/changes.rst
View file @
375af10a
Changes
=======
weblate 1.6
-----------
Released on ? 2013.
* Nicer error handling on registration.
* Browsing of changes.
* Fixed sorting of machine translation suggestions.
* Improved support for MyMemory machine translation.
* Added support for Amagama machine translation.
* Various optimizations on frequently used pages.
weblate 1.5
-----------
...
...
docs/conf.py
View file @
375af10a
...
...
@@ -49,7 +49,7 @@ copyright = u'2012 - 2013, Michal Čihař'
# built documents.
#
# The short X.Y version.
version
=
'1.
5
'
version
=
'1.
6
'
# The full version, including alpha/beta/rc tags.
release
=
version
...
...
trans/models/changes.py
View file @
375af10a
...
...
@@ -107,6 +107,23 @@ class ChangeManager(models.Manager):
'''
return
self
.
base_stats
(
365
,
7
,
*
args
,
**
kwargs
)
def
all_related
(
self
):
'''
Includes all related tables in select.
'''
return
self
.
select_related
(
'unit'
,
'unit__translation'
,
'unit__translation__subproject'
,
'unit__translation__subproject__project'
,
'unit__translation__language'
,
'translation'
,
'translation__language'
,
'translation__subproject'
,
'translation__subproject__project'
,
'user'
,
)
class
Change
(
models
.
Model
):
ACTION_UPDATE
=
0
...
...
trans/util.py
View file @
375af10a
...
...
@@ -25,6 +25,7 @@ from django.utils.translation import ugettext as _
from
django.core.cache
import
cache
from
django.utils.html
import
escape
from
django.utils.safestring
import
mark_safe
from
django.core.urlresolvers
import
reverse
from
django.conf
import
settings
from
importlib
import
import_module
import
urllib
...
...
@@ -104,7 +105,6 @@ def get_user_display(user, icon=True, link=False):
# None user, probably remotely triggered action
full_name
=
_
(
'None'
)
email
=
''
profile
=
None
else
:
# Get full name
full_name
=
user
.
get_full_name
()
...
...
@@ -114,7 +114,6 @@ def get_user_display(user, icon=True, link=False):
full_name
=
user
.
username
email
=
user
.
email
profile
=
user
.
get_profile
()
# Escape HTML
full_name
=
escape
(
full_name
)
...
...
@@ -129,10 +128,10 @@ def get_user_display(user, icon=True, link=False):
'avatar'
:
avatar
}
if
link
and
profile
is
not
None
:
if
link
and
user
is
not
None
:
return
mark_safe
(
'<a href="%(link)s">%(name)s</a>'
%
{
'name'
:
full_name
,
'link'
:
profile
.
get_absolute_url
(
),
'link'
:
reverse
(
'user_page'
,
kwargs
=
{
'user'
:
user
.
username
}
),
})
else
:
return
mark_safe
(
full_name
)
...
...
trans/views/basic.py
View file @
375af10a
...
...
@@ -57,7 +57,7 @@ def home(request):
projects
=
Project
.
objects
.
all_acl
(
request
.
user
)
acl_projects
=
projects
if
projects
.
count
()
==
1
:
projects
=
SubProject
.
objects
.
filter
(
project
=
projects
[
0
])
projects
=
SubProject
.
objects
.
filter
(
project
=
projects
[
0
])
.
select_related
()
# Warn about not filled in username (usually caused by migration of
# users from older system
...
...
@@ -81,14 +81,14 @@ def home(request):
# Some stats
top_translations
=
Profile
.
objects
.
order_by
(
'-translated'
)[:
10
]
top_suggestions
=
Profile
.
objects
.
order_by
(
'-suggested'
)[:
10
]
last_changes
=
Change
.
objects
.
filter
(
last_changes
=
Change
.
objects
.
all_related
().
filter
(
translation__subproject__project__in
=
acl_projects
,
).
order_by
(
'-timestamp'
)[:
10
]
return
render_to_response
(
'index.html'
,
RequestContext
(
request
,
{
'projects'
:
projects
,
'top_translations'
:
top_translations
,
'top_suggestions'
:
top_suggestions
,
'top_translations'
:
top_translations
.
select_related
(
'user'
)
,
'top_suggestions'
:
top_suggestions
.
select_related
(
'user'
)
,
'last_changes'
:
last_changes
,
'last_changes_rss'
:
reverse
(
'rss'
),
'last_changes_url'
:
''
,
...
...
@@ -105,7 +105,7 @@ def show_languages(request):
def
show_language
(
request
,
lang
):
obj
=
get_object_or_404
(
Language
,
code
=
lang
)
last_changes
=
Change
.
objects
.
filter
(
last_changes
=
Change
.
objects
.
all_related
().
filter
(
translation__language
=
obj
).
order_by
(
'-timestamp'
)[:
10
]
dicts
=
Dictionary
.
objects
.
filter
(
...
...
@@ -173,7 +173,7 @@ def show_project(request, project):
'language'
,
flat
=
True
).
distinct
()
last_changes
=
Change
.
objects
.
filter
(
last_changes
=
Change
.
objects
.
all_related
().
filter
(
translation__subproject__project
=
obj
).
order_by
(
'-timestamp'
)[:
10
]
...
...
@@ -194,7 +194,7 @@ def show_project(request, project):
def
show_subproject
(
request
,
project
,
subproject
):
obj
=
get_subproject
(
request
,
project
,
subproject
)
last_changes
=
Change
.
objects
.
filter
(
last_changes
=
Change
.
objects
.
all_related
().
filter
(
translation__subproject
=
obj
).
order_by
(
'-timestamp'
)[:
10
]
...
...
@@ -272,7 +272,7 @@ def show_source(request, project, subproject):
def
show_translation
(
request
,
project
,
subproject
,
lang
):
obj
=
get_translation
(
request
,
project
,
subproject
,
lang
)
last_changes
=
Change
.
objects
.
filter
(
last_changes
=
Change
.
objects
.
all_related
().
filter
(
translation
=
obj
).
order_by
(
'-timestamp'
)[:
10
]
...
...
trans/views/changes.py
View file @
375af10a
...
...
@@ -33,6 +33,15 @@ class ChangesView(ListView):
Browser for changes.
'''
paginate_by
=
20
def
get_context_data
(
self
,
**
kwargs
):
'''
Creates context for rendering page.
'''
context
=
super
(
ChangesView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'title'
]
=
_
(
'Changes'
)
return
context
def
get_queryset
(
self
):
'''
...
...
@@ -74,7 +83,7 @@ class ChangesView(ListView):
except
User
.
DoesNotExist
:
messages
.
error
(
self
.
request
,
_
(
'Invalid search string!'
))
result
=
Change
.
objects
.
all
()
result
=
Change
.
objects
.
all
_related
()
if
translation
is
not
None
:
result
=
result
.
filter
(
translation
=
translation
)
...
...
trans/views/edit.py
View file @
375af10a
...
...
@@ -477,7 +477,7 @@ def translate(request, project, subproject, lang):
'prev_unit_url'
:
base_unit_url
+
str
(
offset
-
1
),
'object'
:
obj
,
'unit'
:
unit
,
'last_changes'
:
unit
.
change_set
.
all
()[:
10
],
'last_changes'
:
unit
.
change_set
.
all
_related
()[:
10
],
'last_changes_rss'
:
reverse
(
'rss-translation'
,
kwargs
=
obj
.
get_kwargs
(),
...
...
weblate.spec
View file @
375af10a
Name: weblate
Version: 1.
5
Version: 1.
6
Release: 1
License: GPL-3+
Summary: Web-based translation tool
...
...
weblate/__init__.py
View file @
375af10a
...
...
@@ -39,7 +39,7 @@ def is_running_git():
return
os
.
path
.
exists
(
os
.
path
.
join
(
get_root_dir
(),
'.git'
))
# Weblate version
VERSION
=
'1.
5
'
VERSION
=
'1.
6
'
# Are we running git
RUNNING_GIT
=
is_running_git
()
...
...
weblate/html/last-changes.html
View file @
375af10a
...
...
@@ -17,7 +17,7 @@
<th>
{% trans "Translation" %}
</th>
</tr>
<tbody>
{% for c in last_changes
.select_related
%}
{% for c in last_changes %}
<tr>
<td>
{{ c.timestamp|naturaltime }}
</td>
<td>
{{ c.get_user_display }}
</td>
...
...
weblate/html/trans/change_list.html
View file @
375af10a
...
...
@@ -31,7 +31,7 @@
<th>
{% trans "Translation" %}
</th>
</tr>
<tbody>
{% for c in object_list
.select_related
%}
{% for c in object_list %}
<tr>
<td>
{{ c.timestamp|naturaltime }}
</td>
<td>
{{ c.get_user_display }}
</td>
...
...
weblate/media/loader.js
View file @
375af10a
...
...
@@ -73,7 +73,7 @@ function process_machine_translation(data, textStatus, jqXHR) {
new_row
.
append
(
$
(
'
<td/>
'
).
text
(
el
.
service
));
new_row
.
append
(
$
(
'
<td><a class="copymt small-button">
'
+
gettext
(
'
Copy
'
)
+
'
</a></td>
'
));
$
(
'
#machine-translations
'
).
children
(
'
tr
'
).
each
(
function
(
idx
)
{
if
(
$
(
this
).
data
(
'
quality
'
)
<
el
.
quality
)
{
if
(
$
(
this
).
data
(
'
quality
'
)
<
el
.
quality
&&
!
done
)
{
$
(
this
).
before
(
new_row
);
done
=
true
;
}
...
...
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