##// END OF EJS Templates
Prefix gist storage with rc, and store some metadata info into...
Prefix gist storage with rc, and store some metadata info into gist store repos

File last commit:

r3665:690a955b beta
r3841:979edf6a beta
Show More
users.html
144 lines | 4.4 KiB | text/html | HtmlLexer
renamed project to rhodecode
r547 ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
improved title consistency...
r3582 ${_('Users administration')} &middot; ${c.rhodecode_name}
renamed project to rhodecode
r547 </%def>
<%def name="breadcrumbs_links()">
use placeholders in qfilter, not the ugly JS logic
r3665 <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'))} &raquo; <span id="user_count">0</span> ${_('users')}
renamed project to rhodecode
r547 </%def>
<%def name="page_nav()">
Mads Kiilerich
html: don't use tabs
r3197 ${self.menu('admin')}
renamed project to rhodecode
r547 </%def>
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
white space cleanup
r2673 ${self.breadcrumbs()}
renamed project to rhodecode
r547 <ul class="links">
<li>
Mads Kiilerich
html: don't hardcode uppercase texts...
r3201 <span>${h.link_to(_(u'Add new user'),h.url('new_user'))}</span>
renamed project to rhodecode
r547 </li>
White-space cleanup
r1888 </ul>
renamed project to rhodecode
r547 </div>
<!-- end box / title -->
implemented admin panel Users table with YUI datatable...
r2658 <div class="table yui-skin-sam" id="users_list_wrap"></div>
<div id="user-paginator" style="padding: 0px 0px 0px 20px"></div>
renamed project to rhodecode
r547 </div>
implemented admin panel Users table with YUI datatable...
r2658
<script>
var url = "${h.url('formatted_users', format='json')}";
var data = ${c.data|n};
var myDataSource = new YAHOO.util.DataSource(data);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.responseSchema = {
Mads Kiilerich
html: don't use tabs
r3197 resultsList: "records",
implemented admin panel Users table with YUI datatable...
r2658 fields: [
{key: "gravatar"},
{key: "raw_username"},
{key: "username"},
{key: "firstname"},
{key: "lastname"},
{key: "last_login"},
fixed sorting by last_login in users admin page
r2699 {key: "last_login_raw"},
implemented admin panel Users table with YUI datatable...
r2658 {key: "active"},
{key: "admin"},
{key: "ldap"},
{key: "action"},
]
};
myDataSource.doBeforeCallback = function(req,raw,res,cb) {
// This is the filter function
var data = res.results || [],
filtered = [],
i,l;
white space cleanup
r2673
implemented admin panel Users table with YUI datatable...
r2658 if (req) {
req = req.toLowerCase();
for (i = 0; i<data.length; i++) {
Mads Kiilerich
html: don't use tabs
r3197 var pos = data[i].raw_username.toLowerCase().indexOf(req)
implemented admin panel Users table with YUI datatable...
r2658 if (pos != -1) {
filtered.push(data[i]);
}
}
res.results = filtered;
}
YUD.get('user_count').innerHTML = res.results.length;
return res;
}
// main table sorting
var myColumnDefs = [
white space cleanup
r2673 {key:"gravatar",label:"",sortable:false,},
Mads Kiilerich
Fix a lot of casings - use standard casing in most places
r3654 {key:"username",label:"${_('Username')}",sortable:true,
fixed users sorting in admin pannel
r3638 sortOptions: { sortFunction: usernamelinkSort }
implemented admin panel Users table with YUI datatable...
r2658 },
Mads Kiilerich
Fix a lot of casings - use standard casing in most places
r3654 {key:"firstname",label:"${_('Firstname')}",sortable:true,},
{key:"lastname",label:"${_('Lastname')}",sortable:true,},
{key:"last_login",label:"${_('Last login')}",sortable:true,
Mads Kiilerich
html: don't use tabs
r3197 sortOptions: { sortFunction: lastLoginSort }},
Mads Kiilerich
Fix a lot of casings - use standard casing in most places
r3654 {key:"active",label:"${_('Active')}",sortable:true,},
{key:"admin",label:"${_('Admin')}",sortable:true,},
{key:"ldap",label:"${_('LDAP')}",sortable:true,},
{key:"action",label:"${_('Action')}",sortable:false},
implemented admin panel Users table with YUI datatable...
r2658 ];
var myDataTable = new YAHOO.widget.DataTable("users_list_wrap", myColumnDefs, myDataSource,{
sortedBy:{key:"username",dir:"asc"},
paginator: new YAHOO.widget.Paginator({
rowsPerPage: 15,
alwaysVisible: false,
template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}",
pageLinks: 5,
containerClass: 'pagination-wh',
currentPageClass: 'pager_curpage',
pageLinkClass: 'pager_link',
nextPageLinkLabel: '&gt;',
previousPageLinkLabel: '&lt;',
firstPageLinkLabel: '&lt;&lt;',
lastPageLinkLabel: '&gt;&gt;',
containers:['user-paginator']
}),
MSG_SORTASC:"${_('Click to sort ascending')}",
MSG_SORTDESC:"${_('Click to sort descending')}",
MSG_EMPTY:"${_('No records found.')}",
MSG_ERROR:"${_('Data error.')}",
MSG_LOADING:"${_('Loading...')}",
}
);
myDataTable.subscribe('postRenderEvent',function(oArgs) {
});
white space cleanup
r2673
implemented admin panel Users table with YUI datatable...
r2658 var filterTimeout = null;
updateFilter = function () {
// Reset timeout
filterTimeout = null;
// Reset sort
var state = myDataTable.getState();
state.sortedBy = {key:'username', dir:YAHOO.widget.DataTable.CLASS_ASC};
// Get filtered data
myDataSource.sendRequest(YUD.get('q_filter').value,{
success : myDataTable.onDataReturnInitializeTable,
failure : myDataTable.onDataReturnInitializeTable,
scope : myDataTable,
argument: state
});
white space cleanup
r2673 };
implemented admin panel Users table with YUI datatable...
r2658
YUE.on('q_filter','keyup',function (e) {
clearTimeout(filterTimeout);
filterTimeout = setTimeout(updateFilter,600);
white space cleanup
r2673 });
implemented admin panel Users table with YUI datatable...
r2658 </script>
renamed project to rhodecode
r547 </%def>