# HG changeset patch # User Marcin Kuzminski # Date 2018-06-18 21:28:06 # Node ID f77aceafe42d2aca6e75f30e92532d2917c53330 # Parent 5a43c6a792ca73ec46f345858ff92f85b12bba06 audit-logs: improve help text, and expose all audit commands for easier filtering +ui fixes diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -29,6 +29,7 @@ import os import random import hashlib import StringIO +import textwrap import urllib import math import logging @@ -1864,6 +1865,8 @@ def get_permission_name(key): def journal_filter_help(request): _ = request.translate + from rhodecode.lib.audit_logger import ACTIONS + actions = '\n'.join(textwrap.wrap(', '.join(sorted(ACTIONS.keys())), 80)) return _( 'Example filter terms:\n' + @@ -1875,6 +1878,8 @@ def journal_filter_help(request): ' date:20120101\n' + ' date:[20120101100000 TO 20120102]\n' + '\n' + + 'Actions: {actions}\n' + + '\n' + 'Generate wildcards using \'*\' character:\n' + ' "repository:vcs*" - search everything starting with \'vcs\'\n' + ' "repository:*vcs*" - search for repository containing \'vcs\'\n' + @@ -1882,7 +1887,7 @@ def journal_filter_help(request): 'Optional AND / OR operators in queries\n' + ' "repository:vcs OR repository:test"\n' + ' "username:test AND repository:test*"\n' - ) + ).format(actions=actions) def search_filter_help(searcher, request): diff --git a/rhodecode/templates/admin/admin_audit_logs.mako b/rhodecode/templates/admin/admin_audit_logs.mako --- a/rhodecode/templates/admin/admin_audit_logs.mako +++ b/rhodecode/templates/admin/admin_audit_logs.mako @@ -14,12 +14,14 @@ ${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)} ${h.end_form()} -

${_('Example Queries')}

+

${_('Example Queries')}

+ <%def name="menu_bar_nav()"> ${self.menu_items(active='admin')} + <%def name="main()">
diff --git a/rhodecode/templates/admin/repos/repo_edit_audit.mako b/rhodecode/templates/admin/repos/repo_edit_audit.mako --- a/rhodecode/templates/admin/repos/repo_edit_audit.mako +++ b/rhodecode/templates/admin/repos/repo_edit_audit.mako @@ -14,7 +14,9 @@ ${h.end_form()} -

${_('Example Queries')}

+ +

${_('Example Queries')}

+ <%include file="/admin/admin_log_base.mako" /> diff --git a/rhodecode/templates/admin/users/user_edit_audit.mako b/rhodecode/templates/admin/users/user_edit_audit.mako --- a/rhodecode/templates/admin/users/user_edit_audit.mako +++ b/rhodecode/templates/admin/users/user_edit_audit.mako @@ -14,7 +14,9 @@ ${h.end_form()} -

${_('Example Queries')}

+ +

${_('Example Queries')}

+ <%include file="/admin/admin_log_base.mako" /> diff --git a/rhodecode/templates/journal/journal.mako b/rhodecode/templates/journal/journal.mako --- a/rhodecode/templates/journal/journal.mako +++ b/rhodecode/templates/journal/journal.mako @@ -7,19 +7,20 @@ %endif -<%def name="breadcrumbs()"> -

+<%def name="breadcrumbs_links()"> ${h.form(None, id_="filter_form", method="get")} - + ${_('Journal')} - ${_ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)} ${h.end_form()} -

-

${_('Example Queries')}

+

${_('Example Queries')}

+ + <%def name="menu_bar_nav()"> ${self.menu_items(active='journal')} + <%def name="head_extra()"> @@ -27,30 +28,31 @@ <%def name="main()"> -
- -
- ${self.breadcrumbs()} - -
-
${c.journal_data|n}
+
+ +
+ ${self.breadcrumbs()} +
+
${c.journal_data|n}
+
- +