##// END OF EJS Templates
users: updated UI for advanced section. Mostly fixes arround making clearer...
marcink -
r3447:814ebbd7 default
parent child Browse files
Show More
@@ -1,171 +1,171 b''
1 1 <%namespace name="base" file="/base/base.mako"/>
2 2
3 3 <%
4 4 elems = [
5 5 (_('User ID'), c.user.user_id, '', ''),
6 6 (_('Created on'), h.format_date(c.user.created_on), '', ''),
7 7 (_('Source of Record'), c.user.extern_type, '', ''),
8 8
9 9 (_('Last login'), c.user.last_login or '-', '', ''),
10 10 (_('Last activity'), c.user.last_activity, '', ''),
11 11
12 12 (_('Repositories'), len(c.user.repositories), '', [x.repo_name for x in c.user.repositories]),
13 13 (_('Repository groups'), len(c.user.repository_groups), '', [x.group_name for x in c.user.repository_groups]),
14 14 (_('User groups'), len(c.user.user_groups), '', [x.users_group_name for x in c.user.user_groups]),
15 15
16 16 (_('Reviewer of pull requests'), len(c.user.reviewer_pull_requests), '', ['Pull Request #{}'.format(x.pull_request.pull_request_id) for x in c.user.reviewer_pull_requests]),
17 17 (_('Assigned to review rules'), len(c.user_to_review_rules), '', [x for x in c.user_to_review_rules]),
18 18
19 19 (_('Member of User groups'), len(c.user.group_member), '', [x.users_group.users_group_name for x in c.user.group_member]),
20 20 (_('Force password change'), c.user.user_data.get('force_password_change', 'False'), '', ''),
21 21 ]
22 22 %>
23 23
24 24 <div class="panel panel-default">
25 25 <div class="panel-heading">
26 26 <h3 class="panel-title">${_('User: %s') % c.user.username}</h3>
27 27 </div>
28 28 <div class="panel-body">
29 29 ${base.dt_info_panel(elems)}
30 30 </div>
31 31 </div>
32 32
33 33 <div class="panel panel-default">
34 34 <div class="panel-heading">
35 35 <h3 class="panel-title">${_('Force Password Reset')}</h3>
36 36 </div>
37 37 <div class="panel-body">
38 38 ${h.secure_form(h.route_path('user_disable_force_password_reset', user_id=c.user.user_id), request=request)}
39 39 <div class="field">
40 40 <button class="btn btn-default" type="submit">
41 41 <i class="icon-unlock"></i> ${_('Disable forced password reset')}
42 42 </button>
43 43 </div>
44 44 <div class="field">
45 45 <span class="help-block">
46 46 ${_("Clear the forced password change flag.")}
47 47 </span>
48 48 </div>
49 49 ${h.end_form()}
50 50
51 51 ${h.secure_form(h.route_path('user_enable_force_password_reset', user_id=c.user.user_id), request=request)}
52 52 <div class="field">
53 53 <button class="btn btn-default" type="submit" onclick="return confirm('${_('Confirm to enable forced password change')}');">
54 54 <i class="icon-lock"></i> ${_('Enable forced password reset')}
55 55 </button>
56 56 </div>
57 57 <div class="field">
58 58 <span class="help-block">
59 59 ${_("When this is enabled user will have to change they password when they next use RhodeCode system. This will also forbid vcs operations until someone makes a password change in the web interface")}
60 60 </span>
61 61 </div>
62 62 ${h.end_form()}
63 63
64 64 </div>
65 65 </div>
66 66
67 67 <div class="panel panel-default">
68 68 <div class="panel-heading">
69 69 <h3 class="panel-title">${_('Personal Repository Group')}</h3>
70 70 </div>
71 71 <div class="panel-body">
72 72 ${h.secure_form(h.route_path('user_create_personal_repo_group', user_id=c.user.user_id), request=request)}
73 73
74 74 %if c.personal_repo_group:
75 75 <div class="panel-body-title-text">${_('Users personal repository group')} : ${h.link_to(c.personal_repo_group.group_name, h.route_path('repo_group_home', repo_group_name=c.personal_repo_group.group_name))}</div>
76 76 %else:
77 77 <div class="panel-body-title-text">
78 78 ${_('This user currently does not have a personal repository group')}
79 79 <br/>
80 80 ${_('New group will be created at: `/%(path)s`') % {'path': c.personal_repo_group_name}}
81 81 </div>
82 82 %endif
83 83 <button class="btn btn-default" type="submit" ${'disabled="disabled"' if c.personal_repo_group else ''}>
84 84 <i class="icon-folder-close"></i>
85 85 ${_('Create personal repository group')}
86 86 </button>
87 87 ${h.end_form()}
88 88 </div>
89 89 </div>
90 90
91 91
92 92 <div class="panel panel-danger">
93 93 <div class="panel-heading">
94 94 <h3 class="panel-title">${_('Delete User')}</h3>
95 95 </div>
96 96 <div class="panel-body">
97 97 ${h.secure_form(h.route_path('user_delete', user_id=c.user.user_id), request=request)}
98 98
99 <table class="display">
99 <table class="display rctable">
100 100 <tr>
101 101 <td>
102 102 ${_ungettext('This user owns %s repository.', 'This user owns %s repositories.', len(c.user.repositories)) % len(c.user.repositories)}
103 103 </td>
104 104 <td>
105 %if len(c.user.repositories) > 0:
106 <input type="radio" id="user_repos_1" name="user_repos" value="detach" checked="checked"/> <label for="user_repos_1">${_('Detach repositories')}</label>
107 %endif
105 <input type="radio" id="user_repos_1" name="user_repos" value="detach" checked="checked" ${'disabled=1' if len(c.user.repositories) == 0 else ''} /> <label for="user_repos_1">${_('Detach repositories')}</label>
108 106 </td>
109 107 <td>
110 %if len(c.user.repositories) > 0:
111 <input type="radio" id="user_repos_2" name="user_repos" value="delete" /> <label for="user_repos_2">${_('Delete repositories')}</label>
112 %endif
108 <input type="radio" id="user_repos_2" name="user_repos" value="delete" ${'disabled=1' if len(c.user.repositories) == 0 else ''} /> <label for="user_repos_2">${_('Delete repositories')}</label>
113 109 </td>
114 110 </tr>
115 111
116 112 <tr>
117 113 <td>
118 114 ${_ungettext('This user owns %s repository group.', 'This user owns %s repository groups.', len(c.user.repository_groups)) % len(c.user.repository_groups)}
119 115 </td>
120 116 <td>
121 %if len(c.user.repository_groups) > 0:
122 <input type="radio" id="user_repo_groups_1" name="user_repo_groups" value="detach" checked="checked"/> <label for="user_repo_groups_1">${_('Detach repository groups')}</label>
123 %endif
117 <input type="radio" id="user_repo_groups_1" name="user_repo_groups" value="detach" checked="checked" ${'disabled=1' if len(c.user.repository_groups) == 0 else ''} /> <label for="user_repo_groups_1">${_('Detach repository groups')}</label>
124 118 </td>
125 119 <td>
126 %if len(c.user.repository_groups) > 0:
127 <input type="radio" id="user_repo_groups_2" name="user_repo_groups" value="delete" /> <label for="user_repo_groups_2">${_('Delete repositories')}</label>
128 %endif
120 <input type="radio" id="user_repo_groups_2" name="user_repo_groups" value="delete" ${'disabled=1' if len(c.user.repository_groups) == 0 else ''}/> <label for="user_repo_groups_2">${_('Delete repositories')}</label>
129 121 </td>
130 122 </tr>
131 123
132 124 <tr>
133 125 <td>
134 126 ${_ungettext('This user owns %s user group.', 'This user owns %s user groups.', len(c.user.user_groups)) % len(c.user.user_groups)}
135 127 </td>
136 128 <td>
137 %if len(c.user.user_groups) > 0:
138 <input type="radio" id="user_user_groups_1" name="user_user_groups" value="detach" checked="checked"/> <label for="user_user_groups_1">${_('Detach user groups')}</label>
139 %endif
129 <input type="radio" id="user_user_groups_1" name="user_user_groups" value="detach" checked="checked" ${'disabled=1' if len(c.user.user_groups) == 0 else ''}/> <label for="user_user_groups_1">${_('Detach user groups')}</label>
140 130 </td>
141 131 <td>
142 %if len(c.user.user_groups) > 0:
143 <input type="radio" id="user_user_groups_2" name="user_user_groups" value="delete" /> <label for="user_user_groups_2">${_('Delete repositories')}</label>
144 %endif
132 <input type="radio" id="user_user_groups_2" name="user_user_groups" value="delete" ${'disabled=1' if len(c.user.user_groups) == 0 else ''}/> <label for="user_user_groups_2">${_('Delete repositories')}</label>
145 133 </td>
146 134 </tr>
147 135 </table>
148 136 <div style="margin: 0 0 20px 0" class="fake-space"></div>
137 <div class="pull-left">
138 % if len(c.user.repositories) > 0 or len(c.user.repository_groups) > 0 or len(c.user.user_groups) > 0:
139 % endif
140
141 <span style="padding: 0 5px 0 0">${_('New owner for detached objects')}:</span>
142 <div class="pull-right">${base.gravatar_with_user(c.first_admin.email, 16)}</div>
143 </div>
144 <div style="clear: both">
145
146 <div>
147 <p class="help-block">
148 ${_("When selecting the detach option, the depending objects owned by this user will be assigned to the above user.")}
149 <br/>
150 ${_("The delete option will delete the user and all his owned objects!")}
151 </p>
152 </div>
153
154 % if c.can_delete_user_message:
155 <p class="pre-formatting">${c.can_delete_user_message}</p>
156 % endif
157 </div>
158
159 <div style="margin: 0 0 20px 0" class="fake-space"></div>
149 160
150 161 <div class="field">
151 162 <button class="btn btn-small btn-danger" type="submit"
152 163 onclick="return confirm('${_('Confirm to delete this user: %s') % c.user.username}');"
153 164 ${"disabled" if not c.can_delete_user else ""}>
154 165 ${_('Delete this user')}
155 166 </button>
156 167 </div>
157 % if c.can_delete_user_message:
158 <p class="help-block pre-formatting">${c.can_delete_user_message}</p>
159 % endif
160
161 <div class="field">
162 <span class="help-block">
163 %if len(c.user.repositories) > 0 or len(c.user.repository_groups) > 0 or len(c.user.user_groups) > 0:
164 <p class="help-block">${_("When selecting the detach option, the depending objects owned by this user will be assigned to the `%s` super admin in the system. The delete option will delete the user's repositories!") % (c.first_admin.full_name)}</p>
165 %endif
166 </span>
167 </div>
168 168
169 169 ${h.end_form()}
170 170 </div>
171 171 </div>
General Comments 0
You need to be logged in to leave comments. Login now