Mercurial > kallithea
comparison rhodecode/templates/admin/users/users.html @ 4116:ffd45b185016 rhodecode-2.2.5-gpl
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
This imports changes between changesets 21af6c4eab3d and 6177597791c2 in
RhodeCode's original repository, including only changes to Python files and HTML.
RhodeCode clearly licensed its changes to these files under GPLv3
in their /LICENSE file, which states the following:
The Python code and integrated HTML are licensed under the GPLv3 license.
(See:
https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE
or
http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE
for an online copy of that LICENSE file)
Conservancy reviewed these changes and confirmed that they can be licensed as
a whole to the Kallithea project under GPLv3-only.
While some of the contents committed herein are clearly licensed
GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the
statement above from RhodeCode indicates that they intend GPLv3-only as their
license, per GPLv3ยง14 and other relevant sections of GPLv3.
author | Bradley M. Kuhn <bkuhn@sfconservancy.org> |
---|---|
date | Wed, 02 Jul 2014 19:03:13 -0400 |
parents | 690a955ba785 |
children |
comparison
equal
deleted
inserted
replaced
4115:8b7294a804a0 | 4116:ffd45b185016 |
---|---|
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')} · ${c.rhodecode_name} | 5 ${_('Users administration')} |
6 %if c.rhodecode_name: | |
7 · ${c.rhodecode_name} | |
8 %endif | |
6 </%def> | 9 </%def> |
7 | 10 |
8 <%def name="breadcrumbs_links()"> | 11 <%def name="breadcrumbs_links()"> |
9 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_count">0</span> ${_('users')} | 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> ${_('users')} | |
10 </%def> | 14 </%def> |
11 | 15 |
12 <%def name="page_nav()"> | 16 <%def name="page_nav()"> |
13 ${self.menu('admin')} | 17 ${self.menu('admin')} |
14 </%def> | 18 </%def> |
18 <!-- box / title --> | 22 <!-- box / title --> |
19 <div class="title"> | 23 <div class="title"> |
20 ${self.breadcrumbs()} | 24 ${self.breadcrumbs()} |
21 <ul class="links"> | 25 <ul class="links"> |
22 <li> | 26 <li> |
23 <span>${h.link_to(_(u'Add new user'),h.url('new_user'))}</span> | 27 <a href="${h.url('new_user')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add User')}</a> |
24 </li> | 28 </li> |
25 </ul> | 29 </ul> |
26 </div> | 30 </div> |
27 <!-- end box / title --> | 31 <!-- end box / title --> |
28 <div class="table yui-skin-sam" id="users_list_wrap"></div> | 32 <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> |
29 <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> | 33 <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> |
30 </div> | 34 </div> |
31 | 35 |
32 <script> | 36 <script> |
33 var url = "${h.url('formatted_users', format='json')}"; | |
34 var data = ${c.data|n}; | 37 var data = ${c.data|n}; |
35 var myDataSource = new YAHOO.util.DataSource(data); | 38 var fields = [ |
36 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; | 39 {key: "gravatar"}, |
37 | 40 {key: "raw_name"}, |
38 myDataSource.responseSchema = { | 41 {key: "username"}, |
39 resultsList: "records", | 42 {key: "firstname"}, |
40 fields: [ | 43 {key: "lastname"}, |
41 {key: "gravatar"}, | 44 {key: "last_login"}, |
42 {key: "raw_username"}, | 45 {key: "last_login_raw"}, |
43 {key: "username"}, | 46 {key: "active"}, |
44 {key: "firstname"}, | 47 {key: "admin"}, |
45 {key: "lastname"}, | 48 {key: "extern_type"}, |
46 {key: "last_login"}, | 49 {key: "action"}, |
47 {key: "last_login_raw"}, | |
48 {key: "active"}, | |
49 {key: "admin"}, | |
50 {key: "ldap"}, | |
51 {key: "action"}, | |
52 ] | |
53 }; | |
54 myDataSource.doBeforeCallback = function(req,raw,res,cb) { | |
55 // This is the filter function | |
56 var data = res.results || [], | |
57 filtered = [], | |
58 i,l; | |
59 | |
60 if (req) { | |
61 req = req.toLowerCase(); | |
62 for (i = 0; i<data.length; i++) { | |
63 var pos = data[i].raw_username.toLowerCase().indexOf(req) | |
64 if (pos != -1) { | |
65 filtered.push(data[i]); | |
66 } | |
67 } | |
68 res.results = filtered; | |
69 } | |
70 YUD.get('user_count').innerHTML = res.results.length; | |
71 return res; | |
72 } | |
73 | |
74 // main table sorting | |
75 var myColumnDefs = [ | |
76 {key:"gravatar",label:"",sortable:false,}, | |
77 {key:"username",label:"${_('Username')}",sortable:true, | |
78 sortOptions: { sortFunction: usernamelinkSort } | |
79 }, | |
80 {key:"firstname",label:"${_('Firstname')}",sortable:true,}, | |
81 {key:"lastname",label:"${_('Lastname')}",sortable:true,}, | |
82 {key:"last_login",label:"${_('Last login')}",sortable:true, | |
83 sortOptions: { sortFunction: lastLoginSort }}, | |
84 {key:"active",label:"${_('Active')}",sortable:true,}, | |
85 {key:"admin",label:"${_('Admin')}",sortable:true,}, | |
86 {key:"ldap",label:"${_('LDAP')}",sortable:true,}, | |
87 {key:"action",label:"${_('Action')}",sortable:false}, | |
88 ]; | 50 ]; |
89 | 51 var column_defs = [ |
90 var myDataTable = new YAHOO.widget.DataTable("users_list_wrap", myColumnDefs, myDataSource,{ | 52 {key:"gravatar",label:"",sortable:false,}, |
91 sortedBy:{key:"username",dir:"asc"}, | 53 {key:"username",label:"${_('Username')}",sortable:true}, |
92 paginator: new YAHOO.widget.Paginator({ | 54 {key:"firstname",label:"${_('Firstname')}",sortable:true,}, |
93 rowsPerPage: 15, | 55 {key:"lastname",label:"${_('Lastname')}",sortable:true,}, |
94 alwaysVisible: false, | 56 {key:"last_login",label:"${_('Last login')}",sortable:true, sortOptions: { sortFunction: lastLoginSort }}, |
95 template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}", | 57 {key:"active",label:"${_('Active')}",sortable:true,}, |
96 pageLinks: 5, | 58 {key:"admin",label:"${_('Admin')}",sortable:true,}, |
97 containerClass: 'pagination-wh', | 59 {key:"extern_type",label:"${_('Auth type')}",sortable:true,}, |
98 currentPageClass: 'pager_curpage', | 60 {key:"action",label:"${_('Action')}",sortable:false}, |
99 pageLinkClass: 'pager_link', | 61 ]; |
100 nextPageLinkLabel: '>', | 62 var counter = YUD.get('user_count'); |
101 previousPageLinkLabel: '<', | 63 var sort_key = "username"; |
102 firstPageLinkLabel: '<<', | 64 YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); |
103 lastPageLinkLabel: '>>', | |
104 containers:['user-paginator'] | |
105 }), | |
106 | |
107 MSG_SORTASC:"${_('Click to sort ascending')}", | |
108 MSG_SORTDESC:"${_('Click to sort descending')}", | |
109 MSG_EMPTY:"${_('No records found.')}", | |
110 MSG_ERROR:"${_('Data error.')}", | |
111 MSG_LOADING:"${_('Loading...')}", | |
112 } | |
113 ); | |
114 myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
115 | |
116 }); | |
117 | |
118 var filterTimeout = null; | |
119 | |
120 updateFilter = function () { | |
121 // Reset timeout | |
122 filterTimeout = null; | |
123 | |
124 // Reset sort | |
125 var state = myDataTable.getState(); | |
126 state.sortedBy = {key:'username', dir:YAHOO.widget.DataTable.CLASS_ASC}; | |
127 | |
128 // Get filtered data | |
129 myDataSource.sendRequest(YUD.get('q_filter').value,{ | |
130 success : myDataTable.onDataReturnInitializeTable, | |
131 failure : myDataTable.onDataReturnInitializeTable, | |
132 scope : myDataTable, | |
133 argument: state | |
134 }); | |
135 | |
136 }; | |
137 | |
138 YUE.on('q_filter','keyup',function (e) { | |
139 clearTimeout(filterTimeout); | |
140 filterTimeout = setTimeout(updateFilter,600); | |
141 }); | |
142 </script> | 65 </script> |
143 | 66 |
144 </%def> | 67 </%def> |