##// END OF EJS Templates
pyramid: stop relying on pylons translation object in helpers....
marcink -
r1914:59359988 default
parent child Browse files
Show More
@@ -48,7 +48,7 b' from pygments.formatters.html import Htm'
48 48 from pygments import highlight as code_highlight
49 49 from pygments.lexers import (
50 50 get_lexer_by_name, get_lexer_for_filename, get_lexer_for_mimetype)
51 from pylons.i18n.translation import _, ungettext
51
52 52 from pyramid.threadlocal import get_current_request
53 53
54 54 from webhelpers.html import literal, HTML, escape
@@ -1517,24 +1517,6 b' class RepoPage(Page):'
1517 1517 list.__init__(self, reversed(self.items))
1518 1518
1519 1519
1520 def changed_tooltip(nodes):
1521 """
1522 Generates a html string for changed nodes in commit page.
1523 It limits the output to 30 entries
1524
1525 :param nodes: LazyNodesGenerator
1526 """
1527 if nodes:
1528 pref = ': <br/> '
1529 suf = ''
1530 if len(nodes) > 30:
1531 suf = '<br/>' + _(' and %s more') % (len(nodes) - 30)
1532 return literal(pref + '<br/> '.join([safe_unicode(x.path)
1533 for x in nodes[:30]]) + suf)
1534 else:
1535 return ': ' + _('No Files')
1536
1537
1538 1520 def breadcrumb_repo_link(repo):
1539 1521 """
1540 1522 Makes a breadcrumbs path link to repo
@@ -1836,7 +1818,9 b' def get_permission_name(key):'
1836 1818 return dict(Permission.PERMS).get(key)
1837 1819
1838 1820
1839 def journal_filter_help():
1821 def journal_filter_help(request):
1822 _ = request.translate
1823
1840 1824 return _(
1841 1825 'Example filter terms:\n' +
1842 1826 ' repository:vcs\n' +
@@ -1857,7 +1841,8 b' def journal_filter_help():'
1857 1841 )
1858 1842
1859 1843
1860 def search_filter_help(searcher):
1844 def search_filter_help(searcher, request):
1845 _ = request.translate
1861 1846
1862 1847 terms = ''
1863 1848 return _(
@@ -1876,6 +1861,7 b' def search_filter_help(searcher):'
1876 1861
1877 1862
1878 1863 def not_mapped_error(repo_name):
1864 from rhodecode.translation import _
1879 1865 flash(_('%s repository is not mapped to db perhaps'
1880 1866 ' it was created or renamed from the filesystem'
1881 1867 ' please run the application again'
@@ -14,7 +14,7 b''
14 14 <input type='submit' value="${_('filter')}" class="btn" />
15 15 ${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
16 16 ${h.end_form()}
17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help())}">${_('Example Queries')}</p>
17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
18 18 </%def>
19 19
20 20 <%def name="menu_bar_nav()">
@@ -14,7 +14,7 b''
14 14 <input class="q_filter_box ${'' if c.filter_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.filter_term or ''}" placeholder="${_('audit filter...')}"/>
15 15 <input type='submit' value="${_('filter')}" class="btn" />
16 16 ${h.end_form()}
17 <p class="tooltip filterexample" style="position: inherit" title="${h.tooltip(h.journal_filter_help())}">${_('Example Queries')}</p>
17 <p class="tooltip filterexample" style="position: inherit" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
18 18
19 19 <%include file="/admin/admin_log_base.mako" />
20 20
@@ -14,7 +14,7 b''
14 14 ${_('Journal')} - ${ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
15 15 ${h.end_form()}
16 16 </h1>
17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help())}">${_('Example Queries')}</p>
17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
18 18 </%def>
19 19 <%def name="menu_bar_nav()">
20 20 ${self.menu_items(active='journal')}
@@ -74,7 +74,7 b''
74 74 % endfor
75 75 <div class="field">
76 76 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
77 <pre id="search-help" style="display: none">${h.tooltip(h.search_filter_help(c.searcher))}</pre>
77 <pre id="search-help" style="display: none">${h.tooltip(h.search_filter_help(c.searcher, request))}</pre>
78 78 </div>
79 79
80 80 <div class="field">${c.runtime}</div>
General Comments 0
You need to be logged in to leave comments. Login now