Files
@ 90e06f53af8c
Branch filter:
Location: kallithea/rhodecode/templates/admin/users/user_edit_my_account.html - annotation
90e06f53af8c
10.8 KiB
text/html
Implemented cache-map on main page to save executing select
statements that checks if cache should be invalidated.
It reduces number of executed queries from N which is number of
repos to 1 which is needed to fetch all keys from database.
On pages with large number of repos this could reduce load time by half
statements that checks if cache should be invalidated.
It reduces number of executed queries from N which is number of
repos to 1 which is needed to fetch all keys from database.
On pages with large number of repos this could reduce load time by half
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 a1ec653f5f95 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 f91d3f9b7230 1e757ac98988 1e757ac98988 6b40654afa1e 1e757ac98988 1e757ac98988 f91d3f9b7230 7df3855bf6c7 7df3855bf6c7 7df3855bf6c7 7df3855bf6c7 2196aa27954b 2196aa27954b 2196aa27954b 2196aa27954b 2196aa27954b f91d3f9b7230 7df3855bf6c7 7df3855bf6c7 f91d3f9b7230 716911af91e1 716911af91e1 716911af91e1 716911af91e1 f91d3f9b7230 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 52da7cba88a6 1e757ac98988 1e757ac98988 f91d3f9b7230 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 9c0f5d558789 1e757ac98988 1e757ac98988 f91d3f9b7230 019026a8cf67 019026a8cf67 019026a8cf67 019026a8cf67 019026a8cf67 019026a8cf67 019026a8cf67 019026a8cf67 f91d3f9b7230 1e757ac98988 1e757ac98988 540545d374fd 1e757ac98988 1e757ac98988 52da7cba88a6 1e757ac98988 1e757ac98988 f91d3f9b7230 1e757ac98988 1e757ac98988 540545d374fd 1e757ac98988 1e757ac98988 52da7cba88a6 1e757ac98988 1e757ac98988 f91d3f9b7230 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 52da7cba88a6 1e757ac98988 1e757ac98988 f91d3f9b7230 1e757ac98988 aaec08ad9daf aaec08ad9daf f91d3f9b7230 1e757ac98988 f91d3f9b7230 1e757ac98988 1e757ac98988 f91d3f9b7230 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 f91d3f9b7230 f91d3f9b7230 b745d5d2563c 03c242fbca9c 03c242fbca9c 03c242fbca9c 03c242fbca9c b745d5d2563c f91d3f9b7230 f91d3f9b7230 f91d3f9b7230 1e757ac98988 1e757ac98988 b745d5d2563c b745d5d2563c b745d5d2563c 6199b34d349b 6199b34d349b b745d5d2563c 6199b34d349b b745d5d2563c b745d5d2563c b745d5d2563c 6199b34d349b 1e757ac98988 f1b76a558a66 1e757ac98988 43481c3d70ca 1e757ac98988 b745d5d2563c b745d5d2563c b745d5d2563c 43481c3d70ca b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c 61006e29497e 1e757ac98988 2ab211e0aecd 94e9e8605096 f91d3f9b7230 1e757ac98988 1e757ac98988 1e757ac98988 1e757ac98988 019026a8cf67 f91d3f9b7230 1e757ac98988 60a00fd76d58 1e757ac98988 019026a8cf67 1e757ac98988 1e757ac98988 1e757ac98988 b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c 43481c3d70ca b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c d683d8bc4be3 d683d8bc4be3 d683d8bc4be3 d683d8bc4be3 d683d8bc4be3 d683d8bc4be3 d683d8bc4be3 d683d8bc4be3 b745d5d2563c e29c688e6885 e29c688e6885 e29c688e6885 e29c688e6885 e29c688e6885 e29c688e6885 e29c688e6885 e29c688e6885 e29c688e6885 b745d5d2563c b745d5d2563c e29c688e6885 b745d5d2563c d683d8bc4be3 b745d5d2563c b745d5d2563c b745d5d2563c d683d8bc4be3 b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c 1e757ac98988 1e757ac98988 b1e1dffd595c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c 43481c3d70ca b1e1dffd595c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b745d5d2563c b1e1dffd595c f91d3f9b7230 | ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
${_('My account')} ${c.rhodecode_user.username} - ${c.rhodecode_name}
</%def>
<%def name="breadcrumbs_links()">
${_('My Account')}
</%def>
<%def name="page_nav()">
${self.menu('admin')}
</%def>
<%def name="main()">
<div class="box box-left">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
</div>
<!-- end box / title -->
<div>
${h.form(url('admin_settings_my_account_update'),method='put')}
<div class="form">
<div class="field">
<div class="gravatar_box">
<div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/></div>
<p>
%if c.use_gravatar:
<strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong>
<br/>${_('Using')} ${c.user.email}
%else:
<br/>${c.user.email}
%endif
</p>
</div>
</div>
<div class="field">
<div class="label">
<label>${_('API key')}</label> ${c.user.api_key}
</div>
</div>
<div class="fields">
<div class="field">
<div class="label">
<label for="username">${_('Username')}:</label>
</div>
<div class="input">
${h.text('username',class_="medium")}
</div>
</div>
<div class="field">
<div class="label">
<label for="new_password">${_('New password')}:</label>
</div>
<div class="input">
${h.password('new_password',class_="medium",autocomplete="off")}
</div>
</div>
<div class="field">
<div class="label">
<label for="password_confirmation">${_('New password confirmation')}:</label>
</div>
<div class="input">
${h.password('password_confirmation',class_="medium",autocomplete="off")}
</div>
</div>
<div class="field">
<div class="label">
<label for="name">${_('First Name')}:</label>
</div>
<div class="input">
${h.text('name',class_="medium")}
</div>
</div>
<div class="field">
<div class="label">
<label for="lastname">${_('Last Name')}:</label>
</div>
<div class="input">
${h.text('lastname',class_="medium")}
</div>
</div>
<div class="field">
<div class="label">
<label for="email">${_('Email')}:</label>
</div>
<div class="input">
${h.text('email',class_="medium")}
</div>
</div>
<div class="buttons">
${h.submit('save',_('Save'),class_="ui-button")}
${h.reset('reset',_('Reset'),class_="ui-button")}
</div>
</div>
</div>
${h.end_form()}
</div>
</div>
<div class="box box-right">
<!-- box / title -->
<div class="title">
<h5>
<input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
<a id="show_my" class="link-white" href="#my">${_('My repos')}</a> / <a id="show_perms" class="link-white" href="#perms">${_('My permissions')}</a>
</h5>
%if h.HasPermissionAny('hg.admin','hg.create.repository')():
<ul class="links">
<li>
<span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span>
</li>
</ul>
%endif
</div>
<!-- end box / title -->
<div id="my" class="table">
<div id='repos_list_wrap' class="yui-skin-sam">
<table id="repos_list">
<thead>
<tr>
<th></th>
<th class="left">${_('Name')}</th>
<th class="left">${_('Revision')}</th>
<th class="left">${_('Action')}</th>
<th class="left">${_('Action')}</th>
</thead>
<tbody>
<%namespace name="dt" file="/data_table/_dt_elements.html"/>
%if c.user_repos:
%for repo in c.user_repos:
<tr>
##QUICK MENU
<td class="quick_repo_menu">
${dt.quick_menu(repo['name'])}
</td>
##REPO NAME AND ICONS
<td class="reponame">
${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
</td>
##LAST REVISION
<td>
${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])}
</td>
<td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url('/images/icons/application_form_edit.png')}"/></a></td>
<td>
${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')}
${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo['name']+"');")}
${h.end_form()}
</td>
</tr>
%endfor
%else:
<div style="padding:5px 0px 10px 0px;">
${_('No repositories yet')}
%if h.HasPermissionAny('hg.admin','hg.create.repository')():
${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")}
%endif
</div>
%endif
</tbody>
</table>
</div>
</div>
<div id="perms" class="table" style="display:none">
%for section in sorted(c.rhodecode_user.permissions.keys()):
<div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
<div id='tbl_list_wrap_${section}' class="yui-skin-sam">
<table id="tbl_list_${section}">
<thead>
<tr>
<th class="left">${_('Name')}</th>
<th class="left">${_('Permission')}</th>
</thead>
<tbody>
%for k in c.rhodecode_user.permissions[section]:
<%
if section != 'global':
section_perm = c.rhodecode_user.permissions[section].get(k)
_perm = section_perm.split('.')[-1]
else:
_perm = section_perm = None
%>
%if _perm not in ['none']:
<tr>
<td>
%if section == 'repositories':
<a href="${h.url('summary_home',repo_name=k)}">${k}</a>
%elif section == 'repositories_groups':
<a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
%else:
${k}
%endif
</td>
<td>
%if section == 'global':
${h.bool2icon(True)}
%else:
<span class="perm_tag ${_perm}">${section_perm}</span>
%endif
</td>
</tr>
%endif
%endfor
</tbody>
</table>
</div>
%endfor
</div>
</div>
<script type="text/javascript">
var filter_activate = function(){
var nodes = YUQ('#my tr td a.repo_name');
var func = function(node){
return node.parentNode.parentNode.parentNode.parentNode;
}
q_filter('q_filter',YUQ('#my tr td a.repo_name'),func);
}
YUE.on('show_my','click',function(e){
YUD.setStyle('perms','display','none');
YUD.setStyle('my','display','');
YUD.get('q_filter').removeAttribute('disabled');
filter_activate();
YUE.preventDefault(e);
})
YUE.on('show_perms','click',function(e){
YUD.setStyle('my','display','none');
YUD.setStyle('perms','display','');
YUD.setAttribute('q_filter','disabled','disabled');
YUE.preventDefault(e);
})
// main table sorting
var myColumnDefs = [
{key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
{key:"name",label:"${_('Name')}",sortable:true,
sortOptions: { sortFunction: nameSort }},
{key:"tip",label:"${_('Tip')}",sortable:true,
sortOptions: { sortFunction: revisionSort }},
{key:"action1",label:"",sortable:false},
{key:"action2",label:"",sortable:false},
];
var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list"));
myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
myDataSource.responseSchema = {
fields: [
{key:"menu"},
{key:"name"},
{key:"tip"},
{key:"action1"},
{key:"action2"},
]
};
var trans_defs = {
sortedBy:{key:"name",dir:"asc"},
MSG_SORTASC:"${_('Click to sort ascending')}",
MSG_SORTDESC:"${_('Click to sort descending')}",
MSG_EMPTY:"${_('No records found.')}",
MSG_ERROR:"${_('Data error.')}",
MSG_LOADING:"${_('Loading...')}",
}
var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,trans_defs);
myDataTable.subscribe('postRenderEvent',function(oArgs) {
tooltip_activate();
quick_repo_menu();
filter_activate();
});
var permsColumnDefs = [
{key:"name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: permNameSort }},
{key:"perm",label:"${_('Permission')}",sortable:false,},
];
// perms repos table
var myDataSource2 = new YAHOO.util.DataSource(YUD.get("tbl_list_repositories"));
myDataSource2.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
myDataSource2.responseSchema = {
fields: [
{key:"name"},
{key:"perm"},
]
};
new YAHOO.widget.DataTable("tbl_list_wrap_repositories", permsColumnDefs, myDataSource2, trans_defs);
//perms groups table
var myDataSource3 = new YAHOO.util.DataSource(YUD.get("tbl_list_repositories_groups"));
myDataSource3.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
myDataSource3.responseSchema = {
fields: [
{key:"name"},
{key:"perm"},
]
};
new YAHOO.widget.DataTable("tbl_list_wrap_repositories_groups", permsColumnDefs, myDataSource3, trans_defs);
</script>
</%def>
|