Commit 8e22224f authored by Michal Čihař's avatar Michal Čihař

Move template to the top

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 5ee3de92
...@@ -16,7 +16,7 @@ persistent=yes ...@@ -16,7 +16,7 @@ persistent=yes
# List of plugins (as comma separated values of python modules names) to load, # List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers. # usually to register additional checkers.
load-plugins=pylint_django #load-plugins=pylint_django
[MESSAGES CONTROL] [MESSAGES CONTROL]
......
...@@ -48,6 +48,10 @@ register = template.Library() ...@@ -48,6 +48,10 @@ register = template.Library()
SPACE_NL = '<span class="hlspace space-nl" title="{0}"></span><br />' SPACE_NL = '<span class="hlspace space-nl" title="{0}"></span><br />'
SPACE_TAB = '<span class="hlspace space-tab" title="{0}"></span>' SPACE_TAB = '<span class="hlspace space-tab" title="{0}"></span>'
HL_CHECK = '''
<span class="hlcheck">{0}<span class="highlight-number"></span></span>
'''
WHITESPACE_RE = re.compile(r'( +| $|^ )') WHITESPACE_RE = re.compile(r'( +| $|^ )')
NEWLINES_RE = re.compile(r'\r\n|\r|\n') NEWLINES_RE = re.compile(r'\r\n|\r|\n')
TYPE_MAPPING = { TYPE_MAPPING = {
...@@ -128,7 +132,7 @@ def format_translation(value, language, diff=None, search_match=None, ...@@ -128,7 +132,7 @@ def format_translation(value, language, diff=None, search_match=None,
htext = escape(force_text(highlight[2])) htext = escape(force_text(highlight[2]))
find_highlight = value.find(htext, start_search) find_highlight = value.find(htext, start_search)
if find_highlight >= 0: if find_highlight >= 0:
newpart = u'<span class="hlcheck">{0}<span class="highlight-number"></span></span>'.format(htext) newpart = HL_CHECK.format(htext)
next_part = value[(find_highlight + len(htext)):] next_part = value[(find_highlight + len(htext)):]
value = value[:find_highlight] + newpart + next_part value = value[:find_highlight] + newpart + next_part
start_search = find_highlight + len(newpart) start_search = find_highlight + len(newpart)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment