Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
92f5b058
Commit
92f5b058
authored
Dec 08, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to create a note when blocking a user
parent
408f9c3b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
1 deletion
+32
-1
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+1
-1
app/views/admin/users/_form.html.haml
app/views/admin/users/_form.html.haml
+6
-0
app/views/admin/users/index.html.haml
app/views/admin/users/index.html.haml
+3
-0
db/migrate/20151208110020_add_note_to_users.rb
db/migrate/20151208110020_add_note_to_users.rb
+5
-0
features/admin/users.feature
features/admin/users.feature
+6
-0
features/steps/admin/users.rb
features/steps/admin/users.rb
+11
-0
No files found.
app/controllers/admin/users_controller.rb
View file @
92f5b058
...
@@ -148,7 +148,7 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -148,7 +148,7 @@ class Admin::UsersController < Admin::ApplicationController
:email
,
:remember_me
,
:bio
,
:name
,
:username
,
:email
,
:remember_me
,
:bio
,
:name
,
:username
,
:skype
,
:linkedin
,
:twitter
,
:website_url
,
:color_scheme_id
,
:theme_id
,
:force_random_password
,
:skype
,
:linkedin
,
:twitter
,
:website_url
,
:color_scheme_id
,
:theme_id
,
:force_random_password
,
:extern_uid
,
:provider
,
:password_expires_at
,
:avatar
,
:hide_no_ssh_key
,
:hide_no_password
,
:extern_uid
,
:provider
,
:password_expires_at
,
:avatar
,
:hide_no_ssh_key
,
:hide_no_password
,
:projects_limit
,
:can_create_group
,
:admin
,
:key_id
:projects_limit
,
:can_create_group
,
:admin
,
:key_id
,
:note
)
)
end
end
...
...
app/views/admin/users/_form.html.haml
View file @
92f5b058
...
@@ -81,6 +81,12 @@
...
@@ -81,6 +81,12 @@
=
f
.
label
:website_url
,
'Website'
,
class:
'control-label'
=
f
.
label
:website_url
,
'Website'
,
class:
'control-label'
.col-sm-10
=
f
.
text_field
:website_url
,
class:
'form-control'
.col-sm-10
=
f
.
text_field
:website_url
,
class:
'form-control'
%fieldset
%legend
Admin notes
.form-group
=
f
.
label
:note
,
'Note'
,
class:
'control-label'
.col-sm-10
=
f
.
text_area
:note
,
class:
'form-control'
.form-actions
.form-actions
-
if
@user
.
new_record?
-
if
@user
.
new_record?
=
f
.
submit
'Create user'
,
class:
"btn btn-create"
=
f
.
submit
'Create user'
,
class:
"btn btn-create"
...
...
app/views/admin/users/index.html.haml
View file @
92f5b058
...
@@ -80,6 +80,9 @@
...
@@ -80,6 +80,9 @@
-
else
-
else
%i
.fa.fa-user.cgreen
%i
.fa.fa-user.cgreen
=
link_to
user
.
name
,
[
:admin
,
user
]
=
link_to
user
.
name
,
[
:admin
,
user
]
-
if
user
.
note
=
link_to
"#"
,
{
"data-toggle"
=>
"tooltip"
,
title:
user
.
note
,
class:
"user-note"
}
do
=
icon
(
"sticky-note-o cgrey"
)
-
if
user
.
admin?
-
if
user
.
admin?
%strong
.cred
(Admin)
%strong
.cred
(Admin)
-
if
user
==
current_user
-
if
user
==
current_user
...
...
db/migrate/20151208110020_add_note_to_users.rb
0 → 100644
View file @
92f5b058
class
AddNoteToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:note
,
:text
end
end
features/admin/users.feature
View file @
92f5b058
...
@@ -63,3 +63,9 @@ Feature: Admin Users
...
@@ -63,3 +63,9 @@ Feature: Admin Users
And
I visit
"Pete"
identities page in admin
And
I visit
"Pete"
identities page in admin
And
I remove twitter identity
And
I remove twitter identity
Then
I should not see twitter details
Then
I should not see twitter details
Scenario
:
Add note to user attributes
Given
I visit admin users page
And
click edit on my user
When
I submit a note
Then
I see note tooltip
features/steps/admin/users.rb
View file @
92f5b058
...
@@ -164,4 +164,15 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -164,4 +164,15 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
step
'click on ssh keys tab'
do
step
'click on ssh keys tab'
do
click_link
'SSH keys'
click_link
'SSH keys'
end
end
step
'I submit a note'
do
@note
=
'The reason to change status'
fill_in
'Note'
,
with:
@note
click_button
'Save'
end
step
'I see note tooltip'
do
visit
admin_users_path
expect
(
find
(
".user-note"
)[
"title"
]).
to
have_content
(
@note
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment