##// END OF EJS Templates
audit-logs: improve help text, and expose all audit commands for easier filtering +ui fixes
marcink -
r2807:f77aceaf default
parent child Browse files
Show More
@@ -29,6 +29,7 b' import os'
29 29 import random
30 30 import hashlib
31 31 import StringIO
32 import textwrap
32 33 import urllib
33 34 import math
34 35 import logging
@@ -1864,6 +1865,8 b' def get_permission_name(key):'
1864 1865
1865 1866 def journal_filter_help(request):
1866 1867 _ = request.translate
1868 from rhodecode.lib.audit_logger import ACTIONS
1869 actions = '\n'.join(textwrap.wrap(', '.join(sorted(ACTIONS.keys())), 80))
1867 1870
1868 1871 return _(
1869 1872 'Example filter terms:\n' +
@@ -1875,6 +1878,8 b' def journal_filter_help(request):'
1875 1878 ' date:20120101\n' +
1876 1879 ' date:[20120101100000 TO 20120102]\n' +
1877 1880 '\n' +
1881 'Actions: {actions}\n' +
1882 '\n' +
1878 1883 'Generate wildcards using \'*\' character:\n' +
1879 1884 ' "repository:vcs*" - search everything starting with \'vcs\'\n' +
1880 1885 ' "repository:*vcs*" - search for repository containing \'vcs\'\n' +
@@ -1882,7 +1887,7 b' def journal_filter_help(request):'
1882 1887 'Optional AND / OR operators in queries\n' +
1883 1888 ' "repository:vcs OR repository:test"\n' +
1884 1889 ' "username:test AND repository:test*"\n'
1885 )
1890 ).format(actions=actions)
1886 1891
1887 1892
1888 1893 def search_filter_help(searcher, request):
@@ -14,12 +14,14 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(request))}">${_('Example Queries')}</p>
17 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
18 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
18 19 </%def>
19 20
20 21 <%def name="menu_bar_nav()">
21 22 ${self.menu_items(active='admin')}
22 23 </%def>
24
23 25 <%def name="main()">
24 26 <div class="box">
25 27 <!-- box / title -->
@@ -14,7 +14,9 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(request))}">${_('Example Queries')}</p>
17
18 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
19 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
18 20
19 21 <%include file="/admin/admin_log_base.mako" />
20 22
@@ -14,7 +14,9 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(request))}">${_('Example Queries')}</p>
17
18 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
19 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
18 20
19 21 <%include file="/admin/admin_log_base.mako" />
20 22
@@ -7,19 +7,20 b''
7 7 %endif
8 8 </%def>
9 9
10 <%def name="breadcrumbs()">
11 <h1 class="block-left">
10 <%def name="breadcrumbs_links()">
12 11 ${h.form(None, id_="filter_form", method="get")}
13 12 <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term}" placeholder="${_('quick filter...')}"/>
14 <input type='submit' value="${_('Filter')}" class="btn" />
13 <input type='submit' value="${_('filter')}" class="btn" />
15 14 ${_('Journal')} - ${_ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
16 15 ${h.end_form()}
17 </h1>
18 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
16 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
17 <pre id="search-help" style="display: none">${h.tooltip(h.journal_filter_help(request))}</pre>
19 18 </%def>
19
20 20 <%def name="menu_bar_nav()">
21 21 ${self.menu_items(active='journal')}
22 22 </%def>
23
23 24 <%def name="head_extra()">
24 25 <link href="${h.route_path('journal_atom', _query=dict(auth_token=c.rhodecode_user.feed_token))}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
25 26 <link href="${h.route_path('journal_rss', _query=dict(auth_token=c.rhodecode_user.feed_token))}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
@@ -49,7 +50,8 b''
49 50 $(document).on('pjax:success',function(){
50 51 show_more_event();
51 52 });
52 $(document).pjax('#refresh', '#journal',
53 $(document).pjax(
54 '#refresh', '#journal',
53 55 {url: "${request.current_route_path(_query=dict(filter=c.search_term))}", push: false});
54 56
55 57 </script>
General Comments 0
You need to be logged in to leave comments. Login now