user-accounts: show info about password for external accounts.

This commit is contained in:
Marcin Kuzminski 2020-02-21 22:03:35 +01:00
parent 54a47cd524
commit c4c620b38b
5 changed files with 27 additions and 7 deletions

View file

@ -76,6 +76,7 @@ class MyAccountView(BaseAppView, DataGridAppView):
def my_account_profile(self):
c = self.load_default_context()
c.active = 'profile'
c.extern_type = c.user.extern_type
return self._get_template_context(c)
@LoginRequired()

View file

@ -71,7 +71,7 @@
<div class="input">
${h.text('description', class_='medium', placeholder=_('Description'))}
${h.hidden('lifetime')}
${h.select('role', '', c.role_options)}
${h.select('role', request.GET.get('token_role', ''), c.role_options)}
% if c.allow_scoped_tokens:
${h.hidden('scope_repo_id')}

View file

@ -4,7 +4,9 @@
% if c.extern_type != 'rhodecode':
<p>${_('Your user account details are managed by an external source. Details cannot be managed here.')}
<br/>${_('Source type')}: <strong>${c.extern_type}</strong>
<br/>${_('For VCS access please generate')}
<a href="${h.route_path('my_account_auth_tokens', _query={'token_role':'token_role_vcs'})}">Authentication Token</a> or <a href="${h.route_path('my_account_ssh_keys_generate')}">SSH Key</a>.
<br/>${_('Source type')}: <strong>${c.extern_type}</strong>
</p>
% else:
${c.form.render() | n}

View file

@ -8,6 +8,17 @@
</div>
<div class="panel-body fields">
%if c.extern_type != 'rhodecode':
<% readonly = "readonly" %>
<% disabled = " disabled" %>
<div class="alert-warning" style="margin:0px 0px 20px 0px; padding: 10px">
<strong>${_('This user was created from external source (%s). Editing some of the settings is limited.' % c.extern_type)}</strong>
</div>
<div style="margin:-10px 0px 20px 0px;">
${_('For VCS access please generate')}
<a href="${h.route_path('my_account_auth_tokens', _query={'token_role':'token_role_vcs'})}">Authentication Token</a> or <a href="${h.route_path('my_account_ssh_keys_generate')}">SSH Key</a>.
</div>
%endif
<div class="field">
<div class="label">
${_('Photo')}:

View file

@ -11,13 +11,19 @@
%if c.extern_type != 'rhodecode':
<% readonly = "readonly" %>
<% disabled = "disabled" %>
<% disabled = " disabled" %>
<div class="alert-warning" style="margin:0px 0px 20px 0px; padding: 10px">
<strong>${_('This user was created from external source (%s). Editing some of the settings is limited.' % c.extern_type)}</strong>
</div>
<div style="margin:-10px 0px 20px 0px;">
${_('For VCS access please generate')}
<a href="${h.route_path('my_account_auth_tokens', _query={'token_role':'token_role_vcs'})}">Authentication Token</a> or <a href="${h.route_path('my_account_ssh_keys_generate')}">SSH Key</a>.
</div>
%endif
%if c.extern_type != 'rhodecode':
<div class="infoform">
<div class="fields">
<p>${_('Your user account details are managed by an external source. Details cannot be managed here.')}
<br/>${_('Source type')}: <strong>${c.extern_type}</strong>
</p>
<div class="field">
<div class="label">
<label for="username">${_('Username')}:</label>