##// END OF EJS Templates
pyramid: use explicit c var for globals passed in templates instead of the global 'request'
marcink -
r1922:4edc1a1e default
parent child Browse files
Show More
@@ -1,40 +1,40 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Admin audit logs')}
5 ${_('Admin audit logs')}
6 %if c.rhodecode_name:
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
8 %endif
9 </%def>
9 </%def>
10
10
11 <%def name="breadcrumbs_links()">
11 <%def name="breadcrumbs_links()">
12 ${h.form(None, id_="filter_form", method="get")}
12 ${h.form(None, id_="filter_form", method="get")}
13 <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or ''}" placeholder="${_('filter...')}"/>
13 <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or ''}" placeholder="${_('filter...')}"/>
14 <input type='submit' value="${_('filter')}" class="btn" />
14 <input type='submit' value="${_('filter')}" class="btn" />
15 ${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
15 ${_('Audit logs')} - ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
16 ${h.end_form()}
16 ${h.end_form()}
17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(c.pyramid_request))}">${_('Example Queries')}</p>
18 </%def>
18 </%def>
19
19
20 <%def name="menu_bar_nav()">
20 <%def name="menu_bar_nav()">
21 ${self.menu_items(active='admin')}
21 ${self.menu_items(active='admin')}
22 </%def>
22 </%def>
23 <%def name="main()">
23 <%def name="main()">
24 <div class="box">
24 <div class="box">
25 <!-- box / title -->
25 <!-- box / title -->
26 <div class="title">
26 <div class="title">
27 ${self.breadcrumbs()}
27 ${self.breadcrumbs()}
28 </div>
28 </div>
29 <!-- end box / title -->
29 <!-- end box / title -->
30 <div class="table">
30 <div class="table">
31 <div id="user_log">
31 <div id="user_log">
32 <%include file="/admin/admin_log_base.mako" />
32 <%include file="/admin/admin_log_base.mako" />
33 </div>
33 </div>
34 </div>
34 </div>
35 </div>
35 </div>
36
36
37 <script>
37 <script>
38 $('#j_filter').autoGrowInput();
38 $('#j_filter').autoGrowInput();
39 </script>
39 </script>
40 </%def>
40 </%def>
@@ -1,22 +1,22 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="base" file="/base/base.mako"/>
3
3
4
4
5 <div class="panel panel-default">
5 <div class="panel panel-default">
6 <div class="panel-heading">
6 <div class="panel-heading">
7 <h3 class="panel-title">${_('User Audit Logs')} -
7 <h3 class="panel-title">${_('User Audit Logs')} -
8 ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
8 ${_ungettext('%s entry', '%s entries', c.audit_logs.item_count) % (c.audit_logs.item_count)}
9 </h3>
9 </h3>
10 </div>
10 </div>
11 <div class="panel-body">
11 <div class="panel-body">
12
12
13 ${h.form(None, id_="filter_form", method="get")}
13 ${h.form(None, id_="filter_form", method="get")}
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...')}"/>
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 <input type='submit' value="${_('filter')}" class="btn" />
15 <input type='submit' value="${_('filter')}" class="btn" />
16 ${h.end_form()}
16 ${h.end_form()}
17 <p class="tooltip filterexample" style="position: inherit" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
17 <p class="tooltip filterexample" style="position: inherit" title="${h.tooltip(h.journal_filter_help(c.pyramid_request))}">${_('Example Queries')}</p>
18
18
19 <%include file="/admin/admin_log_base.mako" />
19 <%include file="/admin/admin_log_base.mako" />
20
20
21 </div>
21 </div>
22 </div>
22 </div>
@@ -1,54 +1,54 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3 <%def name="title()">
3 <%def name="title()">
4 ${_('Journal')}
4 ${_('Journal')}
5 %if c.rhodecode_name:
5 %if c.rhodecode_name:
6 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
7 %endif
7 %endif
8 </%def>
8 </%def>
9 <%def name="breadcrumbs()">
9 <%def name="breadcrumbs()">
10 <h1 class="block-left">
10 <h1 class="block-left">
11 ${h.form(None, id_="filter_form", method="get")}
11 ${h.form(None, id_="filter_form", method="get")}
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...')}"/>
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...')}"/>
13 <input type='submit' value="${_('Filter')}" class="btn" />
13 <input type='submit' value="${_('Filter')}" class="btn" />
14 ${_('Journal')} - ${ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
14 ${_('Journal')} - ${ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
15 ${h.end_form()}
15 ${h.end_form()}
16 </h1>
16 </h1>
17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(request))}">${_('Example Queries')}</p>
17 <p class="tooltip filterexample" title="${h.tooltip(h.journal_filter_help(c.pyramid_request))}">${_('Example Queries')}</p>
18 </%def>
18 </%def>
19 <%def name="menu_bar_nav()">
19 <%def name="menu_bar_nav()">
20 ${self.menu_items(active='journal')}
20 ${self.menu_items(active='journal')}
21 </%def>
21 </%def>
22 <%def name="head_extra()">
22 <%def name="head_extra()">
23 <link href="${h.url('journal_atom', auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
23 <link href="${h.url('journal_atom', auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
24 <link href="${h.url('journal_rss', auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
24 <link href="${h.url('journal_rss', auth_token=c.rhodecode_user.feed_token)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
25 </%def>
25 </%def>
26 <%def name="main()">
26 <%def name="main()">
27
27
28 <div class="box">
28 <div class="box">
29 <!-- box / title -->
29 <!-- box / title -->
30 <div class="title journal">
30 <div class="title journal">
31 ${self.breadcrumbs()}
31 ${self.breadcrumbs()}
32 <ul class="links icon-only-links block-right">
32 <ul class="links icon-only-links block-right">
33 <li>
33 <li>
34 <span><a id="refresh" href="${h.url('journal')}"><i class="icon-refresh"></i></a></span>
34 <span><a id="refresh" href="${h.url('journal')}"><i class="icon-refresh"></i></a></span>
35 </li>
35 </li>
36 <li>
36 <li>
37 <span><a href="${h.url('journal_atom', auth_token=c.rhodecode_user.feed_token)}"><i class="icon-rss-sign"></i></a></span>
37 <span><a href="${h.url('journal_atom', auth_token=c.rhodecode_user.feed_token)}"><i class="icon-rss-sign"></i></a></span>
38 </li>
38 </li>
39 </ul>
39 </ul>
40 </div>
40 </div>
41 <div id="journal">${c.journal_data}</div>
41 <div id="journal">${c.journal_data}</div>
42 </div>
42 </div>
43
43
44 <script type="text/javascript">
44 <script type="text/javascript">
45
45
46 $('#j_filter').autoGrowInput();
46 $('#j_filter').autoGrowInput();
47 $(document).on('pjax:success',function(){
47 $(document).on('pjax:success',function(){
48 show_more_event();
48 show_more_event();
49 });
49 });
50 $(document).pjax('#refresh', '#journal',
50 $(document).pjax('#refresh', '#journal',
51 {url: "${h.url.current(filter=c.search_term)}", push: false});
51 {url: "${h.url.current(filter=c.search_term)}", push: false});
52
52
53 </script>
53 </script>
54 </%def>
54 </%def>
@@ -1,108 +1,108 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 %if c.repo_name:
5 %if c.repo_name:
6 ${_('Search inside repository %(repo_name)s') % {'repo_name': c.repo_name}}
6 ${_('Search inside repository %(repo_name)s') % {'repo_name': c.repo_name}}
7 %else:
7 %else:
8 ${_('Search inside all accessible repositories')}
8 ${_('Search inside all accessible repositories')}
9 %endif
9 %endif
10 %if c.rhodecode_name:
10 %if c.rhodecode_name:
11 &middot; ${h.branding(c.rhodecode_name)}
11 &middot; ${h.branding(c.rhodecode_name)}
12 %endif
12 %endif
13 </%def>
13 </%def>
14
14
15 <%def name="breadcrumbs_links()">
15 <%def name="breadcrumbs_links()">
16 %if c.repo_name:
16 %if c.repo_name:
17 ${_('Search inside repository %(repo_name)s') % {'repo_name': c.repo_name}}
17 ${_('Search inside repository %(repo_name)s') % {'repo_name': c.repo_name}}
18 %else:
18 %else:
19 ${_('Search inside all accessible repositories')}
19 ${_('Search inside all accessible repositories')}
20 %endif
20 %endif
21 %if c.cur_query:
21 %if c.cur_query:
22 &raquo;
22 &raquo;
23 ${c.cur_query}
23 ${c.cur_query}
24 %endif
24 %endif
25 </%def>
25 </%def>
26
26
27 <%def name="menu_bar_nav()">
27 <%def name="menu_bar_nav()">
28 %if c.repo_name:
28 %if c.repo_name:
29 ${self.menu_items(active='repositories')}
29 ${self.menu_items(active='repositories')}
30 %else:
30 %else:
31 ${self.menu_items(active='search')}
31 ${self.menu_items(active='search')}
32 %endif
32 %endif
33 </%def>
33 </%def>
34
34
35 <%def name="menu_bar_subnav()">
35 <%def name="menu_bar_subnav()">
36 %if c.repo_name:
36 %if c.repo_name:
37 ${self.repo_menu(active='options')}
37 ${self.repo_menu(active='options')}
38 %endif
38 %endif
39 </%def>
39 </%def>
40
40
41 <%def name="main()">
41 <%def name="main()">
42 <div class="box">
42 <div class="box">
43 %if c.repo_name:
43 %if c.repo_name:
44 <!-- box / title -->
44 <!-- box / title -->
45 <div class="title">
45 <div class="title">
46 ${self.repo_page_title(c.rhodecode_db_repo)}
46 ${self.repo_page_title(c.rhodecode_db_repo)}
47 </div>
47 </div>
48 ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')}
48 ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')}
49 %else:
49 %else:
50 <!-- box / title -->
50 <!-- box / title -->
51 <div class="title">
51 <div class="title">
52 ${self.breadcrumbs()}
52 ${self.breadcrumbs()}
53 <ul class="links">&nbsp;</ul>
53 <ul class="links">&nbsp;</ul>
54 </div>
54 </div>
55 <!-- end box / title -->
55 <!-- end box / title -->
56 ${h.form(h.route_path('search'), method='get')}
56 ${h.form(h.route_path('search'), method='get')}
57 %endif
57 %endif
58 <div class="form search-form">
58 <div class="form search-form">
59 <div class="fields">
59 <div class="fields">
60 <label for="q">${_('Search item')}:</label>
60 <label for="q">${_('Search item')}:</label>
61 ${h.text('q', c.cur_query)}
61 ${h.text('q', c.cur_query)}
62
62
63 ${h.select('type',c.search_type,[('content',_('File contents')), ('commit',_('Commit messages')), ('path',_('File names')),],id='id_search_type')}
63 ${h.select('type',c.search_type,[('content',_('File contents')), ('commit',_('Commit messages')), ('path',_('File names')),],id='id_search_type')}
64 <input type="submit" value="${_('Search')}" class="btn"/>
64 <input type="submit" value="${_('Search')}" class="btn"/>
65 <br/>
65 <br/>
66
66
67 <div class="search-feedback-items">
67 <div class="search-feedback-items">
68 % for error in c.errors:
68 % for error in c.errors:
69 <span class="error-message">
69 <span class="error-message">
70 % for k,v in error.asdict().items():
70 % for k,v in error.asdict().items():
71 ${k} - ${v}
71 ${k} - ${v}
72 % endfor
72 % endfor
73 </span>
73 </span>
74 % endfor
74 % endfor
75 <div class="field">
75 <div class="field">
76 <p class="filterexample" style="position: inherit" onclick="$('#search-help').toggle()">${_('Example Queries')}</p>
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, request))}</pre>
77 <pre id="search-help" style="display: none">${h.tooltip(h.search_filter_help(c.searcher, c.pyramid_request))}</pre>
78 </div>
78 </div>
79
79
80 <div class="field">${c.runtime}</div>
80 <div class="field">${c.runtime}</div>
81 </div>
81 </div>
82 </div>
82 </div>
83 </div>
83 </div>
84
84
85 ${h.end_form()}
85 ${h.end_form()}
86 <div class="search">
86 <div class="search">
87 % if c.search_type == 'content':
87 % if c.search_type == 'content':
88 <%include file='search_content.mako'/>
88 <%include file='search_content.mako'/>
89 % elif c.search_type == 'path':
89 % elif c.search_type == 'path':
90 <%include file='search_path.mako'/>
90 <%include file='search_path.mako'/>
91 % elif c.search_type == 'commit':
91 % elif c.search_type == 'commit':
92 <%include file='search_commit.mako'/>
92 <%include file='search_commit.mako'/>
93 % elif c.search_type == 'repository':
93 % elif c.search_type == 'repository':
94 <%include file='search_repository.mako'/>
94 <%include file='search_repository.mako'/>
95 % endif
95 % endif
96 </div>
96 </div>
97 </div>
97 </div>
98 <script>
98 <script>
99 $(document).ready(function(){
99 $(document).ready(function(){
100 $("#id_search_type").select2({
100 $("#id_search_type").select2({
101 'containerCssClass': "drop-menu",
101 'containerCssClass': "drop-menu",
102 'dropdownCssClass': "drop-menu-dropdown",
102 'dropdownCssClass': "drop-menu-dropdown",
103 'dropdownAutoWidth': true,
103 'dropdownAutoWidth': true,
104 'minimumResultsForSearch': -1
104 'minimumResultsForSearch': -1
105 });
105 });
106 })
106 })
107 </script>
107 </script>
108 </%def>
108 </%def>
General Comments 0
You need to be logged in to leave comments. Login now