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
35763635
Commit
35763635
authored
Nov 04, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to filter checks by language
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
2ab31ae6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
25 deletions
+52
-25
weblate/html/language.html
weblate/html/language.html
+9
-0
weblate/trans/views/checks.py
weblate/trans/views/checks.py
+43
-25
No files found.
weblate/html/language.html
View file @
35763635
...
...
@@ -15,6 +15,15 @@
<li><a
href=
"#history"
data-toggle=
"tab"
>
{% trans "History" %}
</a></li>
<li><a
href=
"#activity"
data-toggle=
"tab"
data-href=
"{% url 'view_language_activity' lang=object.code %}"
>
{% trans "Activity" %}
</a></li>
<li><a
href=
"#dicts"
data-toggle=
"tab"
>
{% trans "Glossaries" %}
</a></li>
<li
class=
"dropdown"
>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
{% trans "Tools" %}
<span
class=
"caret"
></span>
</a>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"{% url 'checks' %}?language={{ object.code }}"
>
{% trans "Failing checks" %}
</a></li>
<li><a
href=
"{% url 'checks' %}?language={{ object.code }}&ignored=true"
>
{% trans "Ignored checks" %}
</a></li>
</ul>
</li>
</ul>
<div
class=
"tab-content"
>
...
...
weblate/trans/views/checks.py
View file @
35763635
...
...
@@ -56,6 +56,10 @@ def show_checks(request):
allchecks
=
allchecks
.
filter
(
project__slug
=
request
.
GET
[
'project'
])
url_params
[
'project'
]
=
request
.
GET
[
'project'
]
if
'language'
in
request
.
GET
:
allchecks
=
allchecks
.
filter
(
language__code
=
request
.
GET
[
'language'
])
url_params
[
'language'
]
=
request
.
GET
[
'language'
]
allchecks
=
allchecks
.
values
(
'check'
).
annotate
(
count
=
Count
(
'id'
))
return
render
(
...
...
@@ -90,6 +94,10 @@ def show_check(request, name):
ignore
=
ignore
,
)
if
'language'
in
request
.
GET
:
checks
=
checks
.
filter
(
language__code
=
request
.
GET
[
'language'
])
url_params
[
'language'
]
=
request
.
GET
[
'language'
]
if
'project'
in
request
.
GET
:
return
redirect_param
(
'show_check_project'
,
...
...
@@ -123,23 +131,28 @@ def show_check_project(request, name, project):
raise
Http404
(
'No check matches the given query.'
)
ignore
=
(
'ignored'
in
request
.
GET
)
url_params
=
''
if
ignore
:
url_params
=
'?ignored=true'
u
nits
=
Unit
.
objects
.
none
()
if
check
.
target
:
lang
s
=
Check
.
objects
.
filter
(
u
rl_params
=
{}
allcheck
s
=
Check
.
objects
.
filter
(
check
=
name
,
project
=
prj
,
ignore
=
ignore
,
).
values_list
(
'language'
,
flat
=
True
).
distinct
()
)
if
ignore
:
url_params
[
'ignored'
]
=
'true'
if
'language'
in
request
.
GET
:
allchecks
=
allchecks
.
filter
(
language__code
=
request
.
GET
[
'language'
])
url_params
[
'language'
]
=
request
.
GET
[
'language'
]
units
=
Unit
.
objects
.
none
()
if
check
.
target
:
langs
=
allchecks
.
values_list
(
'language'
,
flat
=
True
).
distinct
()
for
lang
in
langs
:
checks
=
Check
.
objects
.
filter
(
check
=
name
,
project
=
prj
,
checks
=
allchecks
.
filter
(
language
=
lang
,
ignore
=
ignore
,
).
values_list
(
'contentsum'
,
flat
=
True
)
res
=
Unit
.
objects
.
filter
(
contentsum__in
=
checks
,
...
...
@@ -152,11 +165,8 @@ def show_check_project(request, name, project):
).
annotate
(
count
=
Count
(
'id'
))
units
|=
res
if
check
.
source
:
checks
=
Check
.
objects
.
filter
(
check
=
name
,
project
=
prj
,
checks
=
allchecks
.
filter
(
language
=
None
,
ignore
=
ignore
,
).
values_list
(
'contentsum'
,
flat
=
True
)
...
...
@@ -199,7 +209,7 @@ def show_check_project(request, name, project):
'title'
:
'%s/%s'
%
(
prj
.
__unicode__
(),
check
.
name
),
'check'
:
check
,
'project'
:
prj
,
'url_params'
:
url_params
,
'url_params'
:
encode_optional
(
url_params
)
,
}
)
...
...
@@ -217,6 +227,12 @@ def show_check_subproject(request, name, project, subproject):
ignore
=
(
'ignored'
in
request
.
GET
)
url_params
=
{}
allchecks
=
Check
.
objects
.
filter
(
check
=
name
,
project
=
subprj
.
project
,
ignore
=
ignore
,
)
if
ignore
:
url_params
[
'ignored'
]
=
'true'
...
...
@@ -229,22 +245,24 @@ def show_check_subproject(request, name, project, subproject):
subproject
=
subprj
.
slug
,
)
if
'language'
in
request
.
GET
:
return
redirect_param
(
'translate'
,
encode_optional
(
url_params
),
project
=
subprj
.
project
.
slug
,
subproject
=
subprj
.
slug
,
lang
=
request
.
GET
[
'language'
],
)
units
=
Unit
.
objects
.
none
()
if
check
.
target
:
langs
=
Check
.
objects
.
filter
(
check
=
name
,
project
=
subprj
.
project
,
ignore
=
ignore
,
).
values_list
(
langs
=
allchecks
.
values_list
(
'language'
,
flat
=
True
).
distinct
()
for
lang
in
langs
:
checks
=
Check
.
objects
.
filter
(
check
=
name
,
project
=
subprj
.
project
,
checks
=
allchecks
.
filter
(
language
=
lang
,
ignore
=
ignore
,
).
values_list
(
'contentsum'
,
flat
=
True
)
res
=
Unit
.
objects
.
filter
(
translation__subproject
=
subprj
,
...
...
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