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
2d296eb2
Commit
2d296eb2
authored
Sep 18, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for browsing dictionary changes
parent
dacaf219
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
trans/views/changes.py
trans/views/changes.py
+16
-2
trans/views/dictionary.py
trans/views/dictionary.py
+11
-0
No files found.
trans/views/changes.py
View file @
2d296eb2
...
...
@@ -23,6 +23,7 @@ from django.http import Http404
from
django.contrib
import
messages
from
django.contrib.auth.models
import
User
from
django.utils.translation
import
ugettext
as
_
from
django.db.models
import
Q
from
trans.models.changes
import
Change
from
trans.views.helper
import
get_project_translation
from
lang.models
import
Language
...
...
@@ -70,6 +71,9 @@ class ChangesView(ListView):
if
self
.
user
is
not
None
:
url
[
'user'
]
=
self
.
user
.
username
if
self
.
glossary
:
url
[
'glossary'
]
=
1
context
[
'search_url'
]
=
urlencode
(
url
)
return
context
...
...
@@ -109,6 +113,9 @@ class ChangesView(ListView):
except
User
.
DoesNotExist
:
messages
.
error
(
self
.
request
,
_
(
'Failed to find matching user!'
))
# Glossary entries
self
.
glossary
=
'glossary'
in
self
.
request
.
GET
result
=
Change
.
objects
.
prefetch
()
if
self
.
translation
is
not
None
:
...
...
@@ -121,12 +128,19 @@ class ChangesView(ListView):
)
elif
self
.
project
is
not
None
:
result
=
result
.
filter
(
translation__subproject__project
=
self
.
project
Q
(
translation__subproject__project
=
self
.
project
)
|
Q
(
dictionary__project
=
self
.
project
)
)
if
self
.
language
is
not
None
:
result
=
result
.
filter
(
translation__language
=
self
.
language
Q
(
translation__language
=
self
.
language
)
|
Q
(
dictionary__language
=
self
.
language
)
)
if
self
.
glossary
:
result
=
result
.
filter
(
dictionary__isnull
=
False
)
if
self
.
user
is
not
None
:
...
...
trans/views/dictionary.py
View file @
2d296eb2
...
...
@@ -35,6 +35,7 @@ from trans.views.helper import get_project
import
weblate
import
csv
from
urllib
import
urlencode
def
show_dictionaries
(
request
,
project
):
...
...
@@ -90,6 +91,11 @@ def edit_dictionary(request, project, lang):
'language'
:
lang
,
'form'
:
form
,
'last_changes'
:
last_changes
,
'last_changes_url'
:
urlencode
({
'project'
:
prj
.
slug
,
'lang'
:
lang
.
code
,
'glossary'
:
1
}),
}))
...
...
@@ -320,4 +326,9 @@ def show_dictionary(request, project, lang):
'letterform'
:
letterform
,
'letter'
:
letter
,
'last_changes'
:
last_changes
,
'last_changes_url'
:
urlencode
({
'project'
:
prj
.
slug
,
'lang'
:
lang
.
code
,
'glossary'
:
1
}),
}))
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