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
f42e5892
Commit
f42e5892
authored
Dec 10, 2014
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8a70c72e
cd7ffab4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
weblate/trans/forms.py
weblate/trans/forms.py
+15
-6
weblate/trans/models/unit.py
weblate/trans/models/unit.py
+4
-0
No files found.
weblate/trans/forms.py
View file @
f42e5892
...
@@ -425,6 +425,16 @@ class SearchForm(forms.Form):
...
@@ -425,6 +425,16 @@ class SearchForm(forms.Form):
required
=
False
,
required
=
False
,
initial
=
False
initial
=
False
)
)
loc
=
forms
.
BooleanField
(
label
=
_
(
'Search in location strings'
),
required
=
False
,
initial
=
False
)
cmt
=
forms
.
BooleanField
(
label
=
_
(
'Search in comment strings'
),
required
=
False
,
initial
=
False
)
type
=
forms
.
ChoiceField
(
type
=
forms
.
ChoiceField
(
label
=
_
(
'Search filter'
),
label
=
_
(
'Search filter'
),
required
=
False
,
required
=
False
,
...
@@ -463,6 +473,8 @@ class SearchForm(forms.Form):
...
@@ -463,6 +473,8 @@ class SearchForm(forms.Form):
# Default to source and target search
# Default to source and target search
if
(
not
cleaned_data
[
'src'
]
if
(
not
cleaned_data
[
'src'
]
and
not
cleaned_data
[
'tgt'
]
and
not
cleaned_data
[
'tgt'
]
and
not
cleaned_data
[
'loc'
]
and
not
cleaned_data
[
'cmt'
]
and
not
cleaned_data
[
'ctx'
]):
and
not
cleaned_data
[
'ctx'
]):
cleaned_data
[
'src'
]
=
True
cleaned_data
[
'src'
]
=
True
cleaned_data
[
'tgt'
]
=
True
cleaned_data
[
'tgt'
]
=
True
...
@@ -478,12 +490,9 @@ class SearchForm(forms.Form):
...
@@ -478,12 +490,9 @@ class SearchForm(forms.Form):
if
self
.
cleaned_data
[
'q'
]:
if
self
.
cleaned_data
[
'q'
]:
query
[
'q'
]
=
self
.
cleaned_data
[
'q'
].
encode
(
'utf-8'
)
query
[
'q'
]
=
self
.
cleaned_data
[
'q'
].
encode
(
'utf-8'
)
query
[
'search'
]
=
self
.
cleaned_data
[
'search'
]
query
[
'search'
]
=
self
.
cleaned_data
[
'search'
]
if
self
.
cleaned_data
[
'src'
]:
for
param
in
(
'src'
,
'tgt'
,
'ctx'
,
'cmt'
,
'loc'
):
query
[
'src'
]
=
'on'
if
self
.
cleaned_data
[
param
]:
if
self
.
cleaned_data
[
'tgt'
]:
query
[
param
]
=
'on'
query
[
'tgt'
]
=
'on'
if
self
.
cleaned_data
[
'ctx'
]:
query
[
'ctx'
]
=
'on'
if
self
.
cleaned_data
[
'type'
]
!=
'all'
:
if
self
.
cleaned_data
[
'type'
]
!=
'all'
:
query
[
'type'
]
=
self
.
cleaned_data
[
'type'
]
query
[
'type'
]
=
self
.
cleaned_data
[
'type'
]
...
...
weblate/trans/models/unit.py
View file @
f42e5892
...
@@ -214,6 +214,10 @@ class UnitManager(models.Manager):
...
@@ -214,6 +214,10 @@ class UnitManager(models.Manager):
queries
.
append
(
'target'
)
queries
.
append
(
'target'
)
if
params
[
'ctx'
]:
if
params
[
'ctx'
]:
queries
.
append
(
'context'
)
queries
.
append
(
'context'
)
if
params
[
'loc'
]:
queries
.
append
(
'location'
)
if
params
[
'cmt'
]:
queries
.
append
(
'comment'
)
query
=
reduce
(
query
=
reduce
(
lambda
q
,
value
:
lambda
q
,
value
:
...
...
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