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
9d381c45
Commit
9d381c45
authored
Sep 18, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace unit-state.html with Unit method
parent
1ceacc17
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
11 deletions
+42
-11
trans/models/unit.py
trans/models/unit.py
+40
-0
weblate/html/js/other.html
weblate/html/js/other.html
+1
-1
weblate/html/translate.html
weblate/html/translate.html
+1
-1
weblate/html/unit-state.html
weblate/html/unit-state.html
+0
-9
No files found.
trans/models/unit.py
View file @
9d381c45
...
...
@@ -35,6 +35,8 @@ from trans.filelock import FileLockException
from
trans.util
import
is_plural
,
split_plural
,
join_plural
import
weblate
FLAG_TEMPLATE
=
'<span title="%s" class="flag-icon ui-icon ui-icon-%s"></span>'
class
UnitManager
(
models
.
Manager
):
def
update_from_unit
(
self
,
translation
,
unit
,
pos
):
...
...
@@ -992,3 +994,41 @@ class Unit(models.Model):
+
self
.
translation
.
subproject
.
all_flags
)
return
self
.
_all_flags
def
get_state_flags
(
self
):
'''
Returns state flags.
'''
flags
=
[]
if
self
.
fuzzy
:
flags
.
append
(
_
(
'Message is fuzzy'
),
'help'
)
elif
not
self
.
translated
:
flags
.
append
(
_
(
'Message is not translated'
),
'document-b'
)
elif
self
.
has_failing_check
:
flags
.
append
(
_
(
'Message has failing checks'
),
'notice'
)
elif
self
.
translated
:
flags
.
append
(
_
(
'Message is translated'
),
'check'
)
if
self
.
has_comment
:
flags
.
append
(
_
(
'Message has comments'
),
'comment'
)
return
mark_safe
(
'
\
n
'
.
join
([
FLAG_TEMPLATE
%
flag
for
flag
in
flags
])
)
weblate/html/js/other.html
View file @
9d381c45
...
...
@@ -11,7 +11,7 @@
<td>
{{ item.translation.subproject }}
</td>
<td
class=
"translatetext"
><a
href=
"{{ item.get_absolute_url }}"
>
{{ item.source|fmttranslation }}
</a></td>
<td
class=
"translatetext"
{{
item
.
translation
.
language
.
get_html
}}
><a
href=
"{{ item.get_absolute_url }}"
>
{{ item.target|fmttranslationdiff:unit }}
</a></td>
{% include "unit-state.html" %}
<td>
{{ item.get_state_flags }}
</td>
<td>
{% if perms.trans.save_translation %}
<a
class=
"mergebutton small-button"
href=
"{{ unit.translation.get_translate_url}}?sid={{ search_id }}&offset={{ offset }}&checksum={{ unit.checksum }}&merge={{ item.id }}"
title=
"{% trans "
Use
this
translation
for
all
subprojects
"
%}"
>
{% trans "Use this translation" %}
</a>
...
...
weblate/html/translate.html
View file @
9d381c45
...
...
@@ -211,7 +211,7 @@
<td
class=
"number"
><a
href=
"{{ item.get_absolute_url }}"
>
{{ item.position }}
</a></td>
<td
class=
"translatetext"
><a
href=
"{{ item.get_absolute_url }}"
>
{{ item.source|fmttranslation }}
</a></td>
<td
class=
"translatetext translation_html_markup"
{{
item
.
translation
.
language
.
get_html
}}
><a
href=
"{{ item.get_absolute_url }}"
>
{{ item.target|fmttranslation:unit.translation.language }}
</a></td>
{% include "unit-state.html" %}
<td>
{{ item.get_state_flags }}
</td>
</tr>
{% endfor %}
</tbody>
...
...
weblate/html/unit-state.html
deleted
100644 → 0
View file @
1ceacc17
{% load i18n %}
<td>
{% if item.fuzzy %}
<span
title=
"{% trans "
Message
is
fuzzy
"
%}"
class=
"flag-icon ui-icon ui-icon-help"
></span>
{% else %}
{% if not item.translated %}
<span
title=
"{% trans "
Message
is
not
translated
"
%}"
class=
"flag-icon ui-icon ui-icon-document-b"
></span>
{% else %}
{% if item.has_failing_check %}
<span
title=
"{% trans "
Message
has
failing
checks
"
%}"
class=
"flag-icon ui-icon ui-icon-notice"
></span>
{% else %}
{% if item.translated %}
<span
title=
"{% trans "
Message
is
translated
"
%}"
class=
"flag-icon ui-icon ui-icon-check"
></span>
{% endif %}
{% endif %}{% endif %}{% endif %}
{% if item.has_comment %}
<span
title=
"{% trans "
Message
has
comments
"
%}"
class=
"flag-icon ui-icon ui-icon-comment"
></span>
{% endif %}
</td>
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