Show More
@@ -1,150 +1,150 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | %if c.show_private: |
|
5 | %if c.show_private: | |
6 | ${_('Private Gists for user %s') % c.rhodecode_user.username} |
|
6 | ${_('Private Gists for user %s') % c.rhodecode_user.username} | |
7 | %elif c.show_public: |
|
7 | %elif c.show_public: | |
8 | ${_('Public Gists for user %s') % c.rhodecode_user.username} |
|
8 | ${_('Public Gists for user %s') % c.rhodecode_user.username} | |
9 | %else: |
|
9 | %else: | |
10 | ${_('Public Gists')} |
|
10 | ${_('Public Gists')} | |
11 | %endif |
|
11 | %endif | |
12 | %if c.rhodecode_name: |
|
12 | %if c.rhodecode_name: | |
13 | · ${h.branding(c.rhodecode_name)} |
|
13 | · ${h.branding(c.rhodecode_name)} | |
14 | %endif |
|
14 | %endif | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="breadcrumbs_links()"> |
|
17 | <%def name="breadcrumbs_links()"> | |
18 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
18 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
19 | %if c.show_private and not c.show_public: |
|
19 | %if c.show_private and not c.show_public: | |
20 | ${_('Private Gists for user %s') % c.rhodecode_user.username} |
|
20 | ${_('Private Gists for user %s') % c.rhodecode_user.username} | |
21 | %elif c.show_public and not c.show_private: |
|
21 | %elif c.show_public and not c.show_private: | |
22 | ${_('Public Gists for user %s') % c.rhodecode_user.username} |
|
22 | ${_('Public Gists for user %s') % c.rhodecode_user.username} | |
23 | %elif c.show_public and c.show_private: |
|
23 | %elif c.show_public and c.show_private: | |
24 | ${_('All Gists for user %s') % c.rhodecode_user.username} |
|
24 | ${_('All Gists for user %s') % c.rhodecode_user.username} | |
25 | %else: |
|
25 | %else: | |
26 | ${_('All Public Gists')} |
|
26 | ${_('All Public Gists')} | |
27 | %endif |
|
27 | %endif | |
28 | - <span id="gists_count">0</span> |
|
28 | - <span id="gists_count">0</span> | |
29 | </%def> |
|
29 | </%def> | |
30 |
|
30 | |||
31 | <%def name="menu_bar_nav()"> |
|
31 | <%def name="menu_bar_nav()"> | |
32 | ${self.menu_items(active='gists')} |
|
32 | ${self.menu_items(active='gists')} | |
33 | </%def> |
|
33 | </%def> | |
34 |
|
34 | |||
35 |
|
35 | |||
36 |
|
36 | |||
37 | <%def name="main()"> |
|
37 | <%def name="main()"> | |
38 | <div class="box"> |
|
38 | <div class="box"> | |
39 | <div class="title"> |
|
39 | <div class="title"> | |
40 | ${self.breadcrumbs(class_="breadcrumbs block-left")} |
|
40 | ${self.breadcrumbs(class_="breadcrumbs block-left")} | |
41 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
41 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
42 | <ul class="links block-right"> |
|
42 | <ul class="links block-right"> | |
43 | <li> |
|
43 | <li> | |
44 | <a href="${h.url('new_gist')}" class="btn btn-primary">${_(u'Create New Gist')}</a> |
|
44 | <a href="${h.url('new_gist')}" class="btn btn-primary">${_(u'Create New Gist')}</a> | |
45 | </li> |
|
45 | </li> | |
46 | </ul> |
|
46 | </ul> | |
47 | %endif |
|
47 | %endif | |
48 | </div> |
|
48 | </div> | |
49 |
|
49 | |||
50 |
|
50 | |||
51 | <div class="sidebar-col-wrapper scw-small"> |
|
51 | <div class="sidebar-col-wrapper scw-small"> | |
52 | ##main |
|
52 | ##main | |
53 | <div class="sidebar"> |
|
53 | <div class="sidebar"> | |
54 | <ul class="nav nav-pills nav-stacked"> |
|
54 | <ul class="nav nav-pills nav-stacked"> | |
55 | % if h.HasPermissionAll('hg.admin')('access admin gists page'): |
|
55 | % if h.HasPermissionAll('hg.admin')('access admin gists page'): | |
56 | <li class="${'active' if c.active=='all' else ''}"><a href="${h.url('gists', all=1)}">${_('All gists')}</a></li> |
|
56 | <li class="${'active' if c.active=='all' else ''}"><a href="${h.url('gists', all=1)}">${_('All gists')}</a></li> | |
57 | %endif |
|
57 | %endif | |
58 | <li class="${'active' if c.active=='public' else ''}"><a href="${h.url('gists')}">${_('All public')}</a></li> |
|
58 | <li class="${'active' if c.active=='public' else ''}"><a href="${h.url('gists')}">${_('All public')}</a></li> | |
59 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
59 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
60 | <li class="${'active' if c.active=='my_all' else ''}"><a href="${h.url('gists', public=1, private=1)}">${_('My gists')}</a></li> |
|
60 | <li class="${'active' if c.active=='my_all' else ''}"><a href="${h.url('gists', public=1, private=1)}">${_('My gists')}</a></li> | |
61 | <li class="${'active' if c.active=='my_private' else ''}"><a href="${h.url('gists', private=1)}">${_('My private')}</a></li> |
|
61 | <li class="${'active' if c.active=='my_private' else ''}"><a href="${h.url('gists', private=1)}">${_('My private')}</a></li> | |
62 | <li class="${'active' if c.active=='my_public' else ''}"><a href="${h.url('gists', public=1)}">${_('My public')}</a></li> |
|
62 | <li class="${'active' if c.active=='my_public' else ''}"><a href="${h.url('gists', public=1)}">${_('My public')}</a></li> | |
63 | %endif |
|
63 | %endif | |
64 | </ul> |
|
64 | </ul> | |
65 | </div> |
|
65 | </div> | |
66 |
|
66 | |||
67 | <div class="main-content"> |
|
67 | <div class="main-content"> | |
68 | <div id="repos_list_wrap"> |
|
68 | <div id="repos_list_wrap"> | |
69 | <table id="gist_list_table" class="display"></table> |
|
69 | <table id="gist_list_table" class="display"></table> | |
70 | </div> |
|
70 | </div> | |
71 | </div> |
|
71 | </div> | |
72 | </div> |
|
72 | </div> | |
73 | </div> |
|
73 | </div> | |
74 | <script> |
|
74 | <script> | |
75 | $(document).ready(function() { |
|
75 | $(document).ready(function() { | |
76 |
|
76 | |||
77 | var get_datatable_count = function(){ |
|
77 | var get_datatable_count = function(){ | |
78 | var api = $('#gist_list_table').dataTable().api(); |
|
78 | var api = $('#gist_list_table').dataTable().api(); | |
79 | $('#gists_count').text(api.page.info().recordsDisplay); |
|
79 | $('#gists_count').text(api.page.info().recordsDisplay); | |
80 | }; |
|
80 | }; | |
81 |
|
81 | |||
82 |
|
82 | |||
83 | // custom filter that filters by access_id, description or author |
|
83 | // custom filter that filters by access_id, description or author | |
84 | $.fn.dataTable.ext.search.push( |
|
84 | $.fn.dataTable.ext.search.push( | |
85 | function( settings, data, dataIndex ) { |
|
85 | function( settings, data, dataIndex ) { | |
86 | var query = $('#q_filter').val(); |
|
86 | var query = $('#q_filter').val(); | |
87 | var author = data[0].strip(); |
|
87 | var author = data[0].strip(); | |
88 | var access_id = data[2].strip(); |
|
88 | var access_id = data[2].strip(); | |
89 | var description = data[3].strip(); |
|
89 | var description = data[3].strip(); | |
90 |
|
90 | |||
91 | var query_str = (access_id + " " + author + " " + description).toLowerCase(); |
|
91 | var query_str = (access_id + " " + author + " " + description).toLowerCase(); | |
92 |
|
92 | |||
93 | if(query_str.indexOf(query.toLowerCase()) !== -1){ |
|
93 | if(query_str.indexOf(query.toLowerCase()) !== -1){ | |
94 | return true; |
|
94 | return true; | |
95 | } |
|
95 | } | |
96 | return false; |
|
96 | return false; | |
97 | } |
|
97 | } | |
98 | ); |
|
98 | ); | |
99 |
|
99 | |||
100 | // gists list |
|
100 | // gists list | |
101 | $('#gist_list_table').DataTable({ |
|
101 | $('#gist_list_table').DataTable({ | |
102 | data: ${c.data|n}, |
|
102 | data: ${c.data|n}, | |
103 | dom: 'rtp', |
|
103 | dom: 'rtp', | |
104 | pageLength: ${c.visual.dashboard_items}, |
|
104 | pageLength: ${c.visual.dashboard_items}, | |
105 | order: [[ 4, "desc" ]], |
|
105 | order: [[ 4, "desc" ]], | |
106 | columns: [ |
|
106 | columns: [ | |
107 | { data: {"_": "author", |
|
107 | { data: {"_": "author", | |
108 | "sort": "author_raw"}, title: "${_("Author")}", width: "250px", className: "td-user" }, |
|
108 | "sort": "author_raw"}, title: "${_("Author")}", width: "250px", className: "td-user" }, | |
109 | { data: {"_": "type", |
|
109 | { data: {"_": "type", | |
110 | "sort": "type"}, title: "${_("Type")}", width: "70px", className: "td-tags" }, |
|
110 | "sort": "type"}, title: "${_("Type")}", width: "70px", className: "td-tags" }, | |
111 | { data: {"_": "access_id", |
|
111 | { data: {"_": "access_id", | |
112 | "sort": "access_id"}, title: "${_("Name")}", width:"150px", className: "td-componentname" }, |
|
112 | "sort": "access_id"}, title: "${_("Name")}", width:"150px", className: "td-componentname" }, | |
113 | { data: {"_": "description", |
|
113 | { data: {"_": "description", | |
114 | "sort": "description"}, title: "${_("Description")}", width: "250px", className: "td-description" }, |
|
114 | "sort": "description"}, title: "${_("Description")}", width: "250px", className: "td-description" }, | |
115 | { data: {"_": "created_on", |
|
115 | { data: {"_": "created_on", | |
116 | "sort": "created_on_raw"}, title: "${_("Created on")}", className: "td-time" }, |
|
116 | "sort": "created_on_raw"}, title: "${_("Created on")}", className: "td-time" }, | |
117 | { data: {"_": "expires", |
|
117 | { data: {"_": "expires", | |
118 | "sort": "expires"}, title: "${_("Expires")}", className: "td-exp" } |
|
118 | "sort": "expires"}, title: "${_("Expires")}", className: "td-exp" } | |
119 | ], |
|
119 | ], | |
120 | language: { |
|
120 | language: { | |
121 | paginate: DEFAULT_GRID_PAGINATION, |
|
121 | paginate: DEFAULT_GRID_PAGINATION, | |
122 | emptyTable: "No gists available yet." |
|
122 | emptyTable: _gettext("No gists available yet.") | |
123 | }, |
|
123 | }, | |
124 | "initComplete": function( settings, json ) { |
|
124 | "initComplete": function( settings, json ) { | |
125 | timeagoActivate(); |
|
125 | timeagoActivate(); | |
126 | get_datatable_count(); |
|
126 | get_datatable_count(); | |
127 | } |
|
127 | } | |
128 | }); |
|
128 | }); | |
129 |
|
129 | |||
130 | // update the counter when things change |
|
130 | // update the counter when things change | |
131 | $('#gist_list_table').on('draw.dt', function() { |
|
131 | $('#gist_list_table').on('draw.dt', function() { | |
132 | timeagoActivate(); |
|
132 | timeagoActivate(); | |
133 | get_datatable_count(); |
|
133 | get_datatable_count(); | |
134 | }); |
|
134 | }); | |
135 |
|
135 | |||
136 | // filter, filter both grids |
|
136 | // filter, filter both grids | |
137 | $('#q_filter').on( 'keyup', function () { |
|
137 | $('#q_filter').on( 'keyup', function () { | |
138 | var repo_api = $('#gist_list_table').dataTable().api(); |
|
138 | var repo_api = $('#gist_list_table').dataTable().api(); | |
139 | repo_api |
|
139 | repo_api | |
140 | .draw(); |
|
140 | .draw(); | |
141 | }); |
|
141 | }); | |
142 |
|
142 | |||
143 | // refilter table if page load via back button |
|
143 | // refilter table if page load via back button | |
144 | $("#q_filter").trigger('keyup'); |
|
144 | $("#q_filter").trigger('keyup'); | |
145 |
|
145 | |||
146 | }); |
|
146 | }); | |
147 |
|
147 | |||
148 | </script> |
|
148 | </script> | |
149 | </%def> |
|
149 | </%def> | |
150 |
|
150 |
@@ -1,68 +1,68 b'' | |||||
1 | <div class="panel panel-default"> |
|
1 | <div class="panel panel-default"> | |
2 | <div class="panel-heading"> |
|
2 | <div class="panel-heading"> | |
3 | <h3 class="panel-title">${_('Repositories You Own')}</h3> |
|
3 | <h3 class="panel-title">${_('Repositories You Own')}</h3> | |
4 | </div> |
|
4 | </div> | |
5 |
|
5 | |||
6 | <div class="panel-body"> |
|
6 | <div class="panel-body"> | |
7 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
7 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
8 |
|
8 | |||
9 | <div id="repos_list_wrap"> |
|
9 | <div id="repos_list_wrap"> | |
10 | <table id="repo_list_table" class="display"></table> |
|
10 | <table id="repo_list_table" class="display"></table> | |
11 | </div> |
|
11 | </div> | |
12 | </div> |
|
12 | </div> | |
13 | </div> |
|
13 | </div> | |
14 |
|
14 | |||
15 | <script> |
|
15 | <script> | |
16 | $(document).ready(function() { |
|
16 | $(document).ready(function() { | |
17 |
|
17 | |||
18 | var get_datatable_count = function(){ |
|
18 | var get_datatable_count = function(){ | |
19 | var api = $('#repo_list_table').dataTable().api(); |
|
19 | var api = $('#repo_list_table').dataTable().api(); | |
20 | $('#repo_count').text(api.page.info().recordsDisplay); |
|
20 | $('#repo_count').text(api.page.info().recordsDisplay); | |
21 | }; |
|
21 | }; | |
22 |
|
22 | |||
23 | // repo list |
|
23 | // repo list | |
24 | $('#repo_list_table').DataTable({ |
|
24 | $('#repo_list_table').DataTable({ | |
25 | data: ${c.data|n}, |
|
25 | data: ${c.data|n}, | |
26 | dom: 'rtp', |
|
26 | dom: 'rtp', | |
27 | pageLength: ${c.visual.admin_grid_items}, |
|
27 | pageLength: ${c.visual.admin_grid_items}, | |
28 | order: [[ 0, "asc" ]], |
|
28 | order: [[ 0, "asc" ]], | |
29 | columns: [ |
|
29 | columns: [ | |
30 | { data: {"_": "name", |
|
30 | { data: {"_": "name", | |
31 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, |
|
31 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, | |
32 | { data: 'menu', className: "quick_repo_menu" }, |
|
32 | { data: 'menu', className: "quick_repo_menu" }, | |
33 | { data: {"_": "last_changeset", |
|
33 | { data: {"_": "last_changeset", | |
34 | "sort": "last_changeset_raw", |
|
34 | "sort": "last_changeset_raw", | |
35 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, |
|
35 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, | |
36 | { data: {"_": "action", |
|
36 | { data: {"_": "action", | |
37 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } |
|
37 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } | |
38 | ], |
|
38 | ], | |
39 | language: { |
|
39 | language: { | |
40 | paginate: DEFAULT_GRID_PAGINATION, |
|
40 | paginate: DEFAULT_GRID_PAGINATION, | |
41 | emptyTable: "No repositories available yet." |
|
41 | emptyTable: _gettext("No repositories available yet.") | |
42 | }, |
|
42 | }, | |
43 | "initComplete": function( settings, json ) { |
|
43 | "initComplete": function( settings, json ) { | |
44 | get_datatable_count(); |
|
44 | get_datatable_count(); | |
45 | quick_repo_menu(); |
|
45 | quick_repo_menu(); | |
46 | } |
|
46 | } | |
47 | }); |
|
47 | }); | |
48 |
|
48 | |||
49 | // update the counter when doing search |
|
49 | // update the counter when doing search | |
50 | $('#repo_list_table').on( 'search.dt', function (e,settings) { |
|
50 | $('#repo_list_table').on( 'search.dt', function (e,settings) { | |
51 | get_datatable_count(); |
|
51 | get_datatable_count(); | |
52 | }); |
|
52 | }); | |
53 |
|
53 | |||
54 | // filter, filter both grids |
|
54 | // filter, filter both grids | |
55 | $('#q_filter').on( 'keyup', function () { |
|
55 | $('#q_filter').on( 'keyup', function () { | |
56 | var repo_api = $('#repo_list_table').dataTable().api(); |
|
56 | var repo_api = $('#repo_list_table').dataTable().api(); | |
57 | repo_api |
|
57 | repo_api | |
58 | .columns(0) |
|
58 | .columns(0) | |
59 | .search(this.value) |
|
59 | .search(this.value) | |
60 | .draw(); |
|
60 | .draw(); | |
61 | }); |
|
61 | }); | |
62 |
|
62 | |||
63 | // refilter table if page load via back button |
|
63 | // refilter table if page load via back button | |
64 | $("#q_filter").trigger('keyup'); |
|
64 | $("#q_filter").trigger('keyup'); | |
65 |
|
65 | |||
66 | }); |
|
66 | }); | |
67 |
|
67 | |||
68 | </script> |
|
68 | </script> |
@@ -1,66 +1,66 b'' | |||||
1 | <div class="panel panel-default"> |
|
1 | <div class="panel panel-default"> | |
2 | <div class="panel-heading"> |
|
2 | <div class="panel-heading"> | |
3 | <h3 class="panel-title">${_('Your Watched Repositories')}</h3> |
|
3 | <h3 class="panel-title">${_('Your Watched Repositories')}</h3> | |
4 | </div> |
|
4 | </div> | |
5 |
|
5 | |||
6 | <div class="panel-body"> |
|
6 | <div class="panel-body"> | |
7 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
7 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
8 |
|
8 | |||
9 | <div id="repos_list_wrap"> |
|
9 | <div id="repos_list_wrap"> | |
10 | <table id="repo_list_table" class="display"></table> |
|
10 | <table id="repo_list_table" class="display"></table> | |
11 | </div> |
|
11 | </div> | |
12 | </div> |
|
12 | </div> | |
13 | </div> |
|
13 | </div> | |
14 |
|
14 | |||
15 | <script> |
|
15 | <script> | |
16 | $(document).ready(function() { |
|
16 | $(document).ready(function() { | |
17 |
|
17 | |||
18 | var get_datatable_count = function(){ |
|
18 | var get_datatable_count = function(){ | |
19 | var api = $('#repo_list_table').dataTable().api(); |
|
19 | var api = $('#repo_list_table').dataTable().api(); | |
20 | $('#repo_count').text(api.page.info().recordsDisplay); |
|
20 | $('#repo_count').text(api.page.info().recordsDisplay); | |
21 | }; |
|
21 | }; | |
22 |
|
22 | |||
23 | // repo list |
|
23 | // repo list | |
24 | $('#repo_list_table').DataTable({ |
|
24 | $('#repo_list_table').DataTable({ | |
25 | data: ${c.data|n}, |
|
25 | data: ${c.data|n}, | |
26 | dom: 'rtp', |
|
26 | dom: 'rtp', | |
27 | pageLength: ${c.visual.admin_grid_items}, |
|
27 | pageLength: ${c.visual.admin_grid_items}, | |
28 | order: [[ 0, "asc" ]], |
|
28 | order: [[ 0, "asc" ]], | |
29 | columns: [ |
|
29 | columns: [ | |
30 | { data: {"_": "name", |
|
30 | { data: {"_": "name", | |
31 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, |
|
31 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, | |
32 | { data: 'menu', className: "quick_repo_menu" }, |
|
32 | { data: 'menu', className: "quick_repo_menu" }, | |
33 | { data: {"_": "last_changeset", |
|
33 | { data: {"_": "last_changeset", | |
34 | "sort": "last_changeset_raw", |
|
34 | "sort": "last_changeset_raw", | |
35 | "type": Number}, title: "${_('Commit')}", className: "td-hash" } |
|
35 | "type": Number}, title: "${_('Commit')}", className: "td-hash" } | |
36 | ], |
|
36 | ], | |
37 | language: { |
|
37 | language: { | |
38 | paginate: DEFAULT_GRID_PAGINATION, |
|
38 | paginate: DEFAULT_GRID_PAGINATION, | |
39 | emptyTable: "No repositories available yet." |
|
39 | emptyTable: _gettext("No repositories available yet.") | |
40 | }, |
|
40 | }, | |
41 | "initComplete": function( settings, json ) { |
|
41 | "initComplete": function( settings, json ) { | |
42 | get_datatable_count(); |
|
42 | get_datatable_count(); | |
43 | quick_repo_menu(); |
|
43 | quick_repo_menu(); | |
44 | } |
|
44 | } | |
45 | }); |
|
45 | }); | |
46 |
|
46 | |||
47 | // update the counter when doing search |
|
47 | // update the counter when doing search | |
48 | $('#repo_list_table').on( 'search.dt', function (e,settings) { |
|
48 | $('#repo_list_table').on( 'search.dt', function (e,settings) { | |
49 | get_datatable_count(); |
|
49 | get_datatable_count(); | |
50 | }); |
|
50 | }); | |
51 |
|
51 | |||
52 | // filter, filter both grids |
|
52 | // filter, filter both grids | |
53 | $('#q_filter').on( 'keyup', function () { |
|
53 | $('#q_filter').on( 'keyup', function () { | |
54 | var repo_api = $('#repo_list_table').dataTable().api(); |
|
54 | var repo_api = $('#repo_list_table').dataTable().api(); | |
55 | repo_api |
|
55 | repo_api | |
56 | .columns(0) |
|
56 | .columns(0) | |
57 | .search(this.value) |
|
57 | .search(this.value) | |
58 | .draw(); |
|
58 | .draw(); | |
59 | }); |
|
59 | }); | |
60 |
|
60 | |||
61 | // refilter table if page load via back button |
|
61 | // refilter table if page load via back button | |
62 | $("#q_filter").trigger('keyup'); |
|
62 | $("#q_filter").trigger('keyup'); | |
63 |
|
63 | |||
64 | }); |
|
64 | }); | |
65 |
|
65 | |||
66 | </script> |
|
66 | </script> |
@@ -1,94 +1,94 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Repository groups administration')} |
|
5 | ${_('Repository groups administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${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 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="repo_group_count">0</span> ${_('repository groups')} |
|
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="repo_group_count">0</span> ${_('repository groups')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='admin')} |
|
17 | ${self.menu_items(active='admin')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <div class="title"> |
|
22 | <div class="title"> | |
23 | ${self.breadcrumbs()} |
|
23 | ${self.breadcrumbs()} | |
24 | <ul class="links"> |
|
24 | <ul class="links"> | |
25 | %if h.HasPermissionAny('hg.admin','hg.repogroup.create.true')(): |
|
25 | %if h.HasPermissionAny('hg.admin','hg.repogroup.create.true')(): | |
26 | <li> |
|
26 | <li> | |
27 | <a href="${h.url('new_repo_group')}" class="btn btn-small btn-success">${_(u'Add Repository Group')}</a> |
|
27 | <a href="${h.url('new_repo_group')}" class="btn btn-small btn-success">${_(u'Add Repository Group')}</a> | |
28 | </li> |
|
28 | </li> | |
29 | %endif |
|
29 | %endif | |
30 | </ul> |
|
30 | </ul> | |
31 | </div> |
|
31 | </div> | |
32 | <div id="repos_list_wrap"> |
|
32 | <div id="repos_list_wrap"> | |
33 | <table id="group_list_table" class="display"></table> |
|
33 | <table id="group_list_table" class="display"></table> | |
34 | </div> |
|
34 | </div> | |
35 | </div> |
|
35 | </div> | |
36 |
|
36 | |||
37 | <script> |
|
37 | <script> | |
38 | $(document).ready(function() { |
|
38 | $(document).ready(function() { | |
39 |
|
39 | |||
40 | var get_datatable_count = function(){ |
|
40 | var get_datatable_count = function(){ | |
41 | var api = $('#group_list_table').dataTable().api(); |
|
41 | var api = $('#group_list_table').dataTable().api(); | |
42 | $('#repo_group_count').text(api.page.info().recordsDisplay); |
|
42 | $('#repo_group_count').text(api.page.info().recordsDisplay); | |
43 | }; |
|
43 | }; | |
44 |
|
44 | |||
45 | // repo group list |
|
45 | // repo group list | |
46 | $('#group_list_table').DataTable({ |
|
46 | $('#group_list_table').DataTable({ | |
47 | data: ${c.data|n}, |
|
47 | data: ${c.data|n}, | |
48 | dom: 'rtp', |
|
48 | dom: 'rtp', | |
49 | pageLength: ${c.visual.admin_grid_items}, |
|
49 | pageLength: ${c.visual.admin_grid_items}, | |
50 | order: [[ 0, "asc" ]], |
|
50 | order: [[ 0, "asc" ]], | |
51 | columns: [ |
|
51 | columns: [ | |
52 | { data: {"_": "name", |
|
52 | { data: {"_": "name", | |
53 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, |
|
53 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, | |
54 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, |
|
54 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, | |
55 | { data: {"_": "desc", |
|
55 | { data: {"_": "desc", | |
56 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, |
|
56 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, | |
57 | { data: {"_": "top_level_repos", |
|
57 | { data: {"_": "top_level_repos", | |
58 | "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" }, |
|
58 | "sort": "top_level_repos"}, title: "${_('Number of top level repositories')}" }, | |
59 | { data: {"_": "owner", |
|
59 | { data: {"_": "owner", | |
60 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, |
|
60 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, | |
61 | { data: {"_": "action", |
|
61 | { data: {"_": "action", | |
62 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } |
|
62 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } | |
63 | ], |
|
63 | ], | |
64 | language: { |
|
64 | language: { | |
65 | paginate: DEFAULT_GRID_PAGINATION, |
|
65 | paginate: DEFAULT_GRID_PAGINATION, | |
66 | emptyTable: "No repository groups available yet." |
|
66 | emptyTable: _gettext("No repository groups available yet.") | |
67 | }, |
|
67 | }, | |
68 | "initComplete": function( settings, json ) { |
|
68 | "initComplete": function( settings, json ) { | |
69 | get_datatable_count(); |
|
69 | get_datatable_count(); | |
70 | quick_repo_menu(); |
|
70 | quick_repo_menu(); | |
71 | } |
|
71 | } | |
72 | }); |
|
72 | }); | |
73 |
|
73 | |||
74 | // update the counter when doing search |
|
74 | // update the counter when doing search | |
75 | $('#group_list_table').on( 'search.dt', function (e,settings) { |
|
75 | $('#group_list_table').on( 'search.dt', function (e,settings) { | |
76 | get_datatable_count(); |
|
76 | get_datatable_count(); | |
77 | }); |
|
77 | }); | |
78 |
|
78 | |||
79 | // filter, filter both grids |
|
79 | // filter, filter both grids | |
80 | $('#q_filter').on( 'keyup', function () { |
|
80 | $('#q_filter').on( 'keyup', function () { | |
81 |
|
81 | |||
82 | var repo_group_api = $('#group_list_table').dataTable().api(); |
|
82 | var repo_group_api = $('#group_list_table').dataTable().api(); | |
83 | repo_group_api |
|
83 | repo_group_api | |
84 | .columns(0) |
|
84 | .columns(0) | |
85 | .search(this.value) |
|
85 | .search(this.value) | |
86 | .draw(); |
|
86 | .draw(); | |
87 | }); |
|
87 | }); | |
88 |
|
88 | |||
89 | // refilter table if page load via back button |
|
89 | // refilter table if page load via back button | |
90 | $("#q_filter").trigger('keyup'); |
|
90 | $("#q_filter").trigger('keyup'); | |
91 | }); |
|
91 | }); | |
92 | </script> |
|
92 | </script> | |
93 | </%def> |
|
93 | </%def> | |
94 |
|
94 |
@@ -1,101 +1,101 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Repositories administration')} |
|
5 | ${_('Repositories administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${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 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="repo_count">0</span> ${_('repositories')} |
|
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="repo_count">0</span> ${_('repositories')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='admin')} |
|
17 | ${self.menu_items(active='admin')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <div class="title"> |
|
22 | <div class="title"> | |
23 | ${self.breadcrumbs()} |
|
23 | ${self.breadcrumbs()} | |
24 | <ul class="links"> |
|
24 | <ul class="links"> | |
25 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): |
|
25 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |
26 | <li> |
|
26 | <li> | |
27 | <a href="${h.url('new_repo')}" class="btn btn-small btn-success">${_(u'Add Repository')}</a> |
|
27 | <a href="${h.url('new_repo')}" class="btn btn-small btn-success">${_(u'Add Repository')}</a> | |
28 | </li> |
|
28 | </li> | |
29 | %endif |
|
29 | %endif | |
30 | </ul> |
|
30 | </ul> | |
31 | </div> |
|
31 | </div> | |
32 | <div id="repos_list_wrap"> |
|
32 | <div id="repos_list_wrap"> | |
33 | <table id="repo_list_table" class="display"></table> |
|
33 | <table id="repo_list_table" class="display"></table> | |
34 | </div> |
|
34 | </div> | |
35 | </div> |
|
35 | </div> | |
36 |
|
36 | |||
37 | <script> |
|
37 | <script> | |
38 | $(document).ready(function() { |
|
38 | $(document).ready(function() { | |
39 |
|
39 | |||
40 | var get_datatable_count = function(){ |
|
40 | var get_datatable_count = function(){ | |
41 | var api = $('#repo_list_table').dataTable().api(); |
|
41 | var api = $('#repo_list_table').dataTable().api(); | |
42 | $('#repo_count').text(api.page.info().recordsDisplay); |
|
42 | $('#repo_count').text(api.page.info().recordsDisplay); | |
43 | }; |
|
43 | }; | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | // repo list |
|
46 | // repo list | |
47 | $('#repo_list_table').DataTable({ |
|
47 | $('#repo_list_table').DataTable({ | |
48 | data: ${c.data|n}, |
|
48 | data: ${c.data|n}, | |
49 | dom: 'rtp', |
|
49 | dom: 'rtp', | |
50 | pageLength: ${c.visual.admin_grid_items}, |
|
50 | pageLength: ${c.visual.admin_grid_items}, | |
51 | order: [[ 0, "asc" ]], |
|
51 | order: [[ 0, "asc" ]], | |
52 | columns: [ |
|
52 | columns: [ | |
53 | { data: {"_": "name", |
|
53 | { data: {"_": "name", | |
54 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, |
|
54 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, | |
55 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, |
|
55 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, | |
56 | { data: {"_": "desc", |
|
56 | { data: {"_": "desc", | |
57 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, |
|
57 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, | |
58 | { data: {"_": "last_change", |
|
58 | { data: {"_": "last_change", | |
59 | "sort": "last_change_raw", |
|
59 | "sort": "last_change_raw", | |
60 | "type": Number}, title: "${_('Last Change')}", className: "td-time" }, |
|
60 | "type": Number}, title: "${_('Last Change')}", className: "td-time" }, | |
61 | { data: {"_": "last_changeset", |
|
61 | { data: {"_": "last_changeset", | |
62 | "sort": "last_changeset_raw", |
|
62 | "sort": "last_changeset_raw", | |
63 | "type": Number}, title: "${_('Commit')}", className: "td-commit" }, |
|
63 | "type": Number}, title: "${_('Commit')}", className: "td-commit" }, | |
64 | { data: {"_": "owner", |
|
64 | { data: {"_": "owner", | |
65 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, |
|
65 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, | |
66 | { data: {"_": "state", |
|
66 | { data: {"_": "state", | |
67 | "sort": "state"}, title: "${_('State')}", className: "td-tags td-state" }, |
|
67 | "sort": "state"}, title: "${_('State')}", className: "td-tags td-state" }, | |
68 | { data: {"_": "action", |
|
68 | { data: {"_": "action", | |
69 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } |
|
69 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } | |
70 | ], |
|
70 | ], | |
71 | language: { |
|
71 | language: { | |
72 | paginate: DEFAULT_GRID_PAGINATION, |
|
72 | paginate: DEFAULT_GRID_PAGINATION, | |
73 |
emptyTable: |
|
73 | emptyTable:_gettext("No repositories available yet.") | |
74 | }, |
|
74 | }, | |
75 | "initComplete": function( settings, json ) { |
|
75 | "initComplete": function( settings, json ) { | |
76 | get_datatable_count(); |
|
76 | get_datatable_count(); | |
77 | quick_repo_menu(); |
|
77 | quick_repo_menu(); | |
78 | } |
|
78 | } | |
79 | }); |
|
79 | }); | |
80 |
|
80 | |||
81 | // update the counter when doing search |
|
81 | // update the counter when doing search | |
82 | $('#repo_list_table').on( 'search.dt', function (e,settings) { |
|
82 | $('#repo_list_table').on( 'search.dt', function (e,settings) { | |
83 | get_datatable_count(); |
|
83 | get_datatable_count(); | |
84 | }); |
|
84 | }); | |
85 |
|
85 | |||
86 | // filter, filter both grids |
|
86 | // filter, filter both grids | |
87 | $('#q_filter').on( 'keyup', function () { |
|
87 | $('#q_filter').on( 'keyup', function () { | |
88 | var repo_api = $('#repo_list_table').dataTable().api(); |
|
88 | var repo_api = $('#repo_list_table').dataTable().api(); | |
89 | repo_api |
|
89 | repo_api | |
90 | .columns(0) |
|
90 | .columns(0) | |
91 | .search(this.value) |
|
91 | .search(this.value) | |
92 | .draw(); |
|
92 | .draw(); | |
93 | }); |
|
93 | }); | |
94 |
|
94 | |||
95 | // refilter table if page load via back button |
|
95 | // refilter table if page load via back button | |
96 | $("#q_filter").trigger('keyup'); |
|
96 | $("#q_filter").trigger('keyup'); | |
97 | }); |
|
97 | }); | |
98 |
|
98 | |||
99 | </script> |
|
99 | </script> | |
100 |
|
100 | |||
101 | </%def> |
|
101 | </%def> |
@@ -1,98 +1,98 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('User groups administration')} |
|
5 | ${_('User groups administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${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 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_group_count">0</span> ${_('user groups')} |
|
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_group_count">0</span> ${_('user groups')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='admin')} |
|
17 | ${self.menu_items(active='admin')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 |
|
22 | |||
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | ${self.breadcrumbs()} |
|
24 | ${self.breadcrumbs()} | |
25 | <ul class="links"> |
|
25 | <ul class="links"> | |
26 | %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')(): |
|
26 | %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')(): | |
27 | <li> |
|
27 | <li> | |
28 | <a href="${h.url('new_users_group')}" class="btn btn-small btn-success">${_(u'Add User Group')}</a> |
|
28 | <a href="${h.url('new_users_group')}" class="btn btn-small btn-success">${_(u'Add User Group')}</a> | |
29 | </li> |
|
29 | </li> | |
30 | %endif |
|
30 | %endif | |
31 | </ul> |
|
31 | </ul> | |
32 | </div> |
|
32 | </div> | |
33 |
|
33 | |||
34 | <div id="repos_list_wrap"> |
|
34 | <div id="repos_list_wrap"> | |
35 | <table id="user_group_list_table" class="display"></table> |
|
35 | <table id="user_group_list_table" class="display"></table> | |
36 | </div> |
|
36 | </div> | |
37 |
|
37 | |||
38 | </div> |
|
38 | </div> | |
39 | <script> |
|
39 | <script> | |
40 | $(document).ready(function() { |
|
40 | $(document).ready(function() { | |
41 |
|
41 | |||
42 | var get_datatable_count = function(){ |
|
42 | var get_datatable_count = function(){ | |
43 | var api = $('#user_group_list_table').dataTable().api(); |
|
43 | var api = $('#user_group_list_table').dataTable().api(); | |
44 | $('#user_group_count').text(api.page.info().recordsDisplay); |
|
44 | $('#user_group_count').text(api.page.info().recordsDisplay); | |
45 | }; |
|
45 | }; | |
46 |
|
46 | |||
47 | // user list |
|
47 | // user list | |
48 | $('#user_group_list_table').DataTable({ |
|
48 | $('#user_group_list_table').DataTable({ | |
49 | data: ${c.data|n}, |
|
49 | data: ${c.data|n}, | |
50 | dom: 'rtp', |
|
50 | dom: 'rtp', | |
51 | pageLength: ${c.visual.admin_grid_items}, |
|
51 | pageLength: ${c.visual.admin_grid_items}, | |
52 | order: [[ 0, "asc" ]], |
|
52 | order: [[ 0, "asc" ]], | |
53 | columns: [ |
|
53 | columns: [ | |
54 | { data: {"_": "group_name", |
|
54 | { data: {"_": "group_name", | |
55 | "sort": "group_name_raw"}, title: "${_('Name')}", className: "td-componentname" }, |
|
55 | "sort": "group_name_raw"}, title: "${_('Name')}", className: "td-componentname" }, | |
56 | { data: {"_": "desc", |
|
56 | { data: {"_": "desc", | |
57 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, |
|
57 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, | |
58 | { data: {"_": "members", |
|
58 | { data: {"_": "members", | |
59 | "sort": "members", |
|
59 | "sort": "members", | |
60 | "type": Number}, title: "${_('Members')}", className: "td-number" }, |
|
60 | "type": Number}, title: "${_('Members')}", className: "td-number" }, | |
61 | { data: {"_": "active", |
|
61 | { data: {"_": "active", | |
62 | "sort": "active"}, title: "${_('Active')}", className: "td-active", className: "td-number"}, |
|
62 | "sort": "active"}, title: "${_('Active')}", className: "td-active", className: "td-number"}, | |
63 | { data: {"_": "owner", |
|
63 | { data: {"_": "owner", | |
64 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, |
|
64 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, | |
65 | { data: {"_": "action", |
|
65 | { data: {"_": "action", | |
66 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } |
|
66 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } | |
67 | ], |
|
67 | ], | |
68 | language: { |
|
68 | language: { | |
69 | paginate: DEFAULT_GRID_PAGINATION, |
|
69 | paginate: DEFAULT_GRID_PAGINATION, | |
70 | emptyTable: "No user groups available yet." |
|
70 | emptyTable: _gettext("No user groups available yet.") | |
71 | }, |
|
71 | }, | |
72 | "initComplete": function( settings, json ) { |
|
72 | "initComplete": function( settings, json ) { | |
73 | get_datatable_count(); |
|
73 | get_datatable_count(); | |
74 | } |
|
74 | } | |
75 | }); |
|
75 | }); | |
76 |
|
76 | |||
77 | // update the counter when doing search |
|
77 | // update the counter when doing search | |
78 | $('#user_group_list_table').on( 'search.dt', function (e,settings) { |
|
78 | $('#user_group_list_table').on( 'search.dt', function (e,settings) { | |
79 | get_datatable_count(); |
|
79 | get_datatable_count(); | |
80 | }); |
|
80 | }); | |
81 |
|
81 | |||
82 | // filter, filter both grids |
|
82 | // filter, filter both grids | |
83 | $('#q_filter').on( 'keyup', function () { |
|
83 | $('#q_filter').on( 'keyup', function () { | |
84 | var user_api = $('#user_group_list_table').dataTable().api(); |
|
84 | var user_api = $('#user_group_list_table').dataTable().api(); | |
85 | user_api |
|
85 | user_api | |
86 | .columns(0) |
|
86 | .columns(0) | |
87 | .search(this.value) |
|
87 | .search(this.value) | |
88 | .draw(); |
|
88 | .draw(); | |
89 | }); |
|
89 | }); | |
90 |
|
90 | |||
91 | // refilter table if page load via back button |
|
91 | // refilter table if page load via back button | |
92 | $("#q_filter").trigger('keyup'); |
|
92 | $("#q_filter").trigger('keyup'); | |
93 |
|
93 | |||
94 | }); |
|
94 | }); | |
95 |
|
95 | |||
96 | </script> |
|
96 | </script> | |
97 |
|
97 | |||
98 | </%def> |
|
98 | </%def> |
@@ -1,141 +1,141 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('Users administration')} |
|
5 | ${_('Users administration')} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${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 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_count">0</span> |
|
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_count">0</span> | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='admin')} |
|
17 | ${self.menu_items(active='admin')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 |
|
22 | |||
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | ${self.breadcrumbs()} |
|
24 | ${self.breadcrumbs()} | |
25 | <ul class="links"> |
|
25 | <ul class="links"> | |
26 | <li> |
|
26 | <li> | |
27 | <a href="${h.url('new_user')}" class="btn btn-small btn-success">${_(u'Add User')}</a> |
|
27 | <a href="${h.url('new_user')}" class="btn btn-small btn-success">${_(u'Add User')}</a> | |
28 | </li> |
|
28 | </li> | |
29 | </ul> |
|
29 | </ul> | |
30 | </div> |
|
30 | </div> | |
31 |
|
31 | |||
32 | <div id="repos_list_wrap"> |
|
32 | <div id="repos_list_wrap"> | |
33 | <table id="user_list_table" class="display"></table> |
|
33 | <table id="user_list_table" class="display"></table> | |
34 | </div> |
|
34 | </div> | |
35 | </div> |
|
35 | </div> | |
36 |
|
36 | |||
37 | <script> |
|
37 | <script> | |
38 | $(document).ready(function() { |
|
38 | $(document).ready(function() { | |
39 |
|
39 | |||
40 | var get_datatable_count = function(){ |
|
40 | var get_datatable_count = function(){ | |
41 | var datatable = $('#user_list_table').dataTable(); |
|
41 | var datatable = $('#user_list_table').dataTable(); | |
42 | var api = datatable.api(); |
|
42 | var api = datatable.api(); | |
43 | var total = api.page.info().recordsDisplay; |
|
43 | var total = api.page.info().recordsDisplay; | |
44 | var active = datatable.fnGetFilteredData(); |
|
44 | var active = datatable.fnGetFilteredData(); | |
45 | var _text = _gettext("{0} active out of {1} users").format(active, total); |
|
45 | var _text = _gettext("{0} active out of {1} users").format(active, total); | |
46 | $('#user_count').text(_text); |
|
46 | $('#user_count').text(_text); | |
47 | }; |
|
47 | }; | |
48 |
|
48 | |||
49 | // custom filter that filters by username OR email |
|
49 | // custom filter that filters by username OR email | |
50 | $.fn.dataTable.ext.search.push( |
|
50 | $.fn.dataTable.ext.search.push( | |
51 | function( settings, data, dataIndex ) { |
|
51 | function( settings, data, dataIndex ) { | |
52 | var query = $('#q_filter').val(); |
|
52 | var query = $('#q_filter').val(); | |
53 | var username = data[1]; |
|
53 | var username = data[1]; | |
54 | var email = data[2]; |
|
54 | var email = data[2]; | |
55 | var first_name = data[3]; |
|
55 | var first_name = data[3]; | |
56 | var last_name = data[4]; |
|
56 | var last_name = data[4]; | |
57 |
|
57 | |||
58 | var query_str = username + " " + |
|
58 | var query_str = username + " " + | |
59 | email + " " + |
|
59 | email + " " + | |
60 | first_name + " " + |
|
60 | first_name + " " + | |
61 | last_name; |
|
61 | last_name; | |
62 | if((query_str).indexOf(query) !== -1){ |
|
62 | if((query_str).indexOf(query) !== -1){ | |
63 | return true; |
|
63 | return true; | |
64 | } |
|
64 | } | |
65 | return false; |
|
65 | return false; | |
66 | } |
|
66 | } | |
67 | ); |
|
67 | ); | |
68 | // filtered data plugin |
|
68 | // filtered data plugin | |
69 | $.fn.dataTableExt.oApi.fnGetFilteredData = function ( oSettings ) { |
|
69 | $.fn.dataTableExt.oApi.fnGetFilteredData = function ( oSettings ) { | |
70 | var res = []; |
|
70 | var res = []; | |
71 | for ( var i=0, iLen=oSettings.fnRecordsDisplay() ; i<iLen ; i++ ) { |
|
71 | for ( var i=0, iLen=oSettings.fnRecordsDisplay() ; i<iLen ; i++ ) { | |
72 | var record = oSettings.aoData[i]._aData; |
|
72 | var record = oSettings.aoData[i]._aData; | |
73 | if(record['active_raw']){ |
|
73 | if(record['active_raw']){ | |
74 | res.push(record); |
|
74 | res.push(record); | |
75 | } |
|
75 | } | |
76 | } |
|
76 | } | |
77 | return res.length; |
|
77 | return res.length; | |
78 | }; |
|
78 | }; | |
79 |
|
79 | |||
80 | // user list |
|
80 | // user list | |
81 | $('#user_list_table').DataTable({ |
|
81 | $('#user_list_table').DataTable({ | |
82 | data: ${c.data|n}, |
|
82 | data: ${c.data|n}, | |
83 | dom: 'rtp', |
|
83 | dom: 'rtp', | |
84 | pageLength: ${c.visual.admin_grid_items}, |
|
84 | pageLength: ${c.visual.admin_grid_items}, | |
85 | order: [[ 1, "asc" ]], |
|
85 | order: [[ 1, "asc" ]], | |
86 | columns: [ |
|
86 | columns: [ | |
87 | { data: {"_": "gravatar"}, className: "td-gravatar" }, |
|
87 | { data: {"_": "gravatar"}, className: "td-gravatar" }, | |
88 | { data: {"_": "username", |
|
88 | { data: {"_": "username", | |
89 | "sort": "username_raw"}, title: "${_('Username')}", className: "td-user" }, |
|
89 | "sort": "username_raw"}, title: "${_('Username')}", className: "td-user" }, | |
90 | { data: {"_": "email", |
|
90 | { data: {"_": "email", | |
91 | "sort": "email"}, title: "${_('Email')}", className: "td-email" }, |
|
91 | "sort": "email"}, title: "${_('Email')}", className: "td-email" }, | |
92 | { data: {"_": "first_name", |
|
92 | { data: {"_": "first_name", | |
93 | "sort": "first_name"}, title: "${_('First Name')}", className: "td-user" }, |
|
93 | "sort": "first_name"}, title: "${_('First Name')}", className: "td-user" }, | |
94 | { data: {"_": "last_name", |
|
94 | { data: {"_": "last_name", | |
95 | "sort": "last_name"}, title: "${_('Last Name')}", className: "td-user" }, |
|
95 | "sort": "last_name"}, title: "${_('Last Name')}", className: "td-user" }, | |
96 | { data: {"_": "last_login", |
|
96 | { data: {"_": "last_login", | |
97 | "sort": "last_login_raw", |
|
97 | "sort": "last_login_raw", | |
98 | "type": Number}, title: "${_('Last login')}", className: "td-time" }, |
|
98 | "type": Number}, title: "${_('Last login')}", className: "td-time" }, | |
99 | { data: {"_": "active", |
|
99 | { data: {"_": "active", | |
100 | "sort": "active_raw"}, title: "${_('Active')}", className: "td-active" }, |
|
100 | "sort": "active_raw"}, title: "${_('Active')}", className: "td-active" }, | |
101 | { data: {"_": "admin", |
|
101 | { data: {"_": "admin", | |
102 | "sort": "admin_raw"}, title: "${_('Admin')}", className: "td-admin" }, |
|
102 | "sort": "admin_raw"}, title: "${_('Admin')}", className: "td-admin" }, | |
103 | { data: {"_": "extern_type", |
|
103 | { data: {"_": "extern_type", | |
104 | "sort": "extern_type"}, title: "${_('Authentication type')}", className: "td-type" }, |
|
104 | "sort": "extern_type"}, title: "${_('Authentication type')}", className: "td-type" }, | |
105 | { data: {"_": "action", |
|
105 | { data: {"_": "action", | |
106 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } |
|
106 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } | |
107 | ], |
|
107 | ], | |
108 | language: { |
|
108 | language: { | |
109 | paginate: DEFAULT_GRID_PAGINATION, |
|
109 | paginate: DEFAULT_GRID_PAGINATION, | |
110 | emptyTable: "No users available yet." |
|
110 | emptyTable: _gettext("No user_gettext(s available yet.") | |
111 | }, |
|
111 | }, | |
112 | "initComplete": function( settings, json ) { |
|
112 | "initComplete": function( settings, json ) { | |
113 | get_datatable_count(); |
|
113 | get_datatable_count(); | |
114 | }, |
|
114 | }, | |
115 | "createdRow": function ( row, data, index ) { |
|
115 | "createdRow": function ( row, data, index ) { | |
116 | if (!data['active_raw']){ |
|
116 | if (!data['active_raw']){ | |
117 | $(row).addClass('closed') |
|
117 | $(row).addClass('closed') | |
118 | } |
|
118 | } | |
119 | } |
|
119 | } | |
120 | }); |
|
120 | }); | |
121 |
|
121 | |||
122 | // update the counter when doing search |
|
122 | // update the counter when doing search | |
123 | $('#user_list_table').on( 'search.dt', function (e,settings) { |
|
123 | $('#user_list_table').on( 'search.dt', function (e,settings) { | |
124 | get_datatable_count(); |
|
124 | get_datatable_count(); | |
125 | }); |
|
125 | }); | |
126 |
|
126 | |||
127 | // filter, filter both grids |
|
127 | // filter, filter both grids | |
128 | $('#q_filter').on( 'keyup', function () { |
|
128 | $('#q_filter').on( 'keyup', function () { | |
129 | var user_api = $('#user_list_table').dataTable().api(); |
|
129 | var user_api = $('#user_list_table').dataTable().api(); | |
130 | user_api |
|
130 | user_api | |
131 | .draw(); |
|
131 | .draw(); | |
132 | }); |
|
132 | }); | |
133 |
|
133 | |||
134 | // refilter table if page load via back button |
|
134 | // refilter table if page load via back button | |
135 | $("#q_filter").trigger('keyup'); |
|
135 | $("#q_filter").trigger('keyup'); | |
136 |
|
136 | |||
137 | }); |
|
137 | }); | |
138 |
|
138 | |||
139 | </script> |
|
139 | </script> | |
140 |
|
140 | |||
141 | </%def> |
|
141 | </%def> |
@@ -1,102 +1,102 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('%s Bookmarks') % c.repo_name} |
|
5 | ${_('%s Bookmarks') % c.repo_name} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${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 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | <span id="obj_count">0</span> ${_('bookmarks')} |
|
13 | <span id="obj_count">0</span> ${_('bookmarks')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='repositories')} |
|
17 | ${self.menu_items(active='repositories')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="menu_bar_subnav()"> |
|
20 | <%def name="menu_bar_subnav()"> | |
21 | ${self.repo_menu(active='summary')} |
|
21 | ${self.repo_menu(active='summary')} | |
22 | </%def> |
|
22 | </%def> | |
23 |
|
23 | |||
24 | <%def name="main()"> |
|
24 | <%def name="main()"> | |
25 | <div class="box"> |
|
25 | <div class="box"> | |
26 | <div class="title"> |
|
26 | <div class="title"> | |
27 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
27 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
28 | %if c.has_references: |
|
28 | %if c.has_references: | |
29 | <ul class="links"> |
|
29 | <ul class="links"> | |
30 | <li> |
|
30 | <li> | |
31 | <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Bookmarks')}"> |
|
31 | <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Bookmarks')}"> | |
32 | </li> |
|
32 | </li> | |
33 | </ul> |
|
33 | </ul> | |
34 | %endif |
|
34 | %endif | |
35 | %if c.has_references: |
|
35 | %if c.has_references: | |
36 | ${self.breadcrumbs()} |
|
36 | ${self.breadcrumbs()} | |
37 | %endif |
|
37 | %endif | |
38 | </div> |
|
38 | </div> | |
39 | <table id="obj_list_table" class="display"></table> |
|
39 | <table id="obj_list_table" class="display"></table> | |
40 | </div> |
|
40 | </div> | |
41 |
|
41 | |||
42 |
|
42 | |||
43 | <script type="text/javascript"> |
|
43 | <script type="text/javascript"> | |
44 | $(document).ready(function() { |
|
44 | $(document).ready(function() { | |
45 |
|
45 | |||
46 | var get_datatable_count = function(){ |
|
46 | var get_datatable_count = function(){ | |
47 | var api = $('#obj_list_table').dataTable().api(); |
|
47 | var api = $('#obj_list_table').dataTable().api(); | |
48 | $('#obj_count').text(api.page.info().recordsDisplay); |
|
48 | $('#obj_count').text(api.page.info().recordsDisplay); | |
49 | }; |
|
49 | }; | |
50 |
|
50 | |||
51 | // object list |
|
51 | // object list | |
52 | $('#obj_list_table').DataTable({ |
|
52 | $('#obj_list_table').DataTable({ | |
53 | data: ${c.data|n}, |
|
53 | data: ${c.data|n}, | |
54 | dom: 'rtp', |
|
54 | dom: 'rtp', | |
55 | pageLength: ${c.visual.dashboard_items}, |
|
55 | pageLength: ${c.visual.dashboard_items}, | |
56 | order: [[ 0, "asc" ]], |
|
56 | order: [[ 0, "asc" ]], | |
57 | columns: [ |
|
57 | columns: [ | |
58 | { data: {"_": "name", |
|
58 | { data: {"_": "name", | |
59 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" }, |
|
59 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" }, | |
60 | { data: {"_": "date", |
|
60 | { data: {"_": "date", | |
61 | "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" }, |
|
61 | "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" }, | |
62 | { data: {"_": "author", |
|
62 | { data: {"_": "author", | |
63 | "sort": "author"}, title: "${_('Author')}", className: "td-user" }, |
|
63 | "sort": "author"}, title: "${_('Author')}", className: "td-user" }, | |
64 | { data: {"_": "commit", |
|
64 | { data: {"_": "commit", | |
65 | "sort": "commit_raw", |
|
65 | "sort": "commit_raw", | |
66 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, |
|
66 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, | |
67 | { data: {"_": "compare", |
|
67 | { data: {"_": "compare", | |
68 | "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" } |
|
68 | "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" } | |
69 | ], |
|
69 | ], | |
70 | language: { |
|
70 | language: { | |
71 | paginate: DEFAULT_GRID_PAGINATION, |
|
71 | paginate: DEFAULT_GRID_PAGINATION, | |
72 | emptyTable: "No bookmarks available yet." |
|
72 | emptyTable: _gettext("No bookmarks available yet.") | |
73 | }, |
|
73 | }, | |
74 | "initComplete": function(settings, json) { |
|
74 | "initComplete": function(settings, json) { | |
75 | get_datatable_count(); |
|
75 | get_datatable_count(); | |
76 | timeagoActivate(); |
|
76 | timeagoActivate(); | |
77 | compare_radio_buttons("${c.repo_name}", 'book'); |
|
77 | compare_radio_buttons("${c.repo_name}", 'book'); | |
78 | } |
|
78 | } | |
79 | }); |
|
79 | }); | |
80 |
|
80 | |||
81 | // update when things change |
|
81 | // update when things change | |
82 | $('#obj_list_table').on('draw.dt', function() { |
|
82 | $('#obj_list_table').on('draw.dt', function() { | |
83 | get_datatable_count(); |
|
83 | get_datatable_count(); | |
84 | timeagoActivate(); |
|
84 | timeagoActivate(); | |
85 | }); |
|
85 | }); | |
86 |
|
86 | |||
87 | // filter, filter both grids |
|
87 | // filter, filter both grids | |
88 | $('#q_filter').on('keyup', function() { |
|
88 | $('#q_filter').on('keyup', function() { | |
89 | var obj_api = $('#obj_list_table').dataTable().api(); |
|
89 | var obj_api = $('#obj_list_table').dataTable().api(); | |
90 | obj_api |
|
90 | obj_api | |
91 | .columns(0) |
|
91 | .columns(0) | |
92 | .search(this.value) |
|
92 | .search(this.value) | |
93 | .draw(); |
|
93 | .draw(); | |
94 | }); |
|
94 | }); | |
95 |
|
95 | |||
96 | // refilter table if page load via back button |
|
96 | // refilter table if page load via back button | |
97 | $("#q_filter").trigger('keyup'); |
|
97 | $("#q_filter").trigger('keyup'); | |
98 |
|
98 | |||
99 | }); |
|
99 | }); | |
100 |
|
100 | |||
101 | </script> |
|
101 | </script> | |
102 | </%def> |
|
102 | </%def> |
@@ -1,101 +1,101 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('%s Branches') % c.repo_name} |
|
5 | ${_('%s Branches') % c.repo_name} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${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 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | <span id="obj_count">0</span> ${_('branches')} |
|
13 | <span id="obj_count">0</span> ${_('branches')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='repositories')} |
|
17 | ${self.menu_items(active='repositories')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="menu_bar_subnav()"> |
|
20 | <%def name="menu_bar_subnav()"> | |
21 | ${self.repo_menu(active='summary')} |
|
21 | ${self.repo_menu(active='summary')} | |
22 | </%def> |
|
22 | </%def> | |
23 |
|
23 | |||
24 | <%def name="main()"> |
|
24 | <%def name="main()"> | |
25 | <div class="box"> |
|
25 | <div class="box"> | |
26 | <div class="title"> |
|
26 | <div class="title"> | |
27 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
27 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
28 | %if c.has_references: |
|
28 | %if c.has_references: | |
29 | <ul class="links"> |
|
29 | <ul class="links"> | |
30 | <li> |
|
30 | <li> | |
31 | <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Branches')}"/> |
|
31 | <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Branches')}"/> | |
32 | </li> |
|
32 | </li> | |
33 | </ul> |
|
33 | </ul> | |
34 | %endif |
|
34 | %endif | |
35 | %if c.has_references: |
|
35 | %if c.has_references: | |
36 | ${self.breadcrumbs()} |
|
36 | ${self.breadcrumbs()} | |
37 | %endif |
|
37 | %endif | |
38 | </div> |
|
38 | </div> | |
39 | <table id="obj_list_table" class="display"></table> |
|
39 | <table id="obj_list_table" class="display"></table> | |
40 | </div> |
|
40 | </div> | |
41 |
|
41 | |||
42 | <script type="text/javascript"> |
|
42 | <script type="text/javascript"> | |
43 | $(document).ready(function() { |
|
43 | $(document).ready(function() { | |
44 |
|
44 | |||
45 | var get_datatable_count = function(){ |
|
45 | var get_datatable_count = function(){ | |
46 | var api = $('#obj_list_table').dataTable().api(); |
|
46 | var api = $('#obj_list_table').dataTable().api(); | |
47 | $('#obj_count').text(api.page.info().recordsDisplay); |
|
47 | $('#obj_count').text(api.page.info().recordsDisplay); | |
48 | }; |
|
48 | }; | |
49 |
|
49 | |||
50 | // object list |
|
50 | // object list | |
51 | $('#obj_list_table').DataTable({ |
|
51 | $('#obj_list_table').DataTable({ | |
52 | data: ${c.data|n}, |
|
52 | data: ${c.data|n}, | |
53 | dom: 'rtp', |
|
53 | dom: 'rtp', | |
54 | pageLength: ${c.visual.dashboard_items}, |
|
54 | pageLength: ${c.visual.dashboard_items}, | |
55 | order: [[ 0, "asc" ]], |
|
55 | order: [[ 0, "asc" ]], | |
56 | columns: [ |
|
56 | columns: [ | |
57 | { data: {"_": "name", |
|
57 | { data: {"_": "name", | |
58 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" }, |
|
58 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" }, | |
59 | { data: {"_": "date", |
|
59 | { data: {"_": "date", | |
60 | "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" }, |
|
60 | "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" }, | |
61 | { data: {"_": "author", |
|
61 | { data: {"_": "author", | |
62 | "sort": "author"}, title: "${_('Author')}", className: "td-user" }, |
|
62 | "sort": "author"}, title: "${_('Author')}", className: "td-user" }, | |
63 | { data: {"_": "commit", |
|
63 | { data: {"_": "commit", | |
64 | "sort": "commit_raw", |
|
64 | "sort": "commit_raw", | |
65 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, |
|
65 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, | |
66 | { data: {"_": "compare", |
|
66 | { data: {"_": "compare", | |
67 | "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" } |
|
67 | "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" } | |
68 | ], |
|
68 | ], | |
69 | language: { |
|
69 | language: { | |
70 | paginate: DEFAULT_GRID_PAGINATION, |
|
70 | paginate: DEFAULT_GRID_PAGINATION, | |
71 | emptyTable: "No branches available yet." |
|
71 | emptyTable: _gettext("No branches available yet.") | |
72 | }, |
|
72 | }, | |
73 | "initComplete": function( settings, json ) { |
|
73 | "initComplete": function( settings, json ) { | |
74 | get_datatable_count(); |
|
74 | get_datatable_count(); | |
75 | timeagoActivate(); |
|
75 | timeagoActivate(); | |
76 | compare_radio_buttons("${c.repo_name}", 'branch'); |
|
76 | compare_radio_buttons("${c.repo_name}", 'branch'); | |
77 | } |
|
77 | } | |
78 | }); |
|
78 | }); | |
79 |
|
79 | |||
80 | // update when things change |
|
80 | // update when things change | |
81 | $('#obj_list_table').on('draw.dt', function() { |
|
81 | $('#obj_list_table').on('draw.dt', function() { | |
82 | get_datatable_count(); |
|
82 | get_datatable_count(); | |
83 | timeagoActivate(); |
|
83 | timeagoActivate(); | |
84 | }); |
|
84 | }); | |
85 |
|
85 | |||
86 | // filter, filter both grids |
|
86 | // filter, filter both grids | |
87 | $('#q_filter').on( 'keyup', function () { |
|
87 | $('#q_filter').on( 'keyup', function () { | |
88 | var obj_api = $('#obj_list_table').dataTable().api(); |
|
88 | var obj_api = $('#obj_list_table').dataTable().api(); | |
89 | obj_api |
|
89 | obj_api | |
90 | .columns(0) |
|
90 | .columns(0) | |
91 | .search(this.value) |
|
91 | .search(this.value) | |
92 | .draw(); |
|
92 | .draw(); | |
93 | }); |
|
93 | }); | |
94 |
|
94 | |||
95 | // refilter table if page load via back button |
|
95 | // refilter table if page load via back button | |
96 | $("#q_filter").trigger('keyup'); |
|
96 | $("#q_filter").trigger('keyup'); | |
97 |
|
97 | |||
98 | }); |
|
98 | }); | |
99 |
|
99 | |||
100 | </script> |
|
100 | </script> | |
101 | </%def> |
|
101 | </%def> |
@@ -1,172 +1,172 b'' | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 | <%def name="main()"> |
|
3 | <%def name="main()"> | |
4 | <div class="box"> |
|
4 | <div class="box"> | |
5 | <!-- box / title --> |
|
5 | <!-- box / title --> | |
6 | <div class="title"> |
|
6 | <div class="title"> | |
7 | <div class="block-left breadcrumbs"> |
|
7 | <div class="block-left breadcrumbs"> | |
8 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
8 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
9 | ${self.breadcrumbs()} |
|
9 | ${self.breadcrumbs()} | |
10 | <span id="match_container" style="display:none">» <span id="match_count">0</span> ${_('matches')}</span> |
|
10 | <span id="match_container" style="display:none">» <span id="match_count">0</span> ${_('matches')}</span> | |
11 | </div> |
|
11 | </div> | |
12 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
12 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
13 | <div class="block-right"> |
|
13 | <div class="block-right"> | |
14 | <% |
|
14 | <% | |
15 | is_admin = h.HasPermissionAny('hg.admin')('can create repos index page') |
|
15 | is_admin = h.HasPermissionAny('hg.admin')('can create repos index page') | |
16 | create_repo = h.HasPermissionAny('hg.create.repository')('can create repository index page') |
|
16 | create_repo = h.HasPermissionAny('hg.create.repository')('can create repository index page') | |
17 | create_repo_group = h.HasPermissionAny('hg.repogroup.create.true')('can create repository groups index page') |
|
17 | create_repo_group = h.HasPermissionAny('hg.repogroup.create.true')('can create repository groups index page') | |
18 | create_user_group = h.HasPermissionAny('hg.usergroup.create.true')('can create user groups index page') |
|
18 | create_user_group = h.HasPermissionAny('hg.usergroup.create.true')('can create user groups index page') | |
19 |
|
19 | |||
20 | gr_name = c.repo_group.group_name if c.repo_group else None |
|
20 | gr_name = c.repo_group.group_name if c.repo_group else None | |
21 | # create repositories with write permission on group is set to true |
|
21 | # create repositories with write permission on group is set to true | |
22 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() |
|
22 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() | |
23 | group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') |
|
23 | group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') | |
24 | group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') |
|
24 | group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') | |
25 | %> |
|
25 | %> | |
26 |
|
26 | |||
27 | %if not c.repo_group: |
|
27 | %if not c.repo_group: | |
28 | ## no repository group context here |
|
28 | ## no repository group context here | |
29 | %if is_admin or create_repo: |
|
29 | %if is_admin or create_repo: | |
30 | <a href="${h.url('new_repo')}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a> |
|
30 | <a href="${h.url('new_repo')}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a> | |
31 | %endif |
|
31 | %endif | |
32 |
|
32 | |||
33 | %if is_admin or create_repo_group: |
|
33 | %if is_admin or create_repo_group: | |
34 | <a href="${h.url('new_repo_group')}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a> |
|
34 | <a href="${h.url('new_repo_group')}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a> | |
35 | %endif |
|
35 | %endif | |
36 | %else: |
|
36 | %else: | |
37 | ##we're inside other repository group other terms apply |
|
37 | ##we're inside other repository group other terms apply | |
38 | %if is_admin or group_admin or (group_write and create_on_write): |
|
38 | %if is_admin or group_admin or (group_write and create_on_write): | |
39 | <a href="${h.url('new_repo',parent_group=c.repo_group.group_id)}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a> |
|
39 | <a href="${h.url('new_repo',parent_group=c.repo_group.group_id)}" class="btn btn-small btn-success btn-primary">${_('Add Repository')}</a> | |
40 | %endif |
|
40 | %endif | |
41 | %if is_admin or group_admin: |
|
41 | %if is_admin or group_admin: | |
42 | <a href="${h.url('new_repo_group', parent_group=c.repo_group.group_id)}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a> |
|
42 | <a href="${h.url('new_repo_group', parent_group=c.repo_group.group_id)}" class="btn btn-small btn-default">${_(u'Add Repository Group')}</a> | |
43 | %endif |
|
43 | %endif | |
44 | %if is_admin or group_admin: |
|
44 | %if is_admin or group_admin: | |
45 | <a href="${h.url('edit_repo_group',group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}" class="btn btn-small btn-primary">${_('Edit Repository Group')}</a> |
|
45 | <a href="${h.url('edit_repo_group',group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}" class="btn btn-small btn-primary">${_('Edit Repository Group')}</a> | |
46 | %endif |
|
46 | %endif | |
47 | %endif |
|
47 | %endif | |
48 | </div> |
|
48 | </div> | |
49 | %endif |
|
49 | %endif | |
50 | </div> |
|
50 | </div> | |
51 | <!-- end box / title --> |
|
51 | <!-- end box / title --> | |
52 | <div class="table"> |
|
52 | <div class="table"> | |
53 | <div id="groups_list_wrap"> |
|
53 | <div id="groups_list_wrap"> | |
54 | <table id="group_list_table" class="display"></table> |
|
54 | <table id="group_list_table" class="display"></table> | |
55 | </div> |
|
55 | </div> | |
56 | </div> |
|
56 | </div> | |
57 |
|
57 | |||
58 | <div class="table"> |
|
58 | <div class="table"> | |
59 | <div id="repos_list_wrap"> |
|
59 | <div id="repos_list_wrap"> | |
60 | <table id="repo_list_table" class="display"></table> |
|
60 | <table id="repo_list_table" class="display"></table> | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 | </div> |
|
63 | </div> | |
64 | <script> |
|
64 | <script> | |
65 | $(document).ready(function() { |
|
65 | $(document).ready(function() { | |
66 |
|
66 | |||
67 | var get_datatable_count = function() { |
|
67 | var get_datatable_count = function() { | |
68 | var api = $('#repo_list_table').dataTable().api(); |
|
68 | var api = $('#repo_list_table').dataTable().api(); | |
69 | var pageInfo = api.page.info(); |
|
69 | var pageInfo = api.page.info(); | |
70 | var repos = pageInfo.recordsDisplay; |
|
70 | var repos = pageInfo.recordsDisplay; | |
71 | var reposTotal = pageInfo.recordsTotal; |
|
71 | var reposTotal = pageInfo.recordsTotal; | |
72 |
|
72 | |||
73 | api = $('#group_list_table').dataTable().api(); |
|
73 | api = $('#group_list_table').dataTable().api(); | |
74 | pageInfo = api.page.info(); |
|
74 | pageInfo = api.page.info(); | |
75 | var repoGroups = pageInfo.recordsDisplay; |
|
75 | var repoGroups = pageInfo.recordsDisplay; | |
76 | var repoGroupsTotal = pageInfo.recordsTotal; |
|
76 | var repoGroupsTotal = pageInfo.recordsTotal; | |
77 |
|
77 | |||
78 | if (repoGroups !== repoGroupsTotal) { |
|
78 | if (repoGroups !== repoGroupsTotal) { | |
79 | $('#match_count').text(repos+repoGroups); |
|
79 | $('#match_count').text(repos+repoGroups); | |
80 | } |
|
80 | } | |
81 | if (repos !== reposTotal) { |
|
81 | if (repos !== reposTotal) { | |
82 | $('#match_container').show(); |
|
82 | $('#match_container').show(); | |
83 | } |
|
83 | } | |
84 | if ($('#q_filter').val() === '') { |
|
84 | if ($('#q_filter').val() === '') { | |
85 | $('#match_container').hide(); |
|
85 | $('#match_container').hide(); | |
86 | } |
|
86 | } | |
87 | }; |
|
87 | }; | |
88 |
|
88 | |||
89 | // repo group list |
|
89 | // repo group list | |
90 | $('#group_list_table').DataTable({ |
|
90 | $('#group_list_table').DataTable({ | |
91 | data: ${c.repo_groups_data|n}, |
|
91 | data: ${c.repo_groups_data|n}, | |
92 | dom: 'rtp', |
|
92 | dom: 'rtp', | |
93 | pageLength: ${c.visual.dashboard_items}, |
|
93 | pageLength: ${c.visual.dashboard_items}, | |
94 | order: [[ 0, "asc" ]], |
|
94 | order: [[ 0, "asc" ]], | |
95 | columns: [ |
|
95 | columns: [ | |
96 | { data: {"_": "name", |
|
96 | { data: {"_": "name", | |
97 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, |
|
97 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname" }, | |
98 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, |
|
98 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, | |
99 | { data: {"_": "desc", |
|
99 | { data: {"_": "desc", | |
100 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, |
|
100 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, | |
101 | { data: {"_": "owner", |
|
101 | { data: {"_": "owner", | |
102 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" } |
|
102 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" } | |
103 | ], |
|
103 | ], | |
104 | language: { |
|
104 | language: { | |
105 | paginate: DEFAULT_GRID_PAGINATION, |
|
105 | paginate: DEFAULT_GRID_PAGINATION, | |
106 | emptyTable: "No repository groups available yet." |
|
106 | emptyTable: _gettext("No repository groups available yet.") | |
107 | }, |
|
107 | }, | |
108 | "drawCallback": function( settings, json ) { |
|
108 | "drawCallback": function( settings, json ) { | |
109 | timeagoActivate(); |
|
109 | timeagoActivate(); | |
110 | quick_repo_menu(); |
|
110 | quick_repo_menu(); | |
111 | } |
|
111 | } | |
112 | }); |
|
112 | }); | |
113 |
|
113 | |||
114 | // repo list |
|
114 | // repo list | |
115 | $('#repo_list_table').DataTable({ |
|
115 | $('#repo_list_table').DataTable({ | |
116 | data: ${c.repos_data|n}, |
|
116 | data: ${c.repos_data|n}, | |
117 | dom: 'rtp', |
|
117 | dom: 'rtp', | |
118 | order: [[ 0, "asc" ]], |
|
118 | order: [[ 0, "asc" ]], | |
119 | pageLength: ${c.visual.dashboard_items}, |
|
119 | pageLength: ${c.visual.dashboard_items}, | |
120 | columns: [ |
|
120 | columns: [ | |
121 | { data: {"_": "name", |
|
121 | { data: {"_": "name", | |
122 | "sort": "name_raw"}, title: "${_('Name')}", className: "truncate-wrap td-componentname" }, |
|
122 | "sort": "name_raw"}, title: "${_('Name')}", className: "truncate-wrap td-componentname" }, | |
123 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, |
|
123 | { data: 'menu', "bSortable": false, className: "quick_repo_menu" }, | |
124 | { data: {"_": "desc", |
|
124 | { data: {"_": "desc", | |
125 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, |
|
125 | "sort": "desc"}, title: "${_('Description')}", className: "td-description" }, | |
126 | { data: {"_": "last_change", |
|
126 | { data: {"_": "last_change", | |
127 | "sort": "last_change_raw", |
|
127 | "sort": "last_change_raw", | |
128 | "type": Number}, title: "${_('Last Change')}", className: "td-time" }, |
|
128 | "type": Number}, title: "${_('Last Change')}", className: "td-time" }, | |
129 | { data: {"_": "last_changeset", |
|
129 | { data: {"_": "last_changeset", | |
130 | "sort": "last_changeset_raw", |
|
130 | "sort": "last_changeset_raw", | |
131 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, |
|
131 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, | |
132 | { data: {"_": "owner", |
|
132 | { data: {"_": "owner", | |
133 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, |
|
133 | "sort": "owner"}, title: "${_('Owner')}", className: "td-user" }, | |
134 | { data: {"_": "rss", |
|
134 | { data: {"_": "rss", | |
135 | "sort": "rss"}, title: "rss", className: "td-rss" } |
|
135 | "sort": "rss"}, title: "rss", className: "td-rss" } | |
136 | ], |
|
136 | ], | |
137 | language: { |
|
137 | language: { | |
138 | paginate: DEFAULT_GRID_PAGINATION, |
|
138 | paginate: DEFAULT_GRID_PAGINATION, | |
139 | emptyTable: "No repositories available yet." |
|
139 | emptyTable: _gettext("No repositories available yet.") | |
140 | }, |
|
140 | }, | |
141 | "drawCallback": function( settings, json ) { |
|
141 | "drawCallback": function( settings, json ) { | |
142 | timeagoActivate(); |
|
142 | timeagoActivate(); | |
143 | quick_repo_menu(); |
|
143 | quick_repo_menu(); | |
144 | } |
|
144 | } | |
145 | }); |
|
145 | }); | |
146 |
|
146 | |||
147 | // update the counter when doing search |
|
147 | // update the counter when doing search | |
148 | $('#repo_list_table, #group_list_table').on( 'search.dt', function (e,settings) { |
|
148 | $('#repo_list_table, #group_list_table').on( 'search.dt', function (e,settings) { | |
149 | get_datatable_count(); |
|
149 | get_datatable_count(); | |
150 | }); |
|
150 | }); | |
151 |
|
151 | |||
152 | // filter, filter both grids |
|
152 | // filter, filter both grids | |
153 | $('#q_filter').on( 'keyup', function () { |
|
153 | $('#q_filter').on( 'keyup', function () { | |
154 | var repo_api = $('#repo_list_table').dataTable().api(); |
|
154 | var repo_api = $('#repo_list_table').dataTable().api(); | |
155 | repo_api |
|
155 | repo_api | |
156 | .columns( 0 ) |
|
156 | .columns( 0 ) | |
157 | .search( this.value ) |
|
157 | .search( this.value ) | |
158 | .draw(); |
|
158 | .draw(); | |
159 |
|
159 | |||
160 | var repo_group_api = $('#group_list_table').dataTable().api(); |
|
160 | var repo_group_api = $('#group_list_table').dataTable().api(); | |
161 | repo_group_api |
|
161 | repo_group_api | |
162 | .columns( 0 ) |
|
162 | .columns( 0 ) | |
163 | .search( this.value ) |
|
163 | .search( this.value ) | |
164 | .draw(); |
|
164 | .draw(); | |
165 | }); |
|
165 | }); | |
166 |
|
166 | |||
167 | // refilter table if page load via back button |
|
167 | // refilter table if page load via back button | |
168 | $("#q_filter").trigger('keyup'); |
|
168 | $("#q_filter").trigger('keyup'); | |
169 |
|
169 | |||
170 | }); |
|
170 | }); | |
171 | </script> |
|
171 | </script> | |
172 | </%def> |
|
172 | </%def> |
@@ -1,132 +1,132 b'' | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 | <%def name="title()"> |
|
3 | <%def name="title()"> | |
4 | ${_('%s Pull Requests') % c.repo_name} |
|
4 | ${_('%s Pull Requests') % c.repo_name} | |
5 | %if c.rhodecode_name: |
|
5 | %if c.rhodecode_name: | |
6 | · ${h.branding(c.rhodecode_name)} |
|
6 | · ${h.branding(c.rhodecode_name)} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%def> | |
9 |
|
9 | |||
10 | <%def name="breadcrumbs_links()"> |
|
10 | <%def name="breadcrumbs_links()"> | |
11 |
|
11 | |||
12 | </%def> |
|
12 | </%def> | |
13 |
|
13 | |||
14 | <%def name="menu_bar_nav()"> |
|
14 | <%def name="menu_bar_nav()"> | |
15 | ${self.menu_items(active='repositories')} |
|
15 | ${self.menu_items(active='repositories')} | |
16 | </%def> |
|
16 | </%def> | |
17 |
|
17 | |||
18 |
|
18 | |||
19 | <%def name="menu_bar_subnav()"> |
|
19 | <%def name="menu_bar_subnav()"> | |
20 | ${self.repo_menu(active='showpullrequest')} |
|
20 | ${self.repo_menu(active='showpullrequest')} | |
21 | </%def> |
|
21 | </%def> | |
22 |
|
22 | |||
23 |
|
23 | |||
24 | <%def name="main()"> |
|
24 | <%def name="main()"> | |
25 | <div class="box"> |
|
25 | <div class="box"> | |
26 | <div class="title"> |
|
26 | <div class="title"> | |
27 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
27 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
28 |
|
28 | |||
29 | <ul class="links"> |
|
29 | <ul class="links"> | |
30 | <li> |
|
30 | <li> | |
31 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
31 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
32 | <span> |
|
32 | <span> | |
33 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}"> |
|
33 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}"> | |
34 | ${_('Open new Pull Request')} |
|
34 | ${_('Open new Pull Request')} | |
35 | </a> |
|
35 | </a> | |
36 | </span> |
|
36 | </span> | |
37 | %endif |
|
37 | %endif | |
38 | </li> |
|
38 | </li> | |
39 | </ul> |
|
39 | </ul> | |
40 |
|
40 | |||
41 | ${self.breadcrumbs()} |
|
41 | ${self.breadcrumbs()} | |
42 | </div> |
|
42 | </div> | |
43 |
|
43 | |||
44 | <div class="sidebar-col-wrapper"> |
|
44 | <div class="sidebar-col-wrapper"> | |
45 | ##main |
|
45 | ##main | |
46 | <div class="sidebar"> |
|
46 | <div class="sidebar"> | |
47 | <ul class="nav nav-pills nav-stacked"> |
|
47 | <ul class="nav nav-pills nav-stacked"> | |
48 | <li class="${'active' if c.active=='open' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0)}">${_('Opened')}</a></li> |
|
48 | <li class="${'active' if c.active=='open' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0)}">${_('Opened')}</a></li> | |
49 | <li class="${'active' if c.active=='my' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,my=1)}">${_('Opened by me')}</a></li> |
|
49 | <li class="${'active' if c.active=='my' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,my=1)}">${_('Opened by me')}</a></li> | |
50 | <li class="${'active' if c.active=='awaiting' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,awaiting_review=1)}">${_('Awaiting review')}</a></li> |
|
50 | <li class="${'active' if c.active=='awaiting' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,awaiting_review=1)}">${_('Awaiting review')}</a></li> | |
51 | <li class="${'active' if c.active=='awaiting_my' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,awaiting_my_review=1)}">${_('Awaiting my review')}</a></li> |
|
51 | <li class="${'active' if c.active=='awaiting_my' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,awaiting_my_review=1)}">${_('Awaiting my review')}</a></li> | |
52 | <li class="${'active' if c.active=='closed' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,closed=1)}">${_('Closed')}</a></li> |
|
52 | <li class="${'active' if c.active=='closed' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=0,closed=1)}">${_('Closed')}</a></li> | |
53 | <li class="${'active' if c.active=='source' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=1)}">${_('From this repo')}</a></li> |
|
53 | <li class="${'active' if c.active=='source' else ''}"><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name,source=1)}">${_('From this repo')}</a></li> | |
54 | </ul> |
|
54 | </ul> | |
55 | </div> |
|
55 | </div> | |
56 |
|
56 | |||
57 | <div class="main-content-full-width"> |
|
57 | <div class="main-content-full-width"> | |
58 | <div class="panel panel-default"> |
|
58 | <div class="panel panel-default"> | |
59 | <div class="panel-heading"> |
|
59 | <div class="panel-heading"> | |
60 | <h3 class="panel-title"> |
|
60 | <h3 class="panel-title"> | |
61 | %if c.source: |
|
61 | %if c.source: | |
62 | ${_('Pull Requests from %(repo_name)s repository') % {'repo_name': c.repo_name}} |
|
62 | ${_('Pull Requests from %(repo_name)s repository') % {'repo_name': c.repo_name}} | |
63 | %elif c.closed: |
|
63 | %elif c.closed: | |
64 | ${_('Closed Pull Requests to repository %(repo_name)s') % {'repo_name': c.repo_name}} |
|
64 | ${_('Closed Pull Requests to repository %(repo_name)s') % {'repo_name': c.repo_name}} | |
65 | %elif c.my: |
|
65 | %elif c.my: | |
66 | ${_('Pull Requests to %(repo_name)s repository opened by me') % {'repo_name': c.repo_name}} |
|
66 | ${_('Pull Requests to %(repo_name)s repository opened by me') % {'repo_name': c.repo_name}} | |
67 | %elif c.awaiting_review: |
|
67 | %elif c.awaiting_review: | |
68 | ${_('Pull Requests to %(repo_name)s repository awaiting review') % {'repo_name': c.repo_name}} |
|
68 | ${_('Pull Requests to %(repo_name)s repository awaiting review') % {'repo_name': c.repo_name}} | |
69 | %elif c.awaiting_my_review: |
|
69 | %elif c.awaiting_my_review: | |
70 | ${_('Pull Requests to %(repo_name)s repository awaiting my review') % {'repo_name': c.repo_name}} |
|
70 | ${_('Pull Requests to %(repo_name)s repository awaiting my review') % {'repo_name': c.repo_name}} | |
71 | %else: |
|
71 | %else: | |
72 | ${_('Pull Requests to %(repo_name)s repository') % {'repo_name': c.repo_name}} |
|
72 | ${_('Pull Requests to %(repo_name)s repository') % {'repo_name': c.repo_name}} | |
73 | %endif |
|
73 | %endif | |
74 | </h3> |
|
74 | </h3> | |
75 | </div> |
|
75 | </div> | |
76 | <div class="panel-body"> |
|
76 | <div class="panel-body"> | |
77 | <table id="pull_request_list_table" class="display"></table> |
|
77 | <table id="pull_request_list_table" class="display"></table> | |
78 | </div> |
|
78 | </div> | |
79 | </div> |
|
79 | </div> | |
80 | </div> |
|
80 | </div> | |
81 | </div> |
|
81 | </div> | |
82 | </div> |
|
82 | </div> | |
83 |
|
83 | |||
84 | <script type="text/javascript"> |
|
84 | <script type="text/javascript"> | |
85 | $(document).ready(function() { |
|
85 | $(document).ready(function() { | |
86 | // object list |
|
86 | // object list | |
87 | $('#pull_request_list_table').DataTable({ |
|
87 | $('#pull_request_list_table').DataTable({ | |
88 | data: ${c.data|n}, |
|
88 | data: ${c.data|n}, | |
89 | processing: true, |
|
89 | processing: true, | |
90 | serverSide: true, |
|
90 | serverSide: true, | |
91 | deferLoading: ${c.records_total}, |
|
91 | deferLoading: ${c.records_total}, | |
92 | ajax: "", |
|
92 | ajax: "", | |
93 | dom: 'tp', |
|
93 | dom: 'tp', | |
94 | pageLength: ${c.visual.dashboard_items}, |
|
94 | pageLength: ${c.visual.dashboard_items}, | |
95 | order: [[ 1, "desc" ]], |
|
95 | order: [[ 1, "desc" ]], | |
96 | columns: [ |
|
96 | columns: [ | |
97 | { data: {"_": "status", |
|
97 | { data: {"_": "status", | |
98 | "sort": "status"}, title: "", className: "td-status", orderable: false}, |
|
98 | "sort": "status"}, title: "", className: "td-status", orderable: false}, | |
99 | { data: {"_": "name", |
|
99 | { data: {"_": "name", | |
100 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname", "type": "num" }, |
|
100 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-componentname", "type": "num" }, | |
101 | { data: {"_": "author", |
|
101 | { data: {"_": "author", | |
102 | "sort": "author_raw"}, title: "${_('Author')}", className: "td-user", orderable: false }, |
|
102 | "sort": "author_raw"}, title: "${_('Author')}", className: "td-user", orderable: false }, | |
103 | { data: {"_": "title", |
|
103 | { data: {"_": "title", | |
104 | "sort": "title"}, title: "${_('Title')}", className: "td-description" }, |
|
104 | "sort": "title"}, title: "${_('Title')}", className: "td-description" }, | |
105 | { data: {"_": "comments", |
|
105 | { data: {"_": "comments", | |
106 | "sort": "comments_raw"}, title: "", className: "td-comments", orderable: false}, |
|
106 | "sort": "comments_raw"}, title: "", className: "td-comments", orderable: false}, | |
107 | { data: {"_": "updated_on", |
|
107 | { data: {"_": "updated_on", | |
108 | "sort": "updated_on_raw"}, title: "${_('Updated on')}", className: "td-time" } |
|
108 | "sort": "updated_on_raw"}, title: "${_('Updated on')}", className: "td-time" } | |
109 | ], |
|
109 | ], | |
110 | language: { |
|
110 | language: { | |
111 | paginate: DEFAULT_GRID_PAGINATION, |
|
111 | paginate: DEFAULT_GRID_PAGINATION, | |
112 | emptyTable: "No pull requests available yet." |
|
112 | emptyTable: _gettext("No pull requests available yet.") | |
113 | }, |
|
113 | }, | |
114 | "drawCallback": function( settings, json ) { |
|
114 | "drawCallback": function( settings, json ) { | |
115 | timeagoActivate(); |
|
115 | timeagoActivate(); | |
116 | }, |
|
116 | }, | |
117 | "createdRow": function ( row, data, index ) { |
|
117 | "createdRow": function ( row, data, index ) { | |
118 | if (data['closed']) { |
|
118 | if (data['closed']) { | |
119 | $(row).addClass('closed'); |
|
119 | $(row).addClass('closed'); | |
120 | } |
|
120 | } | |
121 | } |
|
121 | } | |
122 | }); |
|
122 | }); | |
123 | }); |
|
123 | }); | |
124 | $('#pull_request_list_table').on('xhr.dt', function(e, settings, json, xhr){ |
|
124 | $('#pull_request_list_table').on('xhr.dt', function(e, settings, json, xhr){ | |
125 | $('#pull_request_list_table').css('opacity', 1); |
|
125 | $('#pull_request_list_table').css('opacity', 1); | |
126 | }); |
|
126 | }); | |
127 |
|
127 | |||
128 | $('#pull_request_list_table').on('preXhr.dt', function(e, settings, data){ |
|
128 | $('#pull_request_list_table').on('preXhr.dt', function(e, settings, data){ | |
129 | $('#pull_request_list_table').css('opacity', 0.3); |
|
129 | $('#pull_request_list_table').css('opacity', 0.3); | |
130 | }); |
|
130 | }); | |
131 | </script> |
|
131 | </script> | |
132 | </%def> |
|
132 | </%def> |
@@ -1,101 +1,101 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 | ${_('%s Tags') % c.repo_name} |
|
5 | ${_('%s Tags') % c.repo_name} | |
6 | %if c.rhodecode_name: |
|
6 | %if c.rhodecode_name: | |
7 | · ${h.branding(c.rhodecode_name)} |
|
7 | · ${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 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | <span id="obj_count">0</span> ${_('tags')} |
|
13 | <span id="obj_count">0</span> ${_('tags')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%def name="menu_bar_nav()"> |
|
16 | <%def name="menu_bar_nav()"> | |
17 | ${self.menu_items(active='repositories')} |
|
17 | ${self.menu_items(active='repositories')} | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%def name="menu_bar_subnav()"> |
|
20 | <%def name="menu_bar_subnav()"> | |
21 | ${self.repo_menu(active='summary')} |
|
21 | ${self.repo_menu(active='summary')} | |
22 | </%def> |
|
22 | </%def> | |
23 |
|
23 | |||
24 | <%def name="main()"> |
|
24 | <%def name="main()"> | |
25 | <div class="box"> |
|
25 | <div class="box"> | |
26 | <div class="title"> |
|
26 | <div class="title"> | |
27 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
27 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
28 | %if c.has_references: |
|
28 | %if c.has_references: | |
29 | <ul class="links"> |
|
29 | <ul class="links"> | |
30 | <li> |
|
30 | <li> | |
31 | <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Tags')}"> |
|
31 | <input type="submit" id="compare_action" class="btn" disabled="disabled" value="${_('Compare Selected Tags')}"> | |
32 | </li> |
|
32 | </li> | |
33 | </ul> |
|
33 | </ul> | |
34 | %endif |
|
34 | %endif | |
35 | %if c.has_references: |
|
35 | %if c.has_references: | |
36 | ${self.breadcrumbs()} |
|
36 | ${self.breadcrumbs()} | |
37 | %endif |
|
37 | %endif | |
38 | </div> |
|
38 | </div> | |
39 | <table id="obj_list_table" class="display"></table> |
|
39 | <table id="obj_list_table" class="display"></table> | |
40 | </div> |
|
40 | </div> | |
41 |
|
41 | |||
42 |
|
42 | |||
43 | <script type="text/javascript"> |
|
43 | <script type="text/javascript"> | |
44 | $(document).ready(function() { |
|
44 | $(document).ready(function() { | |
45 |
|
45 | |||
46 | var get_datatable_count = function(){ |
|
46 | var get_datatable_count = function(){ | |
47 | var api = $('#obj_list_table').dataTable().api(); |
|
47 | var api = $('#obj_list_table').dataTable().api(); | |
48 | $('#obj_count').text(api.page.info().recordsDisplay); |
|
48 | $('#obj_count').text(api.page.info().recordsDisplay); | |
49 | }; |
|
49 | }; | |
50 |
|
50 | |||
51 | // object list |
|
51 | // object list | |
52 | $('#obj_list_table').DataTable({ |
|
52 | $('#obj_list_table').DataTable({ | |
53 | data: ${c.data|n}, |
|
53 | data: ${c.data|n}, | |
54 | dom: 'rtp', |
|
54 | dom: 'rtp', | |
55 | pageLength: ${c.visual.dashboard_items}, |
|
55 | pageLength: ${c.visual.dashboard_items}, | |
56 | order: [[ 0, "asc" ]], |
|
56 | order: [[ 0, "asc" ]], | |
57 | columns: [ |
|
57 | columns: [ | |
58 | { data: {"_": "name", |
|
58 | { data: {"_": "name", | |
59 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" }, |
|
59 | "sort": "name_raw"}, title: "${_('Name')}", className: "td-tags" }, | |
60 | { data: {"_": "date", |
|
60 | { data: {"_": "date", | |
61 | "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" }, |
|
61 | "sort": "date_raw"}, title: "${_('Date')}", className: "td-time" }, | |
62 | { data: {"_": "author", |
|
62 | { data: {"_": "author", | |
63 | "sort": "author"}, title: "${_('Author')}", className: "td-user" }, |
|
63 | "sort": "author"}, title: "${_('Author')}", className: "td-user" }, | |
64 | { data: {"_": "commit", |
|
64 | { data: {"_": "commit", | |
65 | "sort": "commit_raw", |
|
65 | "sort": "commit_raw", | |
66 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, |
|
66 | "type": Number}, title: "${_('Commit')}", className: "td-hash" }, | |
67 | { data: {"_": "compare", |
|
67 | { data: {"_": "compare", | |
68 | "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" } |
|
68 | "sort": "compare"}, title: "${_('Compare')}", className: "td-compare" } | |
69 | ], |
|
69 | ], | |
70 | language: { |
|
70 | language: { | |
71 | paginate: DEFAULT_GRID_PAGINATION, |
|
71 | paginate: DEFAULT_GRID_PAGINATION, | |
72 | emptyTable: "No tags available yet." |
|
72 | emptyTable: _gettext("No tags available yet.") | |
73 | }, |
|
73 | }, | |
74 | "initComplete": function(settings, json) { |
|
74 | "initComplete": function(settings, json) { | |
75 | get_datatable_count(); |
|
75 | get_datatable_count(); | |
76 | timeagoActivate(); |
|
76 | timeagoActivate(); | |
77 | compare_radio_buttons("${c.repo_name}", 'tag'); |
|
77 | compare_radio_buttons("${c.repo_name}", 'tag'); | |
78 | } |
|
78 | } | |
79 | }); |
|
79 | }); | |
80 |
|
80 | |||
81 | // update when things change |
|
81 | // update when things change | |
82 | $('#obj_list_table').on('draw.dt', function() { |
|
82 | $('#obj_list_table').on('draw.dt', function() { | |
83 | get_datatable_count(); |
|
83 | get_datatable_count(); | |
84 | timeagoActivate(); |
|
84 | timeagoActivate(); | |
85 | }); |
|
85 | }); | |
86 |
|
86 | |||
87 | // filter, filter both grids |
|
87 | // filter, filter both grids | |
88 | $('#q_filter').on('keyup', function() { |
|
88 | $('#q_filter').on('keyup', function() { | |
89 | var obj_api = $('#obj_list_table').dataTable().api(); |
|
89 | var obj_api = $('#obj_list_table').dataTable().api(); | |
90 | obj_api |
|
90 | obj_api | |
91 | .columns(0) |
|
91 | .columns(0) | |
92 | .search(this.value) |
|
92 | .search(this.value) | |
93 | .draw(); |
|
93 | .draw(); | |
94 | }); |
|
94 | }); | |
95 |
|
95 | |||
96 | // refilter table if page load via back button |
|
96 | // refilter table if page load via back button | |
97 | $("#q_filter").trigger('keyup'); |
|
97 | $("#q_filter").trigger('keyup'); | |
98 | }); |
|
98 | }); | |
99 |
|
99 | |||
100 | </script> |
|
100 | </script> | |
101 | </%def> |
|
101 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now